# @types/ref-array

> TypeScript definitions for ref-array

Latest version **0.0.31** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/ref-array
pnpm add @types/ref-array
yarn add @types/ref-array
bun add @types/ref-array
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.31 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/ref-array
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ref-array
- npm.io page: https://npm.io/package/@types/ref-array

## Dependencies (1)

- [@types/ref](https://npm.io/package/@types/ref.md) *

## Recent versions

- 0.0.31 (latest) — 2023-11-07
- 0.0.28 (ts2.0) — 2016-09-19
- 0.0.30 — 2023-10-18
- 0.0.29 — 2023-09-27
- 0.0.27 — 2016-07-14
- 0.0.26-alpha — 2016-07-08
- 0.0.25-alpha — 2016-07-04
- 0.0.24-alpha — 2016-07-02
- 0.0.23-alpha — 2016-07-01
- 0.0.22-alpha — 2016-07-01
- 0.0.21-alpha — 2016-05-25
- 0.0.20-alpha — 2016-05-20
- 0.0.15-alpha — 2016-05-19
- 0.0.14-alpha — 2016-05-17

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ref-array/index.d.ts)
````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](https://npmjs.com/package/@types/ref)

# Credits
These definitions were written by [Paul Loyd](https://github.com/loyd).

---
_Source: https://npm.io/package/@types/ref-array · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
