• Create a uri builder and request function for your specific plugin depending on the rest root and additional parameters.

    Parameters

    Returns {
        request: (<Request, Params, Response>(passOptions) => Promise<Response>);
        urlBuilder: ((passOptions) => string);
    }

    • request: (<Request, Params, Response>(passOptions) => Promise<Response>)
        • <Request, Params, Response>(passOptions): Promise<Response>
        • Type Parameters

          • Request extends IRouteRequestInterface
          • Params extends IRouteParamsInterface
          • Response extends IRouteResponseInterface

          Parameters

          • passOptions: Omit<{
                allowBatchRequest?: boolean | Pick<{
                    restNamespace: string;
                    restNonce?: string;
                    restPathObfuscateOffset?: string;
                    restQuery?: object;
                    restRecreateNonceEndpoint?: string;
                    restRoot: string;
                } & {
                    onQueueItemFinished?: ((state) => ...);
                    signal?: AbortSignal;
                    waitForPromise?: Promise<(...)>;
                }, "onQueueItemFinished" | "waitForPromise">;
                multipart?: boolean | MultiPartOptions;
                params?: IRouteParamsInterface;
                replayReason?: ReplayReason;
                request?: IRouteRequestInterface;
                sendReferer?: boolean;
                sendRestNonce?: boolean;
                settings?: Partial<{
                    body: ReadableStream<Uint8Array>;
                    bodyUsed: boolean;
                    cache: RequestCache;
                    credentials: RequestCredentials;
                    destination: RequestDestination;
                    headers: Headers;
                    integrity: string;
                    keepalive: boolean;
                    method: string;
                    mode: RequestMode;
                    redirect: RequestRedirect;
                    referrer: string;
                    referrerPolicy: ReferrerPolicy;
                    signal: AbortSignal;
                    url: string;
                    arrayBuffer(): Promise<ArrayBuffer>;
                    blob(): Promise<Blob>;
                    clone(): Request;
                    formData(): Promise<FormData>;
                    json(): Promise<any>;
                    text(): Promise<string>;
                }>;
            } & UrlBuilderArgs, "options"> & Optional<{
                allowBatchRequest?: boolean | Pick<{
                    restNamespace: string;
                    restNonce?: string;
                    restPathObfuscateOffset?: string;
                    restQuery?: object;
                    restRecreateNonceEndpoint?: string;
                    restRoot: string;
                } & {
                    onQueueItemFinished?: ((state) => ...);
                    signal?: AbortSignal;
                    waitForPromise?: Promise<(...)>;
                }, "onQueueItemFinished" | "waitForPromise">;
                multipart?: boolean | MultiPartOptions;
                params?: IRouteParamsInterface;
                replayReason?: ReplayReason;
                request?: IRouteRequestInterface;
                sendReferer?: boolean;
                sendRestNonce?: boolean;
                settings?: Partial<{
                    body: ReadableStream<Uint8Array>;
                    bodyUsed: boolean;
                    cache: RequestCache;
                    credentials: RequestCredentials;
                    destination: RequestDestination;
                    headers: Headers;
                    integrity: string;
                    keepalive: boolean;
                    method: string;
                    mode: RequestMode;
                    redirect: RequestRedirect;
                    referrer: string;
                    referrerPolicy: ReferrerPolicy;
                    signal: AbortSignal;
                    url: string;
                    arrayBuffer(): Promise<ArrayBuffer>;
                    blob(): Promise<Blob>;
                    clone(): Request;
                    formData(): Promise<FormData>;
                    json(): Promise<any>;
                    text(): Promise<string>;
                }>;
            } & UrlBuilderArgs, "options"> & {
                params?: Params;
                request?: Request;
            }

          Returns Promise<Response>

    • urlBuilder: ((passOptions) => string)
        • (passOptions): string
        • Parameters

          Returns string

    See

    • urlBuilder
    • request