🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@types/ref-array

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/ref-array

TypeScript definitions for ref-array

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
0.0.31
Version published
Weekly downloads
132
26.92%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/ref-array

Summary

This package contains type definitions for ref-array (https://github.com/TooTallNate/ref-array).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ref-array.

index.d.ts

import ref = require("ref");

interface ArrayType<T> extends ref.Type {
    BYTES_PER_ELEMENT: number;
    fixedLength: number;
    /** The reference to the base type. */
    type: ref.Type;

    /**
     * Accepts a Buffer instance that should be an already-populated with data
     * for the ArrayType. The "length" of the Array is determined by searching
     * through the buffer's contents until an aligned NULL pointer is encountered.
     */
    untilZeros(buffer: Buffer): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };

    new(length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
    new(data: number[], length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
    new(data: Buffer, length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
    (length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
    (data: number[], length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
    (data: Buffer, length?: number): {
        [i: number]: T;
        length: number;
        toArray(): T[];
        toJSON(): T[];
        inspect(): string;
        buffer: Buffer;
        ref(): Buffer;
    };
}

/**
 * The array type meta-constructor.
 * The returned constructor's API is highly influenced by the WebGL
 * TypedArray API.
 */
declare var ArrayType: {
    new<T>(type: ref.Type, length?: number): ArrayType<T>;
    new<T>(type: string, length?: number): ArrayType<T>;
    <T>(type: ref.Type, length?: number): ArrayType<T>;
    <T>(type: string, length?: number): ArrayType<T>;
};

export = ArrayType;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/ref

Credits

These definitions were written by Paul Loyd.

FAQs

Package last updated on 07 Nov 2023

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