From 4e8425f1fcdc1c1d98501a50d8426ed9b92c436c Mon Sep 17 00:00:00 2001 From: Redfire Date: Sun, 11 Aug 2024 22:30:18 +0800 Subject: [PATCH] Updated Bindings --- bindings/globals/flow/clone.js.flow | 9 +++++++++ bindings/globals/flow/file.js.flow | 2 ++ bindings/globals/flow/url.js.flow | 4 ++++ bindings/globals/typescript/clone.d.ts | 7 +++++++ bindings/globals/typescript/file.d.ts | 2 ++ bindings/globals/typescript/url.d.ts | 6 ++++++ 6 files changed, 30 insertions(+) create mode 100644 bindings/globals/flow/clone.js.flow create mode 100644 bindings/globals/typescript/clone.d.ts diff --git a/bindings/globals/flow/clone.js.flow b/bindings/globals/flow/clone.js.flow new file mode 100644 index 00000000..90802be4 --- /dev/null +++ b/bindings/globals/flow/clone.js.flow @@ -0,0 +1,9 @@ +// @flow + +declare type Transferable = ArrayBuffer; + +declare interface StructuredSerializeOptions { + transfer?: Transferable[] +} + +declare function structuredClone(value: T, options?: StructuredSerializeOptions): T; diff --git a/bindings/globals/flow/file.js.flow b/bindings/globals/flow/file.js.flow index db2633d7..e2b55f3e 100644 --- a/bindings/globals/flow/file.js.flow +++ b/bindings/globals/flow/file.js.flow @@ -19,6 +19,8 @@ declare class Blob { text(): Promise; arrayBuffer(): Promise; + + bytes(): Promise; } declare interface FileOptions extends BlobOptions { diff --git a/bindings/globals/flow/url.js.flow b/bindings/globals/flow/url.js.flow index 9aa91361..2a312813 100644 --- a/bindings/globals/flow/url.js.flow +++ b/bindings/globals/flow/url.js.flow @@ -4,6 +4,10 @@ declare class URL { constructor(url: string, base?: string): URL; static canParse(url: string, base?: string): boolean; + static parse(url: string, base?: string): URL | null; + + static createObjectURL(object: Blob): string; + static revokeObjectURL(url: string): void; get href(): string; set href(href: string): void; diff --git a/bindings/globals/typescript/clone.d.ts b/bindings/globals/typescript/clone.d.ts new file mode 100644 index 00000000..3bd39a1a --- /dev/null +++ b/bindings/globals/typescript/clone.d.ts @@ -0,0 +1,7 @@ +declare type Transferable = ArrayBuffer; + +declare interface StructuredSerializeOptions { + transfer?: Transferable[] +} + +declare function structuredClone(value: T, options?: StructuredSerializeOptions): T; diff --git a/bindings/globals/typescript/file.d.ts b/bindings/globals/typescript/file.d.ts index 631d549f..1cb306ba 100644 --- a/bindings/globals/typescript/file.d.ts +++ b/bindings/globals/typescript/file.d.ts @@ -19,6 +19,8 @@ declare class Blob { text(): Promise; arrayBuffer(): Promise; + + bytes(): Promise; } declare interface FileOptions extends BlobOptions { diff --git a/bindings/globals/typescript/url.d.ts b/bindings/globals/typescript/url.d.ts index 5cb5f396..fa911138 100644 --- a/bindings/globals/typescript/url.d.ts +++ b/bindings/globals/typescript/url.d.ts @@ -47,6 +47,12 @@ declare class URL { static canParse(url: string, base?: string): boolean; + static parse(url: string, base?: string): URL | null + + static createObjectURL(object: Blob): string; + + static revokeObjectURL(url: string): void; + toString(): string; toJSON(): string;