mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[uuid] Allow native Buffer in place of number[] (#39956)
This commit is contained in:
parent
500811ec0e
commit
e7d0af6a9d
1
types/uuid/index.d.ts
vendored
1
types/uuid/index.d.ts
vendored
@ -3,6 +3,7 @@
|
||||
// Definitions by: Oliver Hoffmann <https://github.com/iamolivinius>
|
||||
// Felipe Ochoa <https://github.com/felipeochoa>
|
||||
// Chris Barth <https://github.com/cjbarth>
|
||||
// Rauno Viskus <https://github.com/rauno56>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
|
||||
9
types/uuid/interfaces.d.ts
vendored
9
types/uuid/interfaces.d.ts
vendored
@ -2,15 +2,16 @@
|
||||
|
||||
// Uses ArrayLike to admit Unit8 and co.
|
||||
export type OutputBuffer = ArrayLike<number> | Buffer;
|
||||
export type InputBuffer = ArrayLike<number> | Buffer;
|
||||
|
||||
export interface V1Options {
|
||||
node?: number[];
|
||||
node?: InputBuffer;
|
||||
clockseq?: number;
|
||||
msecs?: number | Date;
|
||||
nsecs?: number;
|
||||
}
|
||||
|
||||
export type V4Options = {random: number[]} | {rng(): number[]};
|
||||
export type V4Options = {random: InputBuffer} | {rng(): InputBuffer};
|
||||
|
||||
export type v1String = (options?: V1Options) => string;
|
||||
export type v1Buffer = <T extends OutputBuffer>(options: V1Options | null | undefined, buffer: T, offset?: number) => T;
|
||||
@ -20,6 +21,6 @@ export type v4String = (options?: V4Options) => string;
|
||||
export type v4Buffer = <T extends OutputBuffer>(options: V4Options | null | undefined, buffer: T, offset?: number) => T;
|
||||
export type v4 = v4Buffer & v4String;
|
||||
|
||||
export type v5String = (name: string | number[], namespace: string | number[]) => string;
|
||||
export type v5Buffer = <T extends OutputBuffer>(name: string | number[], namespace: string | number[], buffer: T, offset?: number) => T;
|
||||
export type v5String = (name: string | InputBuffer, namespace: string | InputBuffer) => string;
|
||||
export type v5Buffer = <T extends OutputBuffer>(name: string | InputBuffer, namespace: string | InputBuffer, buffer: T, offset?: number) => T;
|
||||
export type v5 = v5Buffer & v5String;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user