We make the option to be a shared options object. This allow our other function do not depend on the context, but the shared variable, so we can separate api into files.

interface Options {
    acceptLanguage?: string;
    baseURL?: string;
    cookie?: string;
    fetch?: {
        (input, init?): Promise<Response>;
        (input, init?): Promise<Response>;
    };
    xUserId?: string | number;
}

Properties

acceptLanguage?: string

This will affect pixiv translation related fields, no need if run in browser

Example

"zh-CN"
baseURL?: string

Default

"https://www.pixiv.net"
cookie?: string

The cookie header

fetch?: {
    (input, init?): Promise<Response>;
    (input, init?): Promise<Response>;
}

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optional init: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | URL | Request
      • Optional init: RequestInit

      Returns Promise<Response>

xUserId?: string | number

Generated using TypeDoc