typedarray-dts
TypeScript type definitions for JS TypedArrays
Last updated 8 years ago by mgthomas99 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install typedarray-dts 
SYNC missed versions from official npm registry.

typedarray-dts

Type definitions for JavaScript typed arrays.

There are 9 typed array types in JavaScript:

  • Int8Array
  • Int16Array
  • Int32Array
  • Uint8Array
  • Uint16Array
  • Uint32Array
  • Uint8ClampedArray
  • Float32Array
  • Float64Array

It is not unusual to require a variable that is of a TypedArray type. However, the JavaScript standard library type definitions do not include an abstract TypedArray type. This package implements one.

Usage

This package does not implement functionality, only type definitions.

import { TypedArray } from "typedarray-dts";

function doSomething(x: TypedArray): void {
    // IntelliSense now knows `x` is a `TypedArray`!
}

There are two other types provided by this package: SignedTypedArray and UnsignedTypedArray:

import { SignedTypedArray, UnsignedTypedArray } from "typedarray-dts";

function doSomethingSigned(x: SignedTypedArray): void {
    // `x` is a signed `TypedArray`!
}

function doSomethingUnsigned(x: UnsignedTypedArray): void {
    // `x` is an unsigned `TypedArray`!
}

License

Refer to the LICENSE file for license information.

Current Tags

  • 1.0.0                                ...           latest (8 years ago)

1 Versions

  • 1.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |