@hackmd/api
    Preparing search index...

    Interface RawRequestOptions<TData, ThrowOnError, Url>

    interface RawRequestOptions<
        TData = unknown,
        ThrowOnError extends boolean = boolean,
        Url extends string = string,
    > {
        adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
        allowAbsoluteUrls?: boolean;
        auth?: AuthToken | ((auth: Auth) => AuthToken | Promise<AuthToken>);
        axios?: AxiosStatic | AxiosInstance;
        baseURL?: unknown;
        beforeRedirect?: (
            options: Record<string, any>,
            responseDetails: {
                headers: Record<string, string>;
                statusCode: HttpStatusCode;
            },
        ) => void;
        body?: unknown;
        bodySerializer?: BodySerializer
        | null;
        cancelToken?: CancelToken;
        data?: any;
        decompress?: boolean;
        env?: { FormData?: new (...args: any[]) => object };
        family?: AddressFamily;
        fetchOptions?: Record<string, any>;
        formSerializer?: FormSerializerOptions;
        headers?: Record<string, unknown> | AxiosRequestHeaders;
        httpAgent?: any;
        httpsAgent?: any;
        insecureHTTPParser?: boolean;
        lookup?:
            | (
                (
                    hostname: string,
                    options: object,
                    cb: (
                        err: Error | null,
                        address: LookupAddress | LookupAddress[],
                        family?: AddressFamily,
                    ) => void,
                ) => void
            )
            | (
                (
                    hostname: string,
                    options: object,
                ) => Promise<
                    | LookupAddress
                    | [
                        address: LookupAddressEntry
                        | LookupAddressEntry[],
                        family?: AddressFamily,
                    ],
                >
            );
        maxBodyLength?: number;
        maxContentLength?: number;
        maxRate?: number | [number, number];
        maxRedirects?: number;
        method?:
            | "CONNECT"
            | "DELETE"
            | "GET"
            | "HEAD"
            | "OPTIONS"
            | "PATCH"
            | "POST"
            | "PUT"
            | "TRACE";
        onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void;
        onRequest?: (url: string, init: RequestInit) => Promise<Request>;
        onSseError?: (error: unknown) => void;
        onSseEvent?: (event: StreamEvent<TData>) => void;
        onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
        params?: any;
        paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
        path?: Record<string, unknown>;
        proxy?: false | AxiosProxyConfig;
        query?: Record<string, unknown>;
        querySerializer?: QuerySerializerOptions | QuerySerializer;
        requestValidator?: (data: unknown) => Promise<unknown>;
        responseEncoding?: string;
        responseTransformer?: (data: unknown) => Promise<unknown>;
        responseType?: ResponseType;
        responseValidator?: (data: unknown) => Promise<unknown>;
        security?: readonly Auth[];
        signal?: GenericAbortSignal;
        socketPath?: string | null;
        sseDefaultRetryDelay?: number;
        sseMaxRetryAttempts?: number;
        sseMaxRetryDelay?: number;
        throwOnError?: ThrowOnError;
        timeout?: number;
        timeoutErrorMessage?: string;
        transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
        transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
        transitional?: TransitionalOptions;
        transport?: any;
        url: Url;
        validateStatus?: ((status: number) => boolean) | null;
        withCredentials?: boolean;
        withXSRFToken?:
            | boolean
            | ((config: InternalAxiosRequestConfig) => boolean | undefined);
        xsrfCookieName?: string;
        xsrfHeaderName?: string;
    }

    Type Parameters

    • TData = unknown
    • ThrowOnError extends boolean = boolean
    • Url extends string = string

    Hierarchy (View Summary)

    • Config<{ throwOnError: ThrowOnError }>
    • Pick<
          ServerSentEventsOptions<TData>,

              | "onRequest"
              | "onSseError"
              | "onSseEvent"
              | "sseDefaultRetryDelay"
              | "sseMaxRetryAttempts"
              | "sseMaxRetryDelay",
      >
      • RawRequestOptions
    Index
    adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]
    allowAbsoluteUrls?: boolean
    auth?: AuthToken | ((auth: Auth) => AuthToken | Promise<AuthToken>)

    Auth token or a function returning auth token. The resolved value will be added to the request payload as defined by its security array.

    axios?: AxiosStatic | AxiosInstance

    Axios implementation. You can use this option to provide either an AxiosStatic or an AxiosInstance.

    axios
    
    baseURL?: unknown

    Base URL for all requests made by this client.

    beforeRedirect?: (
        options: Record<string, any>,
        responseDetails: {
            headers: Record<string, string>;
            statusCode: HttpStatusCode;
        },
    ) => void
    body?: unknown

    Any body that you want to add to your request.

    https://developer.mozilla.org/docs/Web/API/fetch#body

    bodySerializer?: BodySerializer | null

    A function for serializing request body parameter. By default, () will be used.

    cancelToken?: CancelToken
    data?: any
    decompress?: boolean
    env?: { FormData?: new (...args: any[]) => object }
    family?: AddressFamily
    fetchOptions?: Record<string, any>
    formSerializer?: FormSerializerOptions
    headers?: Record<string, unknown> | AxiosRequestHeaders

    An object containing any HTTP headers that you want to pre-populate your Headers object with.

    See more

    httpAgent?: any
    httpsAgent?: any
    insecureHTTPParser?: boolean
    lookup?:
        | (
            (
                hostname: string,
                options: object,
                cb: (
                    err: Error | null,
                    address: LookupAddress | LookupAddress[],
                    family?: AddressFamily,
                ) => void,
            ) => void
        )
        | (
            (
                hostname: string,
                options: object,
            ) => Promise<
                | LookupAddress
                | [
                    address: LookupAddressEntry
                    | LookupAddressEntry[],
                    family?: AddressFamily,
                ],
            >
        )
    maxBodyLength?: number
    maxContentLength?: number
    maxRate?: number | [number, number]
    maxRedirects?: number
    method?:
        | "CONNECT"
        | "DELETE"
        | "GET"
        | "HEAD"
        | "OPTIONS"
        | "PATCH"
        | "POST"
        | "PUT"
        | "TRACE"

    The request method.

    See more

    onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void
    onRequest?: (url: string, init: RequestInit) => Promise<Request>

    Implementing clients can call request interceptors inside this hook.

    onSseError?: (error: unknown) => void

    Callback invoked when a network or parsing error occurs during streaming.

    This option applies only if the endpoint returns a stream of events.

    Type Declaration

      • (error: unknown): void
      • Parameters

        • error: unknown

          The error that occurred.

        Returns void

    onSseEvent?: (event: StreamEvent<TData>) => void

    Callback invoked when an event is streamed from the server.

    This option applies only if the endpoint returns a stream of events.

    Type Declaration

      • (event: StreamEvent<TData>): void
      • Parameters

        • event: StreamEvent<TData>

          Event streamed from the server.

        Returns void

        Nothing (void).

    onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
    params?: any
    paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer
    path?: Record<string, unknown>
    proxy?: false | AxiosProxyConfig
    query?: Record<string, unknown>
    querySerializer?: QuerySerializerOptions | QuerySerializer

    A function for serializing request query parameters. By default, arrays will be exploded in form style, objects will be exploded in deepObject style, and reserved characters are percent-encoded.

    This method will have no effect if the native paramsSerializer() Axios API function is used.

    View examples

    requestValidator?: (data: unknown) => Promise<unknown>

    A function validating request data. This is useful if you want to ensure the request conforms to the desired shape, so it can be safely sent to the server.

    responseEncoding?: string
    responseTransformer?: (data: unknown) => Promise<unknown>

    A function transforming response data before it's returned. This is useful for post-processing data, e.g., converting ISO strings into Date objects.

    responseType?: ResponseType
    responseValidator?: (data: unknown) => Promise<unknown>

    A function validating response data. This is useful if you want to ensure the response conforms to the desired shape, so it can be safely passed to the transformers and returned to the user.

    security?: readonly Auth[]

    Security mechanism(s) to use for the request.

    signal?: GenericAbortSignal
    socketPath?: string | null
    sseDefaultRetryDelay?: number

    Default retry delay in milliseconds.

    This option applies only if the endpoint returns a stream of events.

    3000
    
    sseMaxRetryAttempts?: number

    Maximum number of retry attempts before giving up.

    sseMaxRetryDelay?: number

    Maximum retry delay in milliseconds.

    Applies only when exponential backoff is used.

    This option applies only if the endpoint returns a stream of events.

    30000
    
    throwOnError?: ThrowOnError

    Throw an error instead of returning it in the response?

    false
    
    timeout?: number
    timeoutErrorMessage?: string
    transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]
    transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]
    transitional?: TransitionalOptions
    transport?: any
    url: Url
    validateStatus?: ((status: number) => boolean) | null
    withCredentials?: boolean
    withXSRFToken?:
        | boolean
        | ((config: InternalAxiosRequestConfig) => boolean | undefined)
    xsrfCookieName?: string
    xsrfHeaderName?: string