Skip to content

Commit

Permalink
[types] improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 17, 2024
1 parent 3b5deb1 commit f45042c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
19 changes: 6 additions & 13 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Float32Array
| Float64Array
| BigInt64Array
| BigUint64Array;
import type { TypedArray } from 'is-typed-array';

declare function typedArrayBuffer(x: TypedArray): ArrayBuffer;
declare namespace typedArrayBuffer{
export type { TypedArray };
}

declare function typedArrayBuffer(x: typedArrayBuffer.TypedArray): ArrayBuffer;

export = typedArrayBuffer;
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var $TypeError = require('es-errors/type');

var callBound = require('call-bound');

/** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true);

var isTypedArray = require('is-typed-array');
Expand Down

0 comments on commit f45042c

Please sign in to comment.