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

typedarray-dts

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedarray-dts

TypeScript type definitions for JS TypedArrays

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 03 Jan 2018

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