SongGuess
    Preparing search index...

    Interface ServiceWorkerGlobalScope

    The ServiceWorkerGlobalScope interface of the Service Worker API represents the global execution context of a service worker. Available only in secure contexts.

    MDN Reference

    interface ServiceWorkerGlobalScope {
        AbortController: { prototype: AbortController; new (): AbortController };
        AbortSignal: {
            prototype: AbortSignal;
            abort(reason?: any): AbortSignal;
            any(signals: AbortSignal[]): AbortSignal;
            timeout(milliseconds: number): AbortSignal;
            new (): AbortSignal;
        };
        Blob: {
            prototype: Blob;
            new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
        };
        Body: typeof Body;
        ByteLengthQueuingStrategy: {
            prototype: ByteLengthQueuingStrategy;
            new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
        };
        Cache: { prototype: Cache; new (): Cache };
        caches: CacheStorage;
        CacheStorage: { prototype: CacheStorage; new (): CacheStorage };
        CloseEvent: {
            prototype: CloseEvent;
            new (type: string, eventInitDict?: CloseEventInit): CloseEvent;
        };
        Cloudflare: Cloudflare;
        CompressionStream: {
            prototype: CompressionStream;
            new (format: CompressionFormat): CompressionStream;
        };
        CountQueuingStrategy: {
            prototype: CountQueuingStrategy;
            new (init: QueuingStrategyInit): CountQueuingStrategy;
        };
        crypto: Crypto;
        Crypto: { prototype: Crypto; new (): Crypto };
        CryptoKey: { prototype: CryptoKey; new (): CryptoKey };
        CustomEvent: {
            prototype: CustomEvent;
            new <T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
        };
        DecompressionStream: {
            prototype: DecompressionStream;
            new (format: CompressionFormat): DecompressionStream;
        };
        DOMException: {
            ABORT_ERR: 20;
            DATA_CLONE_ERR: 25;
            DOMSTRING_SIZE_ERR: 2;
            HIERARCHY_REQUEST_ERR: 3;
            INDEX_SIZE_ERR: 1;
            INUSE_ATTRIBUTE_ERR: 10;
            INVALID_ACCESS_ERR: 15;
            INVALID_CHARACTER_ERR: 5;
            INVALID_MODIFICATION_ERR: 13;
            INVALID_NODE_TYPE_ERR: 24;
            INVALID_STATE_ERR: 11;
            NAMESPACE_ERR: 14;
            NETWORK_ERR: 19;
            NO_DATA_ALLOWED_ERR: 6;
            NO_MODIFICATION_ALLOWED_ERR: 7;
            NOT_FOUND_ERR: 8;
            NOT_SUPPORTED_ERR: 9;
            prototype: DOMException;
            QUOTA_EXCEEDED_ERR: 22;
            SECURITY_ERR: 18;
            SYNTAX_ERR: 12;
            TIMEOUT_ERR: 23;
            TYPE_MISMATCH_ERR: 17;
            URL_MISMATCH_ERR: 21;
            VALIDATION_ERR: 16;
            WRONG_DOCUMENT_ERR: 4;
            new (message?: string, name?: string): DOMException;
        };
        ErrorEvent: {
            prototype: ErrorEvent;
            new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
        };
        Event: {
            AT_TARGET: 2;
            BUBBLING_PHASE: 3;
            CAPTURING_PHASE: 1;
            NONE: 0;
            prototype: Event;
            new (type: string, eventInitDict?: EventInit): Event;
        };
        EventSource: {
            CLOSED: 2;
            CONNECTING: 0;
            OPEN: 1;
            prototype: EventSource;
            new (
                url: string | URL,
                eventSourceInitDict?: EventSourceInit,
            ): EventSource;
        };
        EventTarget: { prototype: EventTarget; new (): EventTarget };
        ExtendableEvent: typeof ExtendableEvent;
        FetchEvent: typeof FetchEvent;
        File: {
            prototype: File;
            new (
                fileBits: BlobPart[],
                fileName: string,
                options?: FilePropertyBag,
            ): File;
        };
        FixedLengthStream: typeof FixedLengthStream;
        FormData: {
            prototype: FormData;
            new (form?: HTMLFormElement, submitter?: HTMLElement | null): FormData;
        };
        Headers: { prototype: Headers; new (init?: HeadersInit): Headers };
        HTMLRewriter: typeof HTMLRewriter;
        IdentityTransformStream: typeof IdentityTransformStream;
        MessageChannel: { prototype: MessageChannel; new (): MessageChannel };
        MessageEvent: {
            prototype: MessageEvent;
            new <T>(
                type: string,
                eventInitDict?: MessageEventInit<T>,
            ): MessageEvent<T>;
        };
        MessagePort: { prototype: MessagePort; new (): MessagePort };
        navigator: Navigator;
        Navigator: { prototype: Navigator; new (): Navigator };
        origin: string;
        performance: Performance;
        PromiseRejectionEvent: {
            prototype: PromiseRejectionEvent;
            new (
                type: string,
                eventInitDict: PromiseRejectionEventInit,
            ): PromiseRejectionEvent;
        };
        ReadableByteStreamController: {
            prototype: ReadableByteStreamController;
            new (): ReadableByteStreamController;
        };
        ReadableStream: {
            prototype: ReadableStream;
            new (
                underlyingSource: UnderlyingByteSource,
                strategy?: { highWaterMark?: number },
            ): ReadableStream<Uint8Array<ArrayBuffer>>;
            new <R = any>(
                underlyingSource: UnderlyingDefaultSource<R>,
                strategy?: QueuingStrategy<R>,
            ): ReadableStream<R>;
            new <R = any>(
                underlyingSource?: UnderlyingSource<R>,
                strategy?: QueuingStrategy<R>,
            ): ReadableStream<R>;
        };
        ReadableStreamBYOBReader: {
            prototype: ReadableStreamBYOBReader;
            new (
                stream: ReadableStream<Uint8Array<ArrayBuffer>>,
            ): ReadableStreamBYOBReader;
        };
        ReadableStreamBYOBRequest: {
            prototype: ReadableStreamBYOBRequest;
            new (): ReadableStreamBYOBRequest;
        };
        ReadableStreamDefaultController: {
            prototype: ReadableStreamDefaultController;
            new (): ReadableStreamDefaultController;
        };
        ReadableStreamDefaultReader: {
            prototype: ReadableStreamDefaultReader;
            new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
        };
        Request: {
            prototype: Request;
            new (
                input: URL | RequestInfo,
                init?: RequestInit<CfProperties<unknown>>,
            ): Request;
        };
        Response: {
            prototype: Response;
            error(): Response;
            json(data: any, init?: ResponseInit): Response;
            redirect(url: string | URL, status?: number): Response;
            new (body?: BodyInit | null, init?: ResponseInit): Response;
        };
        ScheduledEvent: typeof ScheduledEvent;
        scheduler: Scheduler;
        self: ServiceWorkerGlobalScope;
        SubtleCrypto: { prototype: SubtleCrypto; new (): SubtleCrypto };
        TailEvent: typeof TailEvent;
        TextDecoder: {
            prototype: TextDecoder;
            new (label?: string, options?: TextDecoderOptions): TextDecoder;
        };
        TextDecoderStream: {
            prototype: TextDecoderStream;
            new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
        };
        TextEncoder: { prototype: TextEncoder; new (): TextEncoder };
        TextEncoderStream: {
            prototype: TextEncoderStream;
            new (): TextEncoderStream;
        };
        TraceEvent: typeof TailEvent;
        TransformStream: {
            prototype: TransformStream;
            new <I = any, O = any>(
                transformer?: Transformer<I, O>,
                writableStrategy?: QueuingStrategy<I>,
                readableStrategy?: QueuingStrategy<O>,
            ): TransformStream<I, O>;
        };
        TransformStreamDefaultController: {
            prototype: TransformStreamDefaultController;
            new (): TransformStreamDefaultController;
        };
        URL: {
            prototype: URL;
            canParse(url: string | URL, base?: string | URL): boolean;
            createObjectURL(obj: Blob | MediaSource): string;
            parse(url: string | URL, base?: string | URL): URL | null;
            revokeObjectURL(url: string): void;
            new (url: string | URL, base?: string | URL): URL;
        };
        URLPattern: {
            prototype: URLPattern;
            new (
                input: URLPatternInput,
                baseURL: string | URL,
                options?: URLPatternOptions,
            ): URLPattern;
            new (input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
        };
        URLSearchParams: {
            prototype: URLSearchParams;
            new (
                init?: string | string[][] | Record<string, string> | URLSearchParams,
            ): URLSearchParams;
        };
        WebSocket: {
            CLOSED: 3;
            CLOSING: 2;
            CONNECTING: 0;
            OPEN: 1;
            prototype: WebSocket;
            new (url: string | URL, protocols?: string | string[]): WebSocket;
        };
        WebSocketPair: new () => { "0": WebSocket; "1": WebSocket };
        WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
        WorkerGlobalScope: typeof WorkerGlobalScope;
        WritableStream: {
            prototype: WritableStream;
            new <W = any>(
                underlyingSink?: UnderlyingSink<W>,
                strategy?: QueuingStrategy<W>,
            ): WritableStream<W>;
        };
        WritableStreamDefaultController: {
            prototype: WritableStreamDefaultController;
            new (): WritableStreamDefaultController;
        };
        WritableStreamDefaultWriter: {
            prototype: WritableStreamDefaultWriter;
            new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
        };
        atob(data: string): string;
        btoa(data: string): string;
        clearInterval(timeoutId: number | null): void;
        clearTimeout(timeoutId: number | null): void;
        fetch(
            input: URL | RequestInfo,
            init?: RequestInit<RequestInitCfProperties>,
        ): Promise<Response>;
        queueMicrotask(task: Function): void;
        reportError(error: any): void;
        setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
        setInterval<Args extends any[]>(
            callback: (...args: Args) => void,
            msDelay?: number,
            ...args: Args,
        ): number;
        setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
        setTimeout<Args extends any[]>(
            callback: (...args: Args) => void,
            msDelay?: number,
            ...args: Args,
        ): number;
        structuredClone<T>(value: T, options?: StructuredSerializeOptions): T;
    }

    Hierarchy (View Summary)

    Index

    Properties

    AbortController: { prototype: AbortController; new (): AbortController }
    AbortSignal: {
        prototype: AbortSignal;
        abort(reason?: any): AbortSignal;
        any(signals: AbortSignal[]): AbortSignal;
        timeout(milliseconds: number): AbortSignal;
        new (): AbortSignal;
    }

    Type Declaration

      • new (): AbortSignal
      • Returns AbortSignal

    • prototype: AbortSignal
    • abort: function
      • The AbortSignal.abort() static method returns an AbortSignal that is already set as aborted (and which does not trigger an abort event).

        MDN Reference

        Parameters

        • Optionalreason: any

        Returns AbortSignal

    • any: function
      • The AbortSignal.any() static method takes an iterable of abort signals and returns an AbortSignal. The returned abort signal is aborted when any of the input iterable abort signals are aborted. The abort reason will be set to the reason of the first signal that is aborted. If any of the given abort signals are already aborted then so will be the returned AbortSignal.

        MDN Reference

        Parameters

        • signals: AbortSignal[]

        Returns AbortSignal

    • timeout: function
      • The AbortSignal.timeout() static method returns an AbortSignal that will automatically abort after a specified time.

        MDN Reference

        Parameters

        • milliseconds: number

        Returns AbortSignal

    Blob: {
        prototype: Blob;
        new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
    }
    Body: typeof Body
    ByteLengthQueuingStrategy: {
        prototype: ByteLengthQueuingStrategy;
        new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
    }
    Cache: { prototype: Cache; new (): Cache }
    caches: CacheStorage
    CacheStorage: { prototype: CacheStorage; new (): CacheStorage }
    CloseEvent: {
        prototype: CloseEvent;
        new (type: string, eventInitDict?: CloseEventInit): CloseEvent;
    }
    Cloudflare: Cloudflare
    CompressionStream: {
        prototype: CompressionStream;
        new (format: CompressionFormat): CompressionStream;
    }
    CountQueuingStrategy: {
        prototype: CountQueuingStrategy;
        new (init: QueuingStrategyInit): CountQueuingStrategy;
    }
    crypto: Crypto
    Crypto: { prototype: Crypto; new (): Crypto }
    CryptoKey: { prototype: CryptoKey; new (): CryptoKey }
    CustomEvent: {
        prototype: CustomEvent;
        new <T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
    }
    DecompressionStream: {
        prototype: DecompressionStream;
        new (format: CompressionFormat): DecompressionStream;
    }
    DOMException: {
        ABORT_ERR: 20;
        DATA_CLONE_ERR: 25;
        DOMSTRING_SIZE_ERR: 2;
        HIERARCHY_REQUEST_ERR: 3;
        INDEX_SIZE_ERR: 1;
        INUSE_ATTRIBUTE_ERR: 10;
        INVALID_ACCESS_ERR: 15;
        INVALID_CHARACTER_ERR: 5;
        INVALID_MODIFICATION_ERR: 13;
        INVALID_NODE_TYPE_ERR: 24;
        INVALID_STATE_ERR: 11;
        NAMESPACE_ERR: 14;
        NETWORK_ERR: 19;
        NO_DATA_ALLOWED_ERR: 6;
        NO_MODIFICATION_ALLOWED_ERR: 7;
        NOT_FOUND_ERR: 8;
        NOT_SUPPORTED_ERR: 9;
        prototype: DOMException;
        QUOTA_EXCEEDED_ERR: 22;
        SECURITY_ERR: 18;
        SYNTAX_ERR: 12;
        TIMEOUT_ERR: 23;
        TYPE_MISMATCH_ERR: 17;
        URL_MISMATCH_ERR: 21;
        VALIDATION_ERR: 16;
        WRONG_DOCUMENT_ERR: 4;
        new (message?: string, name?: string): DOMException;
    }
    ErrorEvent: {
        prototype: ErrorEvent;
        new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent;
    }
    Event: {
        AT_TARGET: 2;
        BUBBLING_PHASE: 3;
        CAPTURING_PHASE: 1;
        NONE: 0;
        prototype: Event;
        new (type: string, eventInitDict?: EventInit): Event;
    }
    EventSource: {
        CLOSED: 2;
        CONNECTING: 0;
        OPEN: 1;
        prototype: EventSource;
        new (url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource;
    }
    EventTarget: { prototype: EventTarget; new (): EventTarget }
    ExtendableEvent: typeof ExtendableEvent
    FetchEvent: typeof FetchEvent
    File: {
        prototype: File;
        new (
            fileBits: BlobPart[],
            fileName: string,
            options?: FilePropertyBag,
        ): File;
    }
    FixedLengthStream: typeof FixedLengthStream
    FormData: {
        prototype: FormData;
        new (form?: HTMLFormElement, submitter?: HTMLElement | null): FormData;
    }
    Headers: { prototype: Headers; new (init?: HeadersInit): Headers }
    HTMLRewriter: typeof HTMLRewriter
    IdentityTransformStream: typeof IdentityTransformStream
    MessageChannel: { prototype: MessageChannel; new (): MessageChannel }
    MessageEvent: {
        prototype: MessageEvent;
        new <T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>;
    }
    MessagePort: { prototype: MessagePort; new (): MessagePort }
    navigator: Navigator
    Navigator: { prototype: Navigator; new (): Navigator }
    origin: string
    performance: Performance
    PromiseRejectionEvent: {
        prototype: PromiseRejectionEvent;
        new (
            type: string,
            eventInitDict: PromiseRejectionEventInit,
        ): PromiseRejectionEvent;
    }
    ReadableByteStreamController: {
        prototype: ReadableByteStreamController;
        new (): ReadableByteStreamController;
    }
    ReadableStream: {
        prototype: ReadableStream;
        new (
            underlyingSource: UnderlyingByteSource,
            strategy?: { highWaterMark?: number },
        ): ReadableStream<Uint8Array<ArrayBuffer>>;
        new <R = any>(
            underlyingSource: UnderlyingDefaultSource<R>,
            strategy?: QueuingStrategy<R>,
        ): ReadableStream<R>;
        new <R = any>(
            underlyingSource?: UnderlyingSource<R>,
            strategy?: QueuingStrategy<R>,
        ): ReadableStream<R>;
    }
    ReadableStreamBYOBReader: {
        prototype: ReadableStreamBYOBReader;
        new (
            stream: ReadableStream<Uint8Array<ArrayBuffer>>,
        ): ReadableStreamBYOBReader;
    }
    ReadableStreamBYOBRequest: {
        prototype: ReadableStreamBYOBRequest;
        new (): ReadableStreamBYOBRequest;
    }
    ReadableStreamDefaultController: {
        prototype: ReadableStreamDefaultController;
        new (): ReadableStreamDefaultController;
    }
    ReadableStreamDefaultReader: {
        prototype: ReadableStreamDefaultReader;
        new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
    }
    Request: {
        prototype: Request;
        new (
            input: URL | RequestInfo,
            init?: RequestInit<CfProperties<unknown>>,
        ): Request;
    }
    Response: {
        prototype: Response;
        error(): Response;
        json(data: any, init?: ResponseInit): Response;
        redirect(url: string | URL, status?: number): Response;
        new (body?: BodyInit | null, init?: ResponseInit): Response;
    }

    Type Declaration

    • prototype: Response
    • error: function
      • The error() static method of the Response interface returns a new Response object associated with a network error.

        MDN Reference

        Returns Response

    • json: function
      • The json() static method of the Response interface returns a Response that contains the provided JSON data as body, and a Content-Type header which is set to application/json. The response status, status message, and additional headers can also be set.

        MDN Reference

        Parameters

        Returns Response

    • redirect: function
      • The redirect() static method of the Response interface returns a Response resulting in a redirect to the specified URL.

        MDN Reference

        Parameters

        • url: string | URL
        • Optionalstatus: number

        Returns Response

    ScheduledEvent: typeof ScheduledEvent
    scheduler: Scheduler
    SubtleCrypto: { prototype: SubtleCrypto; new (): SubtleCrypto }
    TailEvent: typeof TailEvent
    TextDecoder: {
        prototype: TextDecoder;
        new (label?: string, options?: TextDecoderOptions): TextDecoder;
    }
    TextDecoderStream: {
        prototype: TextDecoderStream;
        new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
    }
    TextEncoder: { prototype: TextEncoder; new (): TextEncoder }
    TextEncoderStream: { prototype: TextEncoderStream; new (): TextEncoderStream }
    TraceEvent: typeof TailEvent
    TransformStream: {
        prototype: TransformStream;
        new <I = any, O = any>(
            transformer?: Transformer<I, O>,
            writableStrategy?: QueuingStrategy<I>,
            readableStrategy?: QueuingStrategy<O>,
        ): TransformStream<I, O>;
    }
    TransformStreamDefaultController: {
        prototype: TransformStreamDefaultController;
        new (): TransformStreamDefaultController;
    }
    URL: {
        prototype: URL;
        canParse(url: string | URL, base?: string | URL): boolean;
        createObjectURL(obj: Blob | MediaSource): string;
        parse(url: string | URL, base?: string | URL): URL | null;
        revokeObjectURL(url: string): void;
        new (url: string | URL, base?: string | URL): URL;
    }

    Type Declaration

      • new (url: string | URL, base?: string | URL): URL
      • Parameters

        • url: string | URL
        • Optionalbase: string | URL

        Returns URL

    • prototype: URL
    • canParse: function
      • The URL.canParse() static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.

        MDN Reference

        Parameters

        • url: string | URL
        • Optionalbase: string | URL

        Returns boolean

    • createObjectURL: function
      • The createObjectURL() static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.

        MDN Reference

        Parameters

        • obj: Blob | MediaSource

        Returns string

    • parse: function
      • The URL.parse() static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.

        MDN Reference

        Parameters

        • url: string | URL
        • Optionalbase: string | URL

        Returns URL | null

    • revokeObjectURL: function
      • The revokeObjectURL() static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().

        MDN Reference

        Parameters

        • url: string

        Returns void

    URLPattern: {
        prototype: URLPattern;
        new (
            input: URLPatternInput,
            baseURL: string | URL,
            options?: URLPatternOptions,
        ): URLPattern;
        new (input?: URLPatternInput, options?: URLPatternOptions): URLPattern;
    }
    URLSearchParams: {
        prototype: URLSearchParams;
        new (
            init?: string | string[][] | Record<string, string> | URLSearchParams,
        ): URLSearchParams;
    }
    WebSocket: {
        CLOSED: 3;
        CLOSING: 2;
        CONNECTING: 0;
        OPEN: 1;
        prototype: WebSocket;
        new (url: string | URL, protocols?: string | string[]): WebSocket;
    }
    WebSocketPair: new () => { "0": WebSocket; "1": WebSocket }
    WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair
    WorkerGlobalScope: typeof WorkerGlobalScope
    WritableStream: {
        prototype: WritableStream;
        new <W = any>(
            underlyingSink?: UnderlyingSink<W>,
            strategy?: QueuingStrategy<W>,
        ): WritableStream<W>;
    }
    WritableStreamDefaultController: {
        prototype: WritableStreamDefaultController;
        new (): WritableStreamDefaultController;
    }
    WritableStreamDefaultWriter: {
        prototype: WritableStreamDefaultWriter;
        new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
    }

    Methods

    • Parameters

      • data: string

      Returns string

    • Parameters

      • data: string

      Returns string

    • Parameters

      • timeoutId: number | null

      Returns void

    • Parameters

      • timeoutId: number | null

      Returns void

    • Parameters

      • task: Function

      Returns void

    • Parameters

      • error: any

      Returns void

    • Parameters

      • callback: (...args: any[]) => void
      • OptionalmsDelay: number

      Returns number

    • Type Parameters

      • Args extends any[]

      Parameters

      • callback: (...args: Args) => void
      • OptionalmsDelay: number
      • ...args: Args

      Returns number

    • Parameters

      • callback: (...args: any[]) => void
      • OptionalmsDelay: number

      Returns number

    • Type Parameters

      • Args extends any[]

      Parameters

      • callback: (...args: Args) => void
      • OptionalmsDelay: number
      • ...args: Args

      Returns number