Skip to content

Commit 9580efa

Browse files
committed
[types] improve types
1 parent 25825a3 commit 9580efa

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

index.d.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import type names from 'possible-typed-array-names';
2+
import type { TypedArray } from 'is-typed-array';
23

34
declare function typedArrayLength(value: typedArrayLength.TypedArray): number;
45
declare function typedArrayLength(value: unknown): false;
56

67
declare namespace typedArrayLength {
7-
type TypedArray =
8-
| Int8Array
9-
| Uint8Array
10-
| Uint8ClampedArray
11-
| Int16Array
12-
| Uint16Array
13-
| Int32Array
14-
| Uint32Array
15-
| Float32Array
16-
| Float64Array
17-
| BigInt64Array
18-
| BigUint64Array;
8+
export type { TypedArray };
199

20-
type TypedArrayName = typeof names[number];
10+
export type TypedArrayName = typeof names[number];
2111
}
2212

2313
export = typedArrayLength;

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var gPO = require('reflect.getprototypeof/polyfill')();
1313
/** @typedef {{ [k in `$${import('.').TypedArrayName}` | '__proto__']: k extends '__proto__' ? null : TypedArrayLengthGetter }} Cache */
1414

1515
/** @type {Cache} */
16-
// @ts-expect-error TS doesn't seem to have a "will eventually satisfy" type
16+
// @ts-expect-error TS `satisfies` doesn't work in jsdoc
1717
var getters = { __proto__: null };
1818
var oDP = Object.defineProperty;
1919
if (gOPD) {

0 commit comments

Comments
 (0)