Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/ndarray

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/ndarray

TypeScript definitions for ndarray

  • 1.0.10
  • ts3.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
decreased by-23.13%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/ndarray

Summary

This package contains type definitions for ndarray (https://github.com/scijs/ndarray).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ndarray.

index.d.ts

// Type definitions for ndarray 1.0
// Project: https://github.com/scijs/ndarray, https://github.com/mikolalysenko/ndarray
// Definitions by: Giff Song <https://github.com/pawsong>,
//                 taoqf <https://github.com/taoqf>
//                 Axel Bocciarelli <https://github.com/axelboc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

declare function ndarray<D extends ndarray.Data = ndarray.Data<number>>(
    data: D,
    shape?: number[],
    stride?: number[],
    offset?: number,
): ndarray.NdArray<D>;

declare namespace ndarray {
    interface NdArray<D extends Data = Data<number>> {
        data: D;
        shape: number[];
        stride: number[];
        offset: number;
        dtype: DataType<D>;
        size: number;
        order: number[];
        dimension: number;
        get(...args: number[]): Value<D>;
        set(...args: number[]): Value<D>;
        index(...args: number[]): Value<D>;
        lo(...args: number[]): NdArray<D>;
        hi(...args: number[]): NdArray<D>;
        step(...args: number[]): NdArray<D>;
        transpose(...args: number[]): NdArray<D>;
        pick(...args: Array<number | null>): NdArray<D>;
        T: NdArray<D>;
    }

    type Data<T = any> = T[] | TypedArray;
    type TypedArray =
        | Int8Array
        | Int16Array
        | Int32Array
        | Uint8Array
        | Uint8ClampedArray
        | Uint16Array
        | Uint32Array
        | Float32Array
        | Float64Array;

    type Value<D extends Data> = D extends Array<infer T> ? T : number;

    type DataType<D extends Data = Data> = D extends Int8Array
        ? 'int8'
        : D extends Int16Array
        ? 'int16'
        : D extends Int32Array
        ? 'int32'
        : D extends Uint8Array
        ? 'uint8'
        : D extends Uint8ClampedArray
        ? 'uint8_clamped'
        : D extends Uint16Array
        ? 'uint16'
        : D extends Uint32Array
        ? 'uint32'
        : D extends Float32Array
        ? 'float32'
        : D extends Float64Array
        ? 'float64'
        : 'array';
}

export = ndarray;

Additional Details

  • Last updated: Mon, 12 Jul 2021 12:01:21 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Giff Song, taoqf, and Axel Bocciarelli.

FAQs

Package last updated on 12 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc