Interface RevPolyfills

ADVANCED - this includes library dependencies that may need to be overridden based on the current platform.

interface RevPolyfills {
    AbortController: new () => AbortController;
    AbortSignal: new () => AbortSignal;
    File: new (
        fileBits: BlobPart[],
        fileName: string,
        options?: FilePropertyBag,
    ) => File;
    FormData: new (
        form?: HTMLFormElement,
        submitter?: null | HTMLElement,
    ) => FormData;
    Headers: new (init?: HeadersInit) => Headers;
    Request: new (input: RequestInfo | URL, init?: RequestInit) => Request;
    Response: new (body?: null | BodyInit, init?: ResponseInit) => Response;
    uploadParser: {
        blob(
            value: Blob | File,
            options: UploadFileOptions,
        ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
        parse(
            value: FileUploadType,
            options: UploadFileOptions,
        ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
        response(
            response: Response,
            options: UploadFileOptions,
        ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
        stream(
            value: AsyncIterable<Uint8Array>,
            options: UploadFileOptions,
        ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
        string(
            value: string | URL,
            options: UploadFileOptions,
        ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
    };
    asPlatformStream<TIn = any, TOut = TIn>(stream: TIn): TOut;
    asWebStream<TIn = any>(stream: TIn): ReadableStream;
    beforeFileUploadRequest(
        form: FormData,
        headers: Headers,
        uploadOptions: UploadFileOptions,
        options: RequestOptions,
    ): undefined | FormData;
    createAbortError(message: string): Error;
    fetch(input: string | Request | URL, init?: RequestInit): Promise<Response>;
    hmacSign(message: string, secret: string): Promise<string>;
    randomValues(byteLength: number): string;
    sha256Hash(value: string): Promise<string>;
}

Properties

AbortController: new () => AbortController
AbortSignal: new () => AbortSignal
File: new (
    fileBits: BlobPart[],
    fileName: string,
    options?: FilePropertyBag,
) => File
FormData: new (
    form?: HTMLFormElement,
    submitter?: null | HTMLElement,
) => FormData
Headers: new (init?: HeadersInit) => Headers
Request: new (input: RequestInfo | URL, init?: RequestInit) => Request
Response: new (body?: null | BodyInit, init?: ResponseInit) => Response
uploadParser: {
    blob(
        value: Blob | File,
        options: UploadFileOptions,
    ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
    parse(
        value: FileUploadType,
        options: UploadFileOptions,
    ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
    response(
        response: Response,
        options: UploadFileOptions,
    ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
    stream(
        value: AsyncIterable<Uint8Array>,
        options: UploadFileOptions,
    ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
    string(
        value: string | URL,
        options: UploadFileOptions,
    ): Promise<{ file: Blob | File; options: UploadFileOptions }>;
}

Methods

  • Parameters

    • input: string | Request | URL
    • Optionalinit: RequestInit

    Returns Promise<Response>

  • Parameters

    • message: string
    • secret: string

    Returns Promise<string>