@hackmd/api
    Preparing search index...

    Interface Config<T>

    interface Config<T extends ClientOptions = ClientOptions> {
        adapter?: AxiosAdapterConfig | AxiosAdapterConfig[];
        allowAbsoluteUrls?: boolean;
        auth?: AuthToken | ((auth: Auth) => AuthToken | Promise<AuthToken>);
        axios?: AxiosStatic | AxiosInstance;
        baseURL?: T["baseURL"];
        beforeRedirect?: (
            options: Record<string, any>,
            responseDetails: {
                headers: Record<string, string>;
                statusCode: HttpStatusCode;
            },
        ) => void;
        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;
        onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
        params?: any;
        paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer;
        proxy?: false | AxiosProxyConfig;
        querySerializer?: QuerySerializerOptions | QuerySerializer;
        requestValidator?: (data: unknown) => Promise<unknown>;
        responseEncoding?: string;
        responseTransformer?: (data: unknown) => Promise<unknown>;
        responseType?: ResponseType;
        responseValidator?: (data: unknown) => Promise<unknown>;
        signal?: GenericAbortSignal;
        socketPath?: string | null;
        throwOnError?: T["throwOnError"];
        timeout?: number;
        timeoutErrorMessage?: string;
        transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
        transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
        transitional?: TransitionalOptions;
        transport?: any;
        url?: string;
        validateStatus?: ((status: number) => boolean) | null;
        withCredentials?: boolean;
        withXSRFToken?:
            | boolean
            | ((config: InternalAxiosRequestConfig) => boolean | undefined);
        xsrfCookieName?: string;
        xsrfHeaderName?: string;
    }

    Type Parameters

    • T extends ClientOptions = ClientOptions

    Hierarchy (View Summary)

    • Omit<CreateAxiosDefaults, "auth" | "baseURL" | "headers" | "method">
    • Config
    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?: T["baseURL"]

    Base URL for all requests made by this client.

    beforeRedirect?: (
        options: Record<string, any>,
        responseDetails: {
            headers: Record<string, string>;
            statusCode: HttpStatusCode;
        },
    ) => void
    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
    onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
    params?: any
    paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer
    proxy?: false | AxiosProxyConfig
    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.

    signal?: GenericAbortSignal
    socketPath?: string | null
    throwOnError?: T["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?: string
    validateStatus?: ((status: number) => boolean) | null
    withCredentials?: boolean
    withXSRFToken?:
        | boolean
        | ((config: InternalAxiosRequestConfig) => boolean | undefined)
    xsrfCookieName?: string
    xsrfHeaderName?: string