diff --git a/src/v1.ts b/src/v1.ts index 0218251d..1accfd51 100644 --- a/src/v1.ts +++ b/src/v1.ts @@ -25,7 +25,7 @@ type V1State = { const _state: V1State = {}; function v1(options?: Version1Options, buf?: undefined, offset?: number): string; -function v1(options?: Version1Options, buf?: Uint8Array, offset?: number): Uint8Array; +function v1(options: Version1Options | undefined, buf: Uint8Array, offset?: number): Uint8Array; function v1(options?: Version1Options, buf?: Uint8Array, offset?: number): UUIDTypes { let bytes: Uint8Array; diff --git a/src/v3.ts b/src/v3.ts index caf9dcc9..83030ca2 100644 --- a/src/v3.ts +++ b/src/v3.ts @@ -4,18 +4,6 @@ import v35, { DNS, URL } from './v35.js'; export { DNS, URL } from './v35.js'; -function v3( - value: string | Uint8Array, - namespace: UUIDTypes, - buf?: undefined, - offset?: number -): string; -function v3( - value: string | Uint8Array, - namespace: UUIDTypes, - buf?: Uint8Array, - offset?: number -): Uint8Array; function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number) { return v35(0x30, md5, value, namespace, buf, offset); } diff --git a/src/v4.ts b/src/v4.ts index 3370e554..37346adf 100644 --- a/src/v4.ts +++ b/src/v4.ts @@ -4,7 +4,7 @@ import rng from './rng.js'; import { unsafeStringify } from './stringify.js'; function v4(options?: Version4Options, buf?: undefined, offset?: number): string; -function v4(options?: Version4Options, buf?: Uint8Array, offset?: number): Uint8Array; +function v4(options: Version4Options | undefined, buf: Uint8Array, offset?: number): Uint8Array; function v4(options?: Version4Options, buf?: Uint8Array, offset?: number): UUIDTypes { if (native.randomUUID && !buf && !options) { return native.randomUUID(); diff --git a/src/v5.ts b/src/v5.ts index fd01efd6..5e5c0e10 100644 --- a/src/v5.ts +++ b/src/v5.ts @@ -4,18 +4,6 @@ import v35, { DNS, URL } from './v35.js'; export { DNS, URL } from './v35.js'; -function v5( - value: string | Uint8Array, - namespace: UUIDTypes, - buf?: undefined, - offset?: number -): string; -function v5( - value: string | Uint8Array, - namespace: UUIDTypes, - buf?: Uint8Array, - offset?: number -): Uint8Array; function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: Uint8Array, offset?: number) { return v35(0x50, sha1, value, namespace, buf, offset); } diff --git a/src/v6.ts b/src/v6.ts index 665d1d4e..a32bff6e 100644 --- a/src/v6.ts +++ b/src/v6.ts @@ -4,7 +4,7 @@ import v1 from './v1.js'; import v1ToV6 from './v1ToV6.js'; function v6(options?: Version6Options, buf?: undefined, offset?: number): string; -function v6(options?: Version6Options, buf?: Uint8Array, offset?: number): Uint8Array; +function v6(options: Version6Options | undefined, buf: Uint8Array, offset?: number): Uint8Array; function v6(options?: Version6Options, buf?: Uint8Array, offset?: number): UUIDTypes { options ??= {}; offset ??= 0; diff --git a/src/v7.ts b/src/v7.ts index f24ba3af..1a41f3ce 100644 --- a/src/v7.ts +++ b/src/v7.ts @@ -10,7 +10,7 @@ type V7State = { const _state: V7State = {}; function v7(options?: Version7Options, buf?: undefined, offset?: number): string; -function v7(options?: Version7Options, buf?: Uint8Array, offset?: number): Uint8Array; +function v7(options: Version7Options | undefined, buf: Uint8Array, offset?: number): Uint8Array; function v7(options?: Version7Options, buf?: Uint8Array, offset?: number): UUIDTypes { let bytes: Uint8Array;