From da28fc1e7b4551281ad14d49c7fb396010ba0107 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 11 Apr 2020 16:25:31 -0400 Subject: dedup type declarations (#4718) Blob, BlobPart, BufferSource, ReferrerPolicy, BlobPart, AbortSignal, AbortSignalEventMap --- cli/js/web/blob.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'cli/js/web/blob.ts') diff --git a/cli/js/web/blob.ts b/cli/js/web/blob.ts index 90480c89c..ab6074b91 100644 --- a/cli/js/web/blob.ts +++ b/cli/js/web/blob.ts @@ -63,7 +63,7 @@ function collectSequenceNotCRLF( } function toUint8Arrays( - blobParts: domTypes.BlobPart[], + blobParts: BlobPart[], doNormalizeLineEndingsToNative: boolean ): Uint8Array[] { const ret: Uint8Array[] = []; @@ -102,7 +102,7 @@ function toUint8Arrays( } function processBlobParts( - blobParts: domTypes.BlobPart[], + blobParts: BlobPart[], options: domTypes.BlobPropertyBag ): Uint8Array { const normalizeLineEndingsToNative = options.ending === "native"; @@ -164,17 +164,14 @@ async function readBytes( // A WeakMap holding blob to byte array mapping. // Ensures it does not impact garbage collection. -export const blobBytesWeakMap = new WeakMap(); +export const blobBytesWeakMap = new WeakMap(); -export class DenoBlob implements domTypes.Blob { +export class DenoBlob implements Blob { [bytesSymbol]: Uint8Array; readonly size: number = 0; readonly type: string = ""; - constructor( - blobParts?: domTypes.BlobPart[], - options?: domTypes.BlobPropertyBag - ) { + constructor(blobParts?: BlobPart[], options?: domTypes.BlobPropertyBag) { if (arguments.length === 0) { this[bytesSymbol] = new Uint8Array(); return; -- cgit v1.2.3