//#region src/result.d.ts /** * Zero-dependency Result / ResultAsync implementation. * * Ergonomics are intentionally close to neverthrow so the patterns feel * familiar without pulling in an external dependency. * * @example * ```ts * const r = ok(42) * if (r.isOk) console.log(r.value) // 42 * * const a = ResultAsync.fromPromise(fetch('/api'), (e) => networkError(e)) * const text = await a * .andThen((res) => ResultAsync.fromPromise(res.text(), networkError)) * .unwrapOr('fallback') * ``` */ /** Successful result carrying `value`. */ interface OkResult { /** Always `true` — use this to narrow the union to `OkResult`. */ readonly isOk: true; /** Always `false` — use this to narrow the union to `OkResult`. */ readonly isErr: false; /** The success value. */ readonly value: T; /** Returns an `OkResult` with `fn(value)`. */ map(fn: (value: T) => U): OkResult; /** Returns `this` unchanged. */ mapErr(_fn: (error: never) => F): OkResult; /** Calls `fn(value)` and returns its Result. */ andThen(fn: (value: T) => Result): Result; /** Calls `onOk` and returns its result. */ match(onOk: (value: T) => U, _onErr: (error: never) => U): U; /** Returns `value`. */ unwrapOr(_fallback: T): T; } /** Failed result carrying `error`. */ interface ErrResult { /** Always `false` — use this to narrow the union to `ErrResult`. */ readonly isOk: false; /** Always `true` — use this to narrow the union to `ErrResult`. */ readonly isErr: true; /** The error value. */ readonly error: E; /** Returns `this` unchanged. */ map(_fn: (value: never) => U): ErrResult; /** Returns an `ErrResult` with `fn(error)`. */ mapErr(fn: (error: E) => F): ErrResult; /** Returns `this` unchanged. */ andThen(_fn: (value: never) => Result): ErrResult; /** Calls `onErr` and returns its result. */ match(_onOk: (value: never) => U, onErr: (error: E) => U): U; /** Returns `fallback`. */ unwrapOr(fallback: T): T; } /** A value that is either `OkResult` or `ErrResult`. */ type Result = OkResult | ErrResult; /** * Creates a successful `Result`. * * @param value - The success value */ declare function ok(value: T): OkResult; /** * Creates a failed `Result`. * * @param error - The error value */ declare function err(error: E): ErrResult; /** * A `PromiseLike>` that is directly `await`-able and supports * chainable `map / mapErr / andThen` operators. * * @example * ```ts * const result = await ResultAsync.fromPromise(fetch('/api'), networkError) * .andThen((res) => * ResultAsync.fromPromise(res.json() as Promise, networkError) * ) * ``` */ declare class ResultAsync implements PromiseLike> { private readonly _promise; constructor(promise: Promise>); then, TResult2 = never>(onfulfilled?: ((value: Result) => TResult1 | PromiseLike) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | null): PromiseLike; /** * Wraps a `Promise` into a `ResultAsync`. * * If the promise rejects, `onError` maps the rejection reason to `E`. * * @param promise - The promise to wrap * @param onError - Error mapper */ static fromPromise(promise: Promise, onError: (reason: unknown) => E): ResultAsync; /** * Wraps an already-resolved `Result` into a `ResultAsync`. * * @param result - The result to wrap */ static fromResult(result: Result): ResultAsync; /** * Transforms the success value. * * If the inner result is `Err`, `fn` is not called. * * @param fn - Synchronous mapper */ map(fn: (value: T) => U): ResultAsync; /** * Transforms the error value. * * If the inner result is `Ok`, `fn` is not called. * * @param fn - Synchronous error mapper */ mapErr(fn: (error: E) => F): ResultAsync; /** * Chains another async operation that may fail. * * If the inner result is `Err`, `fn` is not called. * * @param fn - Async mapper that returns a `ResultAsync` */ andThen(fn: (value: T) => ResultAsync | Result): ResultAsync; /** * Pattern-matches on success / failure. * * @param onOk - Called with the success value * @param onErr - Called with the error value * @returns A `Promise` */ match(onOk: (value: T) => U | Promise, onErr: (error: E) => U | Promise): Promise; /** * Returns the success value, or `fallback` if the result is `Err`. * * @param fallback - The fallback value */ unwrapOr(fallback: T): Promise; } //#endregion //#region src/auth.d.ts /** * Authentication manager for the pixiv API. * * Handles the OAuth 2.0 token refresh flow and generates the * x-client-hash header required by the pixiv iOS app API. * * The MD5 implementation is pure TypeScript to ensure Edge/browser compatibility — * Node's `crypto.createHash('md5')` is unavailable in Edge runtimes, and * `crypto.subtle` does not support MD5 (non-cryptographic hash). */ /** Auth credentials returned by the pixiv token endpoint. */ interface AuthCredentials { /** Numeric user ID returned as a string by the token endpoint. */ userId: string; /** Short-lived bearer token for API requests. */ accessToken: string; /** Long-lived token used to obtain new access tokens. */ refreshToken: string; } /** * Manages access tokens for the pixiv API. * * Holds the current access token and refresh token in memory. * The refresh() method exchanges the refresh token for a new access token * via the pixiv OAuth endpoint. */ declare class AuthManager { #private; userId: string; constructor(credentials: AuthCredentials); /** Returns the current access token. */ get accessToken(): string; /** Returns the current refresh token. */ get refreshToken(): string; /** * Exchanges the stored refresh token for a fresh access token. * * Updates the internal credentials on success. * Throws if the token endpoint returns a non-200 response. */ refresh(): Promise; /** * Creates an `AuthManager` by performing the initial token refresh. * * @param refreshToken - Pixiv refresh token * @returns Initialized `AuthManager` */ static login(refreshToken: string): Promise; } //#endregion //#region src/interceptor.d.ts /** * Response interceptor types for the pixiv API client. * * The interceptor is the seam that connects `@book000/pixivts-db-mysql` * (or any other storage backend) to the HTTP layer without introducing a * runtime dependency in core. * * Usage: * ```ts * import { createResponseRecorder } from '@book000/pixivts-db-mysql' * const { interceptor, close } = await createResponseRecorder({ ... }) * const client = await PixivClient.of(token, { onResponse: interceptor }) * ``` */ /** HTTP method of the request. */ type HttpMethod = 'GET' | 'POST'; /** * A single API response record passed to the interceptor after every successful * HTTP call made by the pixiv client. */ interface ResponseRecord { /** HTTP method used for the request. */ method: HttpMethod; /** API endpoint path (e.g. "/v1/illust/detail"). */ endpoint: string; /** Full request URL including query string (null if unavailable). */ url: string | null; /** JSON-serialized request headers (null if unavailable). */ requestHeaders: string | null; /** URL-encoded request body for POST requests (null for GET). */ requestBody: string | null; /** Whether the response body was parsed as JSON or left as plain text. */ responseType: 'JSON' | 'TEXT'; /** HTTP response status code. */ statusCode: number; /** JSON-serialized response headers (null if unavailable). */ responseHeaders: string | null; /** Serialized response body. */ responseBody: string; } /** * A callback invoked after every successful API response. * * Implementations should be non-blocking — awaiting a slow DB write here will * add latency to every API call. Consider queueing the record and writing * asynchronously if persistence latency matters. */ type ResponseInterceptor = (record: ResponseRecord) => void | Promise; //#endregion //#region src/errors.d.ts /** * Discriminated union of all errors that can occur when using the pixiv API client. * * Use the `type` field to discriminate: * ```ts * if (result.isErr) { * const err = result.error * if (err.type === 'rate_limit') { ... } * } * ``` */ type PixivError = { /** The request hit the rate limit and exhausted all retries. */ type: 'rate_limit'; /** Retry-After duration parsed from the last 429 response (milliseconds). */ retryAfter: number; } | { /** Authentication failed (401 response that could not be refreshed). */ type: 'auth_failed'; /** HTTP status code (always 401). */ status: number; } | { /** A network-level error occurred (fetch threw). */ type: 'network'; /** The underlying error thrown by fetch. */ cause: unknown; } | { /** The API returned a non-2xx status code other than 401/429. */ type: 'api_error'; /** HTTP status code. */ status: number; /** Parsed response body (object if JSON, string otherwise). */ body: unknown; } | { /** Structured data embedded in a non-JSON response could not be extracted or parsed. */ type: 'parse_error'; /** Description of what failed to parse. */ message: string; /** Raw response body that failed to parse. */ body: string; /** The underlying error thrown during parsing, if any (e.g. a `SyntaxError` from `JSON.parse`). */ cause?: unknown; }; /** * An `Error` subclass that wraps a `PixivError` for use in thrown contexts * (e.g. async generators that must throw proper `Error` objects). * * All `PixivError` properties are spread directly onto this instance so that * callers can use `instanceof PixivFetchError` or access `error.type` etc. * * @example * ```ts * try { * for await (const page of result.pages()) { ... } * } catch (e) { * if (e instanceof PixivFetchError) { * console.error(e.pixivError.type) * } * } * ``` */ declare class PixivFetchError extends Error { /** The underlying structured `PixivError`. */ readonly pixivError: PixivError; constructor(pixivError: PixivError); } /** Creates a rate-limit error. */ declare function rateLimitError(retryAfter: number): PixivError; /** Creates an auth-failed error. */ declare function authFailedError(status: number): PixivError; /** Creates a network error. */ declare function networkError(cause: unknown): PixivError; /** Creates an API error. */ declare function apiError(status: number, body: unknown): PixivError; /** Creates a parse error. */ declare function parseError(message: string, body: string, cause?: unknown): PixivError; //#endregion //#region src/http.d.ts /** Options for controlling retry behaviour on rate-limited requests. */ interface RateLimitRetryOptions { /** Maximum number of retries when a 429 response is received. Defaults to 3. */ maxRetries: number; /** Default wait time (ms) used when no Retry-After header is present. Defaults to 10_000. */ waitMs: number; } /** * HTTP client for the pixiv API. * * All methods return `ResultAsync` — no throws. * A 429 → retry loop and a 401 → refresh → retry are handled internally. */ declare class HttpClient { #private; constructor(auth: AuthManager, options?: { retry?: Partial; onResponse?: ResponseInterceptor; }); /** * Sends a GET request to the pixiv API. * * @param path - API endpoint path (e.g. "/v1/illust/detail") * @param params - Query parameters as a URLSearchParams instance * @returns `ResultAsync` */ get(path: string, params?: URLSearchParams): ResultAsync; /** * Sends a POST request to the pixiv API. * * @param path - API endpoint path (e.g. "/v2/illust/bookmark/add") * @param body - URL-encoded request body string * @returns `ResultAsync` */ post(path: string, body: string): ResultAsync; /** * Fetches a pixiv image URL without an Authorization header. * * Uses a browser User-Agent and the pixiv Referer, which are required for * image CDN access. Retry and interceptor are not applied here. * * @param imageUrl - Full image URL * @returns `ResultAsync` */ fetchImage(imageUrl: string): ResultAsync; /** * Sends a request to an absolute URL returned in a `next_url` field. * * Applies the same retry / interceptor / auth logic as `get()`. * * @param absoluteUrl - Full URL including query string * @returns `ResultAsync` */ getAbsolute(absoluteUrl: string): ResultAsync; } //#endregion //#region src/paginated.d.ts /** * A page returned by a pixiv list endpoint. * * Must have a `nextUrl` field (null when there are no more pages). */ interface PagedResponse { /** URL to the next page, or `null` when there are no more pages. */ nextUrl: string | null; } /** * A `ResultAsync` with additional `.pages()` / `.items()` * async generators for consuming paginated pixiv list responses. * * Returned by all resource methods that produce a `nextUrl` field. */ declare class PaginatedResultAsync extends ResultAsync { #private; constructor(promise: Promise>, http: HttpClient, getItems: (page: TPage) => TItem[]); /** * Creates a `PaginatedResultAsync` from a `ResultAsync`. * * @param inner - The first-page result * @param http - HTTP client for fetching subsequent pages * @param getItems - Extracts item array from a page */ static fromResultAsync(inner: ResultAsync, http: HttpClient, getItems: (page: TPage) => TItem[]): PaginatedResultAsync; /** * Async generator that yields each page starting from the first. * * If any page fetch fails, the generator throws a `PixivFetchError`. * * @example * ```ts * for await (const page of client.illusts.search({ word: 'cat' }).pages()) { * console.log(page.illusts.length) * } * ``` */ pages(): AsyncGenerator; /** * Async generator that yields individual items across all pages. * * If any page fetch fails, the generator throws a `PixivFetchError`. * * @example * ```ts * for await (const illust of client.illusts.search({ word: 'cat' }).items()) { * console.log(illust.title) * } * ``` */ items(): AsyncGenerator; } /** * Creates an immediately-failed `PaginatedResultAsync`. * * Useful when validation or auth fails before any HTTP request is made. * * @param error - The error to return * @param http - HTTP client (used for signature compatibility) * @param getItems - Item extractor (used for signature compatibility) */ declare function failedPaginated(error: PixivError, http: HttpClient, getItems: (page: TPage) => TItem[]): PaginatedResultAsync; //#endregion //#region src/params.d.ts /** * Typed cursor parameters extracted from a pixiv `next_url`. * * Different endpoints use different cursor fields; only the fields present * in the URL will be defined. * * | Field | Endpoint(s) | * |---|---| * | `maxBookmarkId` | `GET /v1/user/bookmarks/illust` | * | `maxBookmarkIdForRecommend` | `GET /v1/illust/recommended`, `GET /v1/novel/recommended` | * | `minBookmarkIdForRecentIllust` | `GET /v1/illust/recommended` | * | `offset` | search, ranking, recommended, user lists, … | * | `lastOrder` | `GET /v2/novel/series` | */ interface ParsedNextUrl { /** Cursor for `GET /v1/user/bookmarks/illust`. */ maxBookmarkId?: number; /** Cursor for `GET /v1/illust/recommended` and `GET /v1/novel/recommended`. */ maxBookmarkIdForRecommend?: number; /** Secondary cursor for `GET /v1/illust/recommended`. */ minBookmarkIdForRecentIllust?: number; /** Zero-based offset for general list endpoints. */ offset?: number; /** Cursor for `GET /v2/novel/series`. */ lastOrder?: number; } /** * Parses a pixiv `next_url` into a typed cursor object. * * Pass the `next_url` field from any paginated response to extract the * cursor parameters needed to resume pagination from a saved position. * * @example * ```ts * const page = await client.users.bookmarks.illusts({ userId: client.userId }) * if (page.isOk && page.value.nextUrl) { * const cursor = parseNextUrl(page.value.nextUrl) * // Resume later: * const next = await client.users.bookmarks.illusts({ * userId: client.userId, * maxBookmarkId: cursor.maxBookmarkId, * }) * } * ``` * * @param url - The `next_url` string returned by a pixiv list endpoint * @returns Typed cursor parameters; fields absent in the URL are `undefined` */ declare function parseNextUrl(url: string): ParsedNextUrl; //#endregion //#region src/options.d.ts /** * Public option constants for @book000/pixivts. * * Each option is exported as a runtime `const` object for enum-like access * (e.g. `BookmarkRestrict.PUBLIC`). Plain string literals are also accepted * wherever these values are used as parameters. * * @example * ```ts * // Enum-like usage * await client.illusts.bookmarkAdd({ illustId: 123, restrict: BookmarkRestrict.PUBLIC }) * * // Plain string literal — also valid * await client.illusts.bookmarkAdd({ illustId: 123, restrict: 'public' }) * ``` */ /** * Search match target for illust / novel searches. * * - `partial_match_for_tags` — tags contain the word (default) * - `exact_match_for_tags` — tags exactly equal the word * - `title_and_caption` — title or caption contains the word * - `keyword` — general keyword search (novel only) */ declare const SearchTarget: { readonly PARTIAL_MATCH_FOR_TAGS: "partial_match_for_tags"; readonly EXACT_MATCH_FOR_TAGS: "exact_match_for_tags"; readonly TITLE_AND_CAPTION: "title_and_caption"; readonly KEYWORD: "keyword"; }; /** * Sort order for search results. * * - `date_desc` — newest first (default) * - `date_asc` — oldest first * - `popular_desc` — most bookmarks first (premium only) */ declare const SearchSort: { readonly DATE_DESC: "date_desc"; readonly DATE_ASC: "date_asc"; readonly POPULAR_DESC: "popular_desc"; }; /** * Date range filter for search results. * * - `within_last_day` — past 24 hours * - `within_last_week` — past 7 days * - `within_last_month` — past 30 days */ declare const SearchDuration: { readonly WITHIN_LAST_DAY: "within_last_day"; readonly WITHIN_LAST_WEEK: "within_last_week"; readonly WITHIN_LAST_MONTH: "within_last_month"; }; /** * Ranking mode for illust rankings. * * R-18 modes require a premium account with R-18 content enabled. */ declare const RankingMode: { readonly DAY: "day"; readonly DAY_MALE: "day_male"; readonly DAY_FEMALE: "day_female"; readonly WEEK_ORIGINAL: "week_original"; readonly WEEK_ROOKIE: "week_rookie"; readonly WEEK: "week"; readonly MONTH: "month"; readonly DAY_AI: "day_ai"; readonly DAY_R18: "day_r18"; readonly WEEK_R18: "week_r18"; readonly DAY_MALE_R18: "day_male_r18"; readonly DAY_FEMALE_R18: "day_female_r18"; readonly DAY_R18_AI: "day_r18_ai"; }; /** * Ranking mode for novel rankings. * * R-18 modes require a premium account with R-18 content enabled. */ declare const NovelRankingMode: { readonly DAY: "day"; readonly WEEK: "week"; readonly DAY_MALE: "day_male"; readonly DAY_FEMALE: "day_female"; readonly WEEK_ROOKIE: "week_rookie"; readonly DAY_R18: "day_r18"; readonly WEEK_R18: "week_r18"; readonly DAY_R18_AI: "day_r18_ai"; }; /** * Visibility restriction for bookmarks. * * - `public` — publicly visible (default) * - `private` — visible only to the owner */ declare const BookmarkRestrict: { readonly PUBLIC: "public"; readonly PRIVATE: "private"; }; /** * Visibility restriction for follows. * * - `public` — publicly visible (default) * - `private` — visible only to the owner */ declare const FollowRestrict: { readonly PUBLIC: "public"; readonly PRIVATE: "private"; }; /** * OS filter used to request works compatible with the given platform. * * - `for_ios` — iOS-compatible works (default) * - `for_android` — Android-compatible works */ declare const OSFilter: { readonly FOR_IOS: "for_ios"; readonly FOR_ANDROID: "for_android"; }; /** * Work type filter for user illust listings. * * - `illust` — illustrations only * - `manga` — manga only */ declare const UserIllustType: { readonly ILLUST: "illust"; readonly MANGA: "manga"; }; //#endregion //#region src/types.d.ts /** * Public types for @book000/pixivts. * * These are explicitly-written TypeScript interfaces — NOT derived via * `z.infer<>` at this level — to guarantee that the built `.d.ts` files * contain no zod references. The corresponding zod schemas in `src/schemas/` * exist solely for internal use (tests, safeParse fixture validation). * * Correctness is verified by `expectTypeOf` checks in `tests/types.test.ts`. */ /** * Image URLs for a work (thumbnail variants). * * Accessing these URLs requires setting an appropriate `Referer` header. */ interface ImageUrls { /** 360×360 thumbnail */ squareMedium: string; /** Long side ≤ 540 px */ medium: string; /** Width ≤ 600 px, height ≤ 1200 px */ large: string; /** Original image (present in `metaPages` entries only) */ original?: string; } /** Profile image URLs for a user. */ interface ProfileImageUrls { /** Medium-size profile image URL. */ medium: string; } /** * Minimal user info embedded in works, search results, and preview lists. * * Full profile data is returned by GET /v1/user/detail. */ interface PixivUser { /** * Internal numeric user ID. * * NOTE: certain API endpoints return this as a string. The core library * normalises it to `number` before returning it to callers. */ id: number; /** Display name shown on the user's profile. */ name: string; /** Login account name (distinct from the display `name`). */ account: string; /** Set of profile image URLs at different sizes. */ profileImageUrls: ProfileImageUrls; /** Whether the authenticated user follows this user. */ isFollowed?: boolean; /** Whether this user has blocked access by the authenticated user. */ isAccessBlockingUser?: boolean; /** Whether this user accepts illustration commission requests. */ isAcceptRequest?: boolean; } /** Tag on a work. */ interface Tag { /** Tag name in Japanese. */ name: string; /** Translated tag name, or `null` if no translation is available. */ translatedName: string | null; /** Whether the tag was added by the work's uploader. */ addedByUploadedUser?: boolean; } /** Series information embedded in a work item. */ interface Series { /** Series ID. */ id: number; /** Series title. */ title: string; } /** Privacy-policy blurb returned by recommended endpoints. */ interface PrivacyPolicy { /** Policy version string. */ version?: string; /** Human-readable policy notice. */ message?: string; /** URL to the full privacy-policy page. */ url?: string; } /** * Original-image URL for a single-page illust. * * For manga works the API returns `meta_single_page` as an empty object `{}`, * so `originalImageUrl` may be absent even when the enclosing object is present. */ interface MetaSinglePage { /** * Direct URL to the original-resolution image. * Absent for manga works where `meta_single_page` is returned as `{}`. */ originalImageUrl?: string; } /** Per-page image URLs for a multi-page work (manga). */ interface MetaPages { /** Full set of image URLs for this page, including the original. */ imageUrls: Required; } /** * A pixiv illust or manga work item as returned by the API. * * Returned by GET /v1/illust/detail, GET /v1/search/illust, * GET /v1/illust/ranking, GET /v1/illust/recommended, etc. */ interface PixivIllustItem { /** * Work ID. * * Illusts and novels are numbered in separate sequences — the same ID * can appear in both. */ id: number; /** Title of the work. */ title: string; /** Work category: illustration, manga, or animated illustration. */ type: 'illust' | 'manga' | 'ugoira'; /** Thumbnail image URLs at various sizes. */ imageUrls: ImageUrls; /** Work caption / description (may contain HTML). */ caption: string; /** Content restriction level (0 = public, 1 = mypixiv-only, 2 = private). */ restrict: number; /** Author of the work. */ user: PixivUser; /** Tags attached to the work. */ tags: Tag[]; /** Creation tools listed by the author (e.g. "Photoshop"). */ tools: string[]; /** ISO 8601 date-time string of when the work was posted. */ createDate: string; /** Number of images in a multi-page work (1 for single-page). */ pageCount: number; /** Canvas width in pixels. */ width: number; /** Canvas height in pixels. */ height: number; /** Sanity / sensitivity level assigned by the pixiv content filter. */ sanityLevel: number; /** Age restriction: 0 = all-ages, 1 = R-18, 2 = R-18G */ xRestrict: number; /** Series this work belongs to, or `null` if not part of a series. */ series: Series | null; /** * For single-page works: `{ originalImageUrl: string }`. * For multi-page works (manga): `{}` (empty object; `originalImageUrl` will be `undefined`). */ metaSinglePage: MetaSinglePage | Record; /** Per-page image URLs for multi-page works (empty array for single-page). */ metaPages: MetaPages[]; /** Total number of views. */ totalView: number; /** Total number of bookmarks. */ totalBookmarks: number; /** Whether the authenticated user has bookmarked this work. */ isBookmarked: boolean; /** Whether the work is publicly visible. */ visible: boolean; /** Whether the work is muted for the authenticated user. */ isMuted: boolean; /** Total number of comments (may be absent on some endpoints). */ totalComments?: number; /** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */ illustAiType: number; /** Book-style rendering flag (0 = normal, 1 = book). */ illustBookStyle: number; /** Controls who can post comments (may be absent). */ commentAccessControl?: number; /** Additional access-restriction attributes (may be absent). */ restrictionAttributes?: string[]; } /** * A single comment on an illust. * * Returned by GET /v1/illust/comments. */ interface IllustComment { /** Comment ID. */ id: number; /** Comment body text. */ comment: string; /** ISO 8601 date-time string of when the comment was posted. */ date: string; /** Author of the comment. */ user: PixivUser; /** Whether this comment has replies. */ hasReplies?: boolean; /** The comment this is a reply to, or `{}` (empty object) for a top-level comment. */ parentComment?: IllustComment | Record; } /** Tag entry within {@link BookmarkDetail}. */ interface BookmarkDetailTag { /** Tag name. */ name: string; /** Whether the authenticated user has registered this tag on the bookmark. */ isRegistered: boolean; } /** Bookmark metadata for a single illust, returned by GET /v2/illust/bookmark/detail. */ interface BookmarkDetail { /** Whether the authenticated user has bookmarked this illust. */ isBookmarked: boolean; /** Tags attached to the bookmark. */ tags: BookmarkDetailTag[]; /** Bookmark visibility, or `""` when not bookmarked. */ restrict: 'public' | 'private' | ''; } /** Illust series metadata returned by GET /v1/illust/series. */ interface IllustSeriesDetail { /** Series ID. */ id: number; /** Series title. */ title: string; /** Series description / caption. */ caption: string; /** Cover image URLs. */ coverImageUrls: { medium: string; }; /** Number of works in the series. */ seriesWorkCount: number; /** ISO 8601 date-time string of when the series was created. */ createDate: string; /** Canvas width of the cover image in pixels. */ width: number; /** Canvas height of the cover image in pixels. */ height: number; /** Author of the series. */ user: PixivUser; /** Whether the authenticated user has added this series to their watchlist. */ watchlistAdded: boolean; } /** * A pixiv novel work item as returned by the API. * * Returned by GET /v2/novel/detail, GET /v1/search/novel, etc. */ interface PixivNovelItem { /** * Work ID. * * Novels and illusts are numbered in separate sequences — the same ID * can appear in both. */ id: number; /** Title of the novel. */ title: string; /** Synopsis / caption (may contain HTML). */ caption: string; /** Content restriction level (0 = public, 1 = mypixiv-only, 2 = private). */ restrict: number; /** Age restriction: 0 = all-ages, 1 = R-18, 2 = R-18G */ xRestrict: number; /** Whether the novel is an original work (not fan fiction). */ isOriginal: boolean; /** Cover image URLs. */ imageUrls: ImageUrls; /** ISO 8601 date-time string of when the novel was posted. */ createDate: string; /** Tags attached to the novel. */ tags: Tag[]; /** Number of pages (word-count chunks). */ pageCount: number; /** Total character count of the novel body. */ textLength: number; /** Author of the novel. */ user: PixivUser; /** * Series information. * * `{}` (empty object) if the novel does not belong to a series. */ series: Series | Record; /** Whether the authenticated user has bookmarked this novel. */ isBookmarked: boolean; /** Total number of bookmarks. */ totalBookmarks: number; /** Total number of views. */ totalView: number; /** Whether the novel is publicly visible. */ visible: boolean; /** Total number of comments. */ totalComments: number; /** Whether the novel is muted for the authenticated user. */ isMuted: boolean; /** Whether the novel is restricted to mutual followers (mypixiv). */ isMypixivOnly: boolean; /** Whether the novel contains explicit content beyond the `xRestrict` flag. */ isXRestricted: boolean; /** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */ novelAiType: number; /** Controls who can post comments (may be absent). */ commentAccessControl?: number; } /** * A single comment on a novel. * * Returned by GET /v1/novel/comments. */ interface NovelComment { /** Comment ID. */ id: number; /** Comment body text. */ comment: string; /** ISO 8601 date-time string of when the comment was posted. */ date: string; /** Author of the comment. */ user: PixivUser; /** Whether this comment has replies. */ hasReplies?: boolean; /** The comment this is a reply to, or `{}` (empty object) for a top-level comment. */ parentComment?: NovelComment | Record; } /** Novel series details returned by GET /v2/novel/series. */ interface NovelSeriesDetail { /** Series ID. */ id: number; /** Series title. */ title: string; /** Series description / caption. */ caption: string; /** Whether every novel in the series is original (not fan fiction). */ isOriginal: boolean; /** Whether the series has been marked as concluded by the author. */ isConcluded: boolean; /** Number of novels in the series. */ contentCount: number; /** Total character count across all novels in the series. */ totalCharacterCount: number; /** Author of the series. */ user: PixivUser; /** Human-readable series label / tagline. */ displayText: string; /** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */ novelAiType: number; /** Whether the authenticated user has added this series to their watchlist. */ watchlistAdded: boolean; } /** User item with self-introduction; embedded in GET /v1/user/detail. */ type PixivUserItem = PixivUser & { /** Self-introduction text (line endings are \r\n) */ comment: string; }; /** Visibility setting for a user profile field. */ type Publicity = 'public' | 'private' | 'mypixiv'; /** Detailed profile information for a user. */ interface PixivUserProfile { /** Personal website URL, or `null` if not set. */ webpage: string | null; /** Disclosed gender. */ gender: 'male' | 'female' | 'unknown'; /** Birth date string (YYYY-MM-DD format, may be partial). */ birth: string; /** Birth day portion (MM-DD format). */ birthDay: string; /** Birth year. */ birthYear: number; /** Region / prefecture. */ region: string; /** Internal address ID. */ addressId: number; /** Two-letter country code (ISO 3166-1 alpha-2). */ countryCode: string; /** Occupation / job description. */ job: string; /** Internal job category ID. */ jobId: number; /** Number of users this user follows. */ totalFollowUsers: number; /** Number of mutual-follow (mypixiv) connections. */ totalMypixivUsers: number; /** Total number of public illusts. */ totalIllusts: number; /** Total number of public manga works. */ totalManga: number; /** Total number of public novels. */ totalNovels: number; /** Total number of publicly bookmarked illusts. */ totalIllustBookmarksPublic: number; /** Total number of illust series. */ totalIllustSeries: number; /** Total number of novel series. */ totalNovelSeries: number; /** Profile background image URL, or `null` if not set. */ backgroundImageUrl: string | null; /** Linked Twitter/X account name (without @). */ twitterAccount: string; /** Twitter/X profile URL, or `null` if not set. */ twitterUrl: string | null; /** Pawoo profile URL, or `null` if not set. */ pawooUrl: string | null; /** Whether the user has a premium (paid) account. */ isPremium: boolean; /** Whether the user has set a custom profile image. */ isUsingCustomProfileImage: boolean; } /** Visibility settings for a user's profile fields. */ interface PixivUserProfilePublicity { /** Visibility of the gender field. */ gender: Publicity; /** Visibility of the region field. */ region: Publicity; /** Visibility of the birth-day field. */ birthDay: Publicity; /** Visibility of the birth-year field. */ birthYear: Publicity; /** Visibility of the job field. */ job: Publicity; /** Whether the Pawoo account link is visible. */ pawoo: boolean; } /** Workspace / desk setup information from a user's profile. */ interface PixivUserProfileWorkspace { /** PC / computer specs. */ pc: string; /** Monitor model. */ monitor: string; /** Drawing software / tool. */ tool: string; /** Scanner model. */ scanner: string; /** Tablet model. */ tablet: string; /** Mouse model. */ mouse: string; /** Printer model. */ printer: string; /** Desktop wallpaper or environment description. */ desktop: string; /** Music / background audio description. */ music: string; /** Desk description. */ desk: string; /** Chair description. */ chair: string; /** Free-text comment about the workspace. */ comment: string; /** Workspace image URL, or `null` if not set. */ workspaceImageUrl: string | null; } /** * Preview item for a user in the GET /v1/user/following response. * * Contains a few sample illusts and novels from that user. */ interface PixivUserPreviewItem { /** The user being previewed. */ user: PixivUser; /** A small sample of the user's recent illusts. */ illusts: PixivIllustItem[]; /** A small sample of the user's recent novels. */ novels: PixivNovelItem[]; /** Whether this user is muted by the authenticated user. */ isMuted: boolean; } /** URLs for ugoira frame archives (ZIP files). */ interface ZipUrls { /** URL for the 600 px-long-side archive. */ medium: string; } /** Timing info for a single ugoira frame. */ interface Frame { /** File name within the ZIP archive */ file: string; /** Display duration in milliseconds */ delay: number; } /** Ugoira metadata as returned by GET /v1/ugoira/metadata. */ interface PixivUgoiraItem { /** Archive URLs for the frame ZIP. */ zipUrls: ZipUrls; /** Per-frame timing data (in order). */ frames: Frame[]; } /** * Camelized shape of the JSON error body returned by the pixiv API. * * The pixiv wire format uses `snake_case` field names (e.g. `user_message`); * `HttpClient` applies `camelizeKeys()` before returning, so all fields here * are `lowerCamelCase`. */ interface PixivApiErrorBody { /** Error payload returned by the pixiv API (keys camelized). */ error: { /** Localised error message intended for end users. */ userMessage: string; /** Internal error message. */ message: string; /** Short error reason / code. */ reason: string; /** Additional details for the user-facing message (may be absent). */ userMessageDetails?: Record; }; } /** Response shape for GET /v1/illust/detail. */ interface IllustDetailResponse { /** The requested illust. */ illust: PixivIllustItem; } /** Page response for illust list endpoints (search, related, ranking, etc.). */ interface IllustListPage { /** Illusts on this page. */ illusts: PixivIllustItem[]; /** * Whether AI-generated works are shown in the results. * * Only present on search responses; absent on related/ranking/recommended endpoints. */ showAi?: boolean; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/illust/recommended. */ interface IllustRecommendedPage { /** Recommended illusts. */ illusts: PixivIllustItem[]; /** Ranking illusts included alongside recommendations. */ rankingIllusts: PixivIllustItem[]; /** Whether an ongoing contest exists. */ contestExists: boolean; /** Privacy-policy notice (present on the first page). */ privacyPolicy?: PrivacyPolicy; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/illust/comments. */ interface IllustCommentsPage { /** Total number of comments on the illust (present only when `includeTotalComments` is requested). */ totalComments?: number; /** Comments on this page. */ comments: IllustComment[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; /** Who is permitted to post comments (may be absent). */ commentAccessControl?: number; } /** Response shape for GET /v2/illust/bookmark/detail. */ interface IllustBookmarkDetailResponse { /** Bookmark metadata for the requested illust. */ bookmarkDetail: BookmarkDetail; } /** Page response for GET /v1/illust/series. */ interface IllustSeriesPage { /** Metadata for the series. */ illustSeriesDetail: IllustSeriesDetail; /** First illust in the series. */ illustSeriesFirstIllust: PixivIllustItem; /** Illusts on this page. */ illusts: PixivIllustItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** * A single trending tag entry, paired with a representative illust. */ interface TrendingTagIllust { /** Tag name in Japanese. */ tag: string; /** Translated tag name, or `null` if no translation is available. */ translatedName: string | null; /** Representative illust for this tag. */ illust: PixivIllustItem; } /** Response shape for GET /v1/trending-tags/illust. */ interface TrendingTagsIllustResponse { /** Currently trending tags, each with a representative illust. */ trendTags: TrendingTagIllust[]; } /** Page response for GET /v1/manga/recommended. */ interface MangaRecommendedPage { /** Recommended manga works. */ illusts: PixivIllustItem[]; /** Ranking manga works included alongside recommendations. */ rankingIllusts: PixivIllustItem[]; /** Privacy-policy notice (present on the first page). */ privacyPolicy?: PrivacyPolicy; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Response shape for GET /v1/ugoira/metadata. */ interface UgoiraMetadataResponse { /** Ugoira metadata (ZIP URLs and per-frame timings). */ ugoiraMetadata: PixivUgoiraItem; } /** Response shape for GET /v2/novel/detail. */ interface NovelDetailResponse { /** The requested novel. */ novel: PixivNovelItem; } /** Page response for novel list endpoints (search, related, ranking, etc.). */ interface NovelListPage { /** Novels on this page. */ novels: PixivNovelItem[]; /** * Whether AI-generated works are shown in the results. * * Only present on search responses; absent on related/ranking/recommended endpoints. */ showAi?: boolean; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/novel/recommended. */ interface NovelRecommendedPage { /** Recommended novels. */ novels: PixivNovelItem[]; /** Ranking novels included alongside recommendations. */ rankingNovels: PixivNovelItem[]; /** Privacy-policy notice (present on the first page). */ privacyPolicy?: PrivacyPolicy; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/novel/comments. */ interface NovelCommentsPage { /** Total number of comments on the novel (present only when `includeTotalComments` is requested). */ totalComments?: number; /** Comments on this page. */ comments: NovelComment[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; /** Who is permitted to post comments (may be absent). */ commentAccessControl?: number; } /** Page response for GET /v2/novel/series. */ interface NovelSeriesPage { /** Metadata for the series. */ novelSeriesDetail: NovelSeriesDetail; /** First novel in the series. */ novelSeriesFirstNovel: PixivNovelItem; /** Most recently published novel in the series. */ novelSeriesLatestNovel: PixivNovelItem; /** Novels on this page. */ novels: PixivNovelItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Bookmark / view counters embedded in a WebView novel page. */ interface WebviewNovelRating { /** Number of "likes" (lightweight reactions). */ like: number; /** Number of bookmarks. */ bookmark: number; /** Number of views. */ view: number; } /** Navigation info for a sibling novel in a series, as embedded in the WebView novel page. */ interface WebviewNovelNavigationInfo { /** Work ID of the sibling novel. */ id: number; /** Whether the authenticated user is allowed to view this novel. */ viewable: boolean; /** Position of the novel within the series' reading order. */ contentOrder: string; /** Title of the sibling novel. */ title: string; /** Cover image URL of the sibling novel. */ coverUrl: string; /** Reason the novel is not viewable (present only when `viewable` is `false`). */ viewableMessage?: string | null; } /** Prev/next navigation for a novel that belongs to a series, as embedded in the WebView novel page. */ interface WebviewNovelSeriesNavigation { /** Previous novel in the series (`null` or absent if this is the first). */ prev?: WebviewNovelNavigationInfo | null; /** Next novel in the series (`null` or absent if this is the latest). */ next?: WebviewNovelNavigationInfo | null; } /** * Structured novel content parsed from the WebView HTML page. * * Returned by `client.novels.text()` (GET /webview/v2/novel). pixiv embeds * this data as a JavaScript object literal inside the HTML page rather than * returning JSON directly, so several id-like fields are strings rather than * numbers — unlike the numeric ids used throughout the rest of this library. */ interface WebviewNovel { /** Work ID, as a string. */ id: string; /** Title of the novel. */ title: string; /** Series ID (`null` or absent if the novel does not belong to a series). */ seriesId?: string | null; /** Series title (`null` or absent if the novel does not belong to a series). */ seriesTitle?: string | null; /** * Whether the authenticated user is watching (following) the series * (`null` or absent if the novel does not belong to a series). */ seriesIsWatched?: boolean | null; /** Author's user ID, as a string. */ userId: string; /** Cover image URL. */ coverUrl: string; /** Tags attached to the novel. */ tags: string[]; /** Synopsis / caption (may contain HTML). */ caption: string; /** ISO 8601 date-time string of when the novel was posted. */ cdate: string; /** Like / bookmark / view counters. */ rating: WebviewNovelRating; /** Full novel body text. */ text: string; /** Reading-position marker for the authenticated user (`null` or absent if none). */ marker?: string | null; /** * Prev/next navigation for the series this novel belongs to. * * `null` if the novel does not belong to a series (confirmed against real * WebView responses — pixiv sends this field as `null`, not `{}`, in that * case). */ seriesNavigation: WebviewNovelSeriesNavigation | null; /** AI-generated content flag: 0 = no AI, 1 = partial AI, 2 = fully AI */ aiType: number; /** Whether the novel is an original work (not fan fiction). */ isOriginal: boolean; } /** Response shape for GET /v1/user/detail. */ interface UserDetailResponse { /** Basic user info with self-introduction. */ user: PixivUserItem; /** Detailed profile data. */ profile: PixivUserProfile; /** Visibility settings for profile fields. */ profilePublicity: PixivUserProfilePublicity; /** Workspace / desk-setup information. */ workspace: PixivUserProfileWorkspace; } /** Page response for GET /v1/user/illusts. */ interface UserIllustsPage { /** The user whose illusts are listed. */ user: PixivUser; /** Illusts on this page. */ illusts: PixivIllustItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/novels. */ interface UserNovelsPage { /** The user whose novels are listed. */ user: PixivUser; /** Novels on this page. */ novels: PixivNovelItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/bookmarks/illust. */ interface UserBookmarksIllustPage { /** Bookmarked illusts on this page. */ illusts: PixivIllustItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/bookmarks/novel. */ interface UserBookmarksNovelPage { /** Bookmarked novels on this page. */ novels: PixivNovelItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/following. */ interface UserFollowingPage { /** User preview items on this page. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/related. */ interface UserRelatedPage { /** User preview items related to the seed user. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/recommended. */ interface UserRecommendedPage { /** Recommended user preview items. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/follower. */ interface UserFollowerPage { /** User preview items on this page. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/user/mypixiv. */ interface UserMypixivPage { /** User preview items on this page. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** Page response for GET /v1/search/user. */ interface UserSearchPage { /** User preview items matching the search. */ userPreviews: PixivUserPreviewItem[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; /** Maximum number of results the search will return across all pages. */ searchSpanLimit: number; } /** * Page response for GET /v2/user/list. * * NOTE: unlike sibling endpoints (`following`, `follower`, `mypixiv`, `related`, * `recommended`), the live pixiv API returns this list under a `users` key with * plain `PixivUser` objects, not `user_previews` with `PixivUserPreviewItem` * (confirmed by direct API verification; no `user_previews` wrapper is present * on the wire for this endpoint). */ interface UserListPage { /** User items on this page. */ users: PixivUser[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } /** A bookmark tag with usage count, as returned by GET /v1/user/bookmark-tags/illust. */ interface BookmarkTag { /** Tag name. */ name: string; /** Number of bookmarked illusts carrying this tag. */ count: number; /** Whether this tag is registered by the authenticated user (may be absent). */ isRegistered?: boolean; } /** Page response for GET /v1/user/bookmark-tags/illust. */ interface UserBookmarkTagsIllustPage { /** Bookmark tags on this page. */ bookmarkTags: BookmarkTag[]; /** URL to the next page, or `null` when this is the last page. */ nextUrl: string | null; } //#endregion //#region src/resources/illusts.d.ts /** Parameters for fetching a single illust by ID. */ interface IllustDetailParams { /** ID of the illust to fetch. */ illustId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; } /** Parameters for fetching related illusts. */ interface IllustRelatedParams { /** ID of the illust for which to fetch related works. */ illustId: number; /** Additional seed illust IDs to influence recommendations. */ seedIllustIds?: number[]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; } /** Parameters for searching illusts. */ interface IllustSearchParams { /** Search keyword. */ word: string; /** How to match the keyword against works (default: `"partial_match_for_tags"`). */ searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget]; /** Sort order for results (default: `"date_desc"`). */ sort?: (typeof SearchSort)[keyof typeof SearchSort]; /** Date range preset filter (omit for no restriction). */ duration?: (typeof SearchDuration)[keyof typeof SearchDuration]; /** Start date for a custom date range (YYYY-MM-DD; requires `endDate`). */ startDate?: string; /** End date for a custom date range (YYYY-MM-DD; requires `startDate`). */ endDate?: string; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */ searchAiType?: 0 | 1; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching the illust ranking. */ interface IllustRankingParams { /** Ranking category (default: `"day"`). */ mode?: (typeof RankingMode)[keyof typeof RankingMode]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Specific date to fetch rankings for (YYYY-MM-DD; omit for the latest). */ date?: string; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching recommended illusts. */ interface IllustRecommendedParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; /** * Cursor for resuming pagination: the `maxBookmarkIdForRecommend` value * extracted from a previous page's `next_url` via {@link parseNextUrl}. */ maxBookmarkIdForRecommend?: number; /** * Secondary cursor for resuming pagination: the `minBookmarkIdForRecentIllust` * value extracted from a previous page's `next_url` via {@link parseNextUrl}. */ minBookmarkIdForRecentIllust?: number; /** * Content type filter for recommended works. * - `"illust"` — illustration works only * - `"manga"` — manga works only * Omit to receive both types. */ contentType?: 'illust' | 'manga'; /** * Whether to include ranking label information in the response. * Defaults to `true` when omitted. */ includeRankingLabel?: boolean; /** * IDs of illusts already seen by the user. * The API will exclude these from the recommendations. * Serialised as repeated `viewed[]=` query parameters. */ viewed?: number[]; } /** Parameters for fetching an illust series. */ interface IllustSeriesParams { /** ID of the illust series to fetch. */ illustSeriesId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; } /** Parameters for adding an illust bookmark. */ interface IllustBookmarkAddParams { /** ID of the illust to bookmark. */ illustId: number; /** Bookmark visibility (default: `"public"`). */ restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict]; /** Tags to attach to the bookmark. */ tags?: string[]; } /** Parameters for removing an illust bookmark. */ interface IllustBookmarkDeleteParams { /** ID of the illust to remove from bookmarks. */ illustId: number; } /** Parameters for fetching illusts posted by followed users. */ interface IllustFollowParams { /** Follow visibility to fetch (default: `"public"`). */ restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching comments on an illust. */ interface IllustCommentsParams { /** ID of the illust to fetch comments for. */ illustId: number; /** Zero-based offset for pagination. */ offset?: number; /** Whether to include the `totalComments` count in the response. */ includeTotalComments?: boolean; } /** Parameters for fetching bookmark metadata for an illust. */ interface IllustBookmarkDetailParams { /** ID of the illust to fetch bookmark metadata for. */ illustId: number; } /** Parameters for fetching newly posted illusts. */ interface IllustNewParams { /** Restrict results to illusts or manga (omit for both). */ contentType?: (typeof UserIllustType)[keyof typeof UserIllustType]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Cursor: fetch illusts posted before this illust ID. */ maxIllustId?: number; } /** Parameters for fetching trending illust tags. */ interface IllustTrendingTagsParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; } /** Methods for the illust API namespace. */ declare class IllustResource { #private; constructor(http: HttpClient); /** * Fetches a single illust by ID. * GET /v1/illust/detail * * @param params - Request parameters * * @example * ```ts * const result = await client.illusts.detail({ illustId: 12345 }) * if (result.isOk) { * console.log(result.value.illust.title) * } else { * console.error(result.error) * } * ``` */ detail(params: IllustDetailParams): ResultAsync; /** * Fetches related illusts for a given illust. * GET /v2/illust/related * * @param params - Request parameters */ related(params: IllustRelatedParams): PaginatedResultAsync; /** * Searches for illusts. * GET /v1/search/illust * * @param params - Request parameters * * @example * ```ts * // Iterate all results across pages * for await (const illust of client.illusts.search({ word: 'cat' }).items()) { * console.log(illust.title) * } * * // Fetch only the first page * const page = await client.illusts.search({ word: 'cat' }) * if (page.isOk) { * console.log(page.value.illusts.length) * } * ``` */ search(params: IllustSearchParams): PaginatedResultAsync; /** * Fetches the illust ranking. * GET /v1/illust/ranking * * @param params - Request parameters */ ranking(params?: IllustRankingParams): PaginatedResultAsync; /** * Fetches recommended illusts. * GET /v1/illust/recommended * * @param params - Request parameters */ recommended(params?: IllustRecommendedParams): PaginatedResultAsync; /** * Fetches an illust series. * GET /v1/illust/series * * @param params - Request parameters */ series(params: IllustSeriesParams): PaginatedResultAsync; /** * Adds an illust bookmark. * POST /v2/illust/bookmark/add * * @param params - Request parameters */ bookmarkAdd(params: IllustBookmarkAddParams): ResultAsync, PixivError>; /** * Removes an illust bookmark. * POST /v1/illust/bookmark/delete * * @param params - Request parameters */ bookmarkDelete(params: IllustBookmarkDeleteParams): ResultAsync, PixivError>; /** * Fetches illusts posted by users the authenticated account follows. * GET /v2/illust/follow * * @param params - Request parameters */ follow(params?: IllustFollowParams): PaginatedResultAsync; /** * Fetches comments posted on an illust. * GET /v1/illust/comments * * @param params - Request parameters */ comments(params: IllustCommentsParams): PaginatedResultAsync; /** * Fetches bookmark metadata (tags, visibility) for an illust. * GET /v2/illust/bookmark/detail * * @param params - Request parameters */ bookmarkDetail(params: IllustBookmarkDetailParams): ResultAsync; /** * Fetches newly posted illusts. * GET /v1/illust/new * * @param params - Request parameters */ new(params?: IllustNewParams): PaginatedResultAsync; /** * Fetches currently trending illust tags, each with a representative illust. * GET /v1/trending-tags/illust * * @param params - Request parameters */ trendingTags(params?: IllustTrendingTagsParams): ResultAsync; } //#endregion //#region src/resources/novels.d.ts /** Parameters for fetching a single novel by ID. */ interface NovelDetailParams { /** ID of the novel to fetch. */ novelId: number; } /** Parameters for fetching the WebView HTML of a novel. */ interface NovelTextParams { /** ID of the novel whose WebView HTML to fetch. */ novelId: number; } /** Parameters for fetching related novels. */ interface NovelRelatedParams { /** ID of the novel for which to fetch related works. */ novelId: number; } /** Parameters for searching novels. */ interface NovelSearchParams { /** Search keyword. */ word: string; /** How to match the keyword against works (default: `"partial_match_for_tags"`). */ searchTarget?: (typeof SearchTarget)[keyof typeof SearchTarget]; /** Sort order for results (default: `"date_desc"`). */ sort?: (typeof SearchSort)[keyof typeof SearchSort]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Date range preset filter (omit for no restriction). */ duration?: (typeof SearchDuration)[keyof typeof SearchDuration]; /** Start date for a custom date range (YYYY-MM-DD; requires `endDate`). */ startDate?: string; /** End date for a custom date range (YYYY-MM-DD; requires `startDate`). */ endDate?: string; /** AI-generated content filter: `0` = hide AI works, `1` = show only AI works. */ searchAiType?: 0 | 1; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching the novel ranking. */ interface NovelRankingParams { /** Ranking category (default: `"day"`). */ mode?: (typeof NovelRankingMode)[keyof typeof NovelRankingMode]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Specific date to fetch rankings for (YYYY-MM-DD; omit for the latest). */ date?: string; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching recommended novels. */ interface NovelRecommendedParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; /** * Cursor for resuming pagination: the `maxBookmarkIdForRecommend` value * extracted from a previous page's `next_url` via {@link parseNextUrl}. */ maxBookmarkIdForRecommend?: number; } /** Parameters for fetching a novel series. */ interface NovelSeriesParams { /** ID of the novel series to fetch. */ seriesId: number; /** Order of the last novel already seen; used for cursor-based pagination. */ lastOrder?: number; } /** Parameters for adding a novel bookmark. */ interface NovelBookmarkAddParams { /** ID of the novel to bookmark. */ novelId: number; /** Bookmark visibility (default: `"public"`). */ restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict]; /** Tags to attach to the bookmark. */ tags?: string[]; } /** Parameters for removing a novel bookmark. */ interface NovelBookmarkDeleteParams { /** ID of the novel to remove from bookmarks. */ novelId: number; } /** Parameters for fetching novels posted by followed users. */ interface NovelFollowParams { /** Follow visibility to fetch (default: `"public"`). */ restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching comments on a novel. */ interface NovelCommentsParams { /** ID of the novel to fetch comments for. */ novelId: number; /** Zero-based offset for pagination. */ offset?: number; /** Whether to include the `totalComments` count in the response. */ includeTotalComments?: boolean; } /** Parameters for fetching newly posted novels. */ interface NovelNewParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Cursor: fetch novels posted before this novel ID. */ maxNovelId?: number; } /** Methods for the novel API namespace. */ declare class NovelResource { #private; constructor(http: HttpClient); /** * Fetches a single novel by ID. * GET /v2/novel/detail * * @param params - Request parameters * * @example * ```ts * const result = await client.novels.detail({ novelId: 67890 }) * if (result.isOk) { * console.log(result.value.novel.title) * } else { * console.error(result.error) * } * ``` */ detail(params: NovelDetailParams): ResultAsync; /** * Fetches the structured content of a novel's WebView page. * GET /webview/v2/novel * * The endpoint itself returns an HTML page that the pixiv app renders in a * WebView; this method extracts the `WebviewNovel` object embedded in that * page (body text, rating counters, series navigation, etc.) so callers * don't need to parse HTML themselves. * * @param params - Request parameters * @returns `Err` with `type: 'parse_error'` if the embedded data cannot be * located or parsed */ text(params: NovelTextParams): ResultAsync; /** * Fetches related novels for a given novel. * GET /v1/novel/related * * @param params - Request parameters */ related(params: NovelRelatedParams): PaginatedResultAsync; /** * Searches for novels. * GET /v1/search/novel * * @param params - Request parameters * * @example * ```ts * // Iterate all results across pages * for await (const novel of client.novels.search({ word: 'fantasy' }).items()) { * console.log(novel.title) * } * * // Fetch only the first page * const page = await client.novels.search({ word: 'fantasy' }) * if (page.isOk) { * console.log(page.value.novels.length) * } * ``` */ search(params: NovelSearchParams): PaginatedResultAsync; /** * Fetches the novel ranking. * GET /v1/novel/ranking * * @param params - Request parameters */ ranking(params?: NovelRankingParams): PaginatedResultAsync; /** * Fetches recommended novels. * GET /v1/novel/recommended * * @param params - Request parameters */ recommended(params?: NovelRecommendedParams): PaginatedResultAsync; /** * Fetches a novel series. * GET /v2/novel/series * * @param params - Request parameters */ series(params: NovelSeriesParams): PaginatedResultAsync; /** * Adds a novel bookmark. * POST /v2/novel/bookmark/add * * @param params - Request parameters */ bookmarkAdd(params: NovelBookmarkAddParams): ResultAsync, PixivError>; /** * Removes a novel bookmark. * POST /v1/novel/bookmark/delete * * @param params - Request parameters */ bookmarkDelete(params: NovelBookmarkDeleteParams): ResultAsync, PixivError>; /** * Fetches novels posted by users the authenticated account follows. * GET /v1/novel/follow * * @param params - Request parameters */ follow(params?: NovelFollowParams): PaginatedResultAsync; /** * Fetches comments posted on a novel. * GET /v1/novel/comments * * @param params - Request parameters */ comments(params: NovelCommentsParams): PaginatedResultAsync; /** * Fetches newly posted novels. * GET /v1/novel/new * * @param params - Request parameters */ new(params?: NovelNewParams): PaginatedResultAsync; } //#endregion //#region src/resources/users.d.ts /** Parameters for fetching a user's bookmarked illusts. */ interface UserBookmarksIllustParams { /** ID of the user whose bookmarks to fetch. */ userId: number; /** Visibility of the bookmarks to return (default: `"public"`). */ restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Limit results to bookmarks with this tag. */ tag?: string; /** Fetch bookmarks older than this bookmark ID (cursor-based pagination). */ maxBookmarkId?: number; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's bookmarked novels. */ interface UserBookmarksNovelParams { /** ID of the user whose bookmarks to fetch. */ userId: number; /** Visibility of the bookmarks to return (default: `"public"`). */ restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Limit results to bookmarks with this tag. */ tag?: string; /** Fetch bookmarks older than this bookmark ID (cursor-based pagination). */ maxBookmarkId?: number; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's detail. */ interface UserDetailParams { /** ID of the user to fetch. */ userId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; } /** Parameters for fetching a user's illusts. */ interface UserIllustsParams { /** ID of the user whose illusts to fetch. */ userId: number; /** Work type to filter by (omit to return both illusts and manga). */ type?: (typeof UserIllustType)[keyof typeof UserIllustType]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's novels. */ interface UserNovelsParams { /** ID of the user whose novels to fetch. */ userId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's following list. */ interface UserFollowingParams { /** ID of the user whose following list to fetch. */ userId: number; /** Visibility of the follows to return (default: `"public"`). */ restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for following a user. */ interface UserFollowAddParams { /** ID of the user to follow. */ userId: number; /** Visibility of the follow (default: `"public"`). */ restrict?: (typeof FollowRestrict)[keyof typeof FollowRestrict]; } /** Parameters for unfollowing a user. */ interface UserFollowDeleteParams { /** ID of the user to unfollow. */ userId: number; } /** Parameters for fetching users related to a seed user. */ interface UserRelatedParams { /** ID of the seed user to base recommendations on. */ seedUserId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching recommended users. */ interface UserRecommendedParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's followers. */ interface UserFollowerParams { /** ID of the user whose followers to fetch. */ userId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's myPixiv users. */ interface UserMypixivParams { /** ID of the user whose myPixiv users to fetch. */ userId: number; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user list. */ interface UserListParams { /** ID of the user whose list to fetch. */ userId: number; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for fetching a user's illust bookmark tags. */ interface UserBookmarkTagsIllustParams { /** ID of the user whose bookmark tags to fetch. */ userId: number; /** Visibility of the bookmarks to aggregate tags from (default: `"public"`). */ restrict?: (typeof BookmarkRestrict)[keyof typeof BookmarkRestrict]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for searching users. */ interface UserSearchParams { /** Search keyword. */ word: string; /** Sort order for results (default: `"date_desc"`). */ sort?: (typeof SearchSort)[keyof typeof SearchSort]; /** Date range preset filter (omit for no restriction). */ duration?: (typeof SearchDuration)[keyof typeof SearchDuration]; /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Parameters for editing the AI-generated-work display setting. */ interface UserEditAiShowSettingsParams { /** New display setting value: `0` = hide AI works, `1` = show AI works. */ setting: 0 | 1; } /** Methods for the user bookmarks sub-namespace. */ declare class UserBookmarksResource { #private; constructor(http: HttpClient); /** * Fetches a user's bookmarked illusts. * GET /v1/user/bookmarks/illust * * @param params - Request parameters * * @example * ```ts * // Iterate all bookmarked illusts across pages * for await (const illust of client.users.bookmarks.illusts({ userId: client.userId }).items()) { * console.log(illust.title) * } * * // Resume from a saved cursor * import { parseNextUrl } from '@book000/pixivts' * const page = await client.users.bookmarks.illusts({ userId: client.userId }) * if (page.isOk && page.value.nextUrl) { * const cursor = parseNextUrl(page.value.nextUrl) * const next = await client.users.bookmarks.illusts({ * userId: client.userId, * maxBookmarkId: cursor.maxBookmarkId, * }) * } * ``` */ illusts(params: UserBookmarksIllustParams): PaginatedResultAsync; /** * Fetches a user's bookmarked novels. * GET /v1/user/bookmarks/novel * * @param params - Request parameters * * @example * ```ts * // Iterate all bookmarked novels across pages * for await (const novel of client.users.bookmarks.novels({ userId: client.userId }).items()) { * console.log(novel.title) * } * ``` */ novels(params: UserBookmarksNovelParams): PaginatedResultAsync; } /** Methods for the user API namespace. */ declare class UserResource { #private; /** User bookmarks sub-namespace. */ readonly bookmarks: UserBookmarksResource; constructor(http: HttpClient); /** * Fetches detailed profile information for a user. * GET /v1/user/detail * * @param params - Request parameters */ detail(params: UserDetailParams): ResultAsync; /** * Searches for users. * GET /v1/search/user * * @param params - Request parameters * * @example * ```ts * // Iterate all results across pages * for await (const preview of client.users.search({ word: 'artist' }).items()) { * console.log(preview.user.name) * } * ``` */ search(params: UserSearchParams): PaginatedResultAsync; /** * Fetches illusts posted by a user. * GET /v1/user/illusts * * @param params - Request parameters */ illusts(params: UserIllustsParams): PaginatedResultAsync; /** * Fetches novels posted by a user. * GET /v1/user/novels * * @param params - Request parameters */ novels(params: UserNovelsParams): PaginatedResultAsync; /** * Fetches the list of users that a user is following. * GET /v1/user/following * * @param params - Request parameters */ following(params: UserFollowingParams): PaginatedResultAsync; /** * Follows a user. * POST /v1/user/follow/add * * @param params - Request parameters */ followAdd(params: UserFollowAddParams): ResultAsync, PixivError>; /** * Unfollows a user. * POST /v1/user/follow/delete * * @param params - Request parameters */ followDelete(params: UserFollowDeleteParams): ResultAsync, PixivError>; /** * Fetches users related to a seed user. * GET /v1/user/related * * @param params - Request parameters */ related(params: UserRelatedParams): PaginatedResultAsync; /** * Fetches recommended users. * GET /v1/user/recommended * * @param params - Request parameters */ recommended(params?: UserRecommendedParams): PaginatedResultAsync; /** * Fetches the list of users following a user. * GET /v1/user/follower * * @param params - Request parameters */ follower(params: UserFollowerParams): PaginatedResultAsync; /** * Fetches a user's myPixiv users. * GET /v1/user/mypixiv * * @param params - Request parameters */ mypixiv(params: UserMypixivParams): PaginatedResultAsync; /** * Fetches a user list. * GET /v2/user/list * * Returns plain `PixivUser` objects under a `users` key, unlike sibling * endpoints that return `PixivUserPreviewItem` under `user_previews`. * * @param params - Request parameters */ list(params: UserListParams): PaginatedResultAsync; /** * Fetches a user's illust bookmark tags, with the number of bookmarks under each tag. * GET /v1/user/bookmark-tags/illust * * @param params - Request parameters */ bookmarkTagsIllust(params: UserBookmarkTagsIllustParams): PaginatedResultAsync; /** * Edits the authenticated user's AI-generated-work display setting. * POST /v1/user/ai-show-settings/edit * * @param params - Request parameters */ editAiShowSettings(params: UserEditAiShowSettingsParams): ResultAsync, PixivError>; } //#endregion //#region src/resources/manga.d.ts /** Parameters for fetching recommended manga. */ interface MangaRecommendedParams { /** OS filter to apply (default: `"for_ios"`). */ filter?: (typeof OSFilter)[keyof typeof OSFilter]; /** Zero-based offset for pagination. */ offset?: number; } /** Methods for the manga API namespace. */ declare class MangaResource { #private; constructor(http: HttpClient); /** * Fetches recommended manga. * GET /v1/manga/recommended * * @param params - Request parameters */ recommended(params?: MangaRecommendedParams): PaginatedResultAsync; } //#endregion //#region src/resources/ugoira.d.ts /** Parameters for fetching ugoira metadata. */ interface UgoiraMetadataParams { /** ID of the ugoira illust whose metadata to fetch. */ illustId: number; } /** Methods for the ugoira API namespace. */ declare class UgoiraResource { #private; constructor(http: HttpClient); /** * Fetches ugoira metadata (ZIP URL and per-frame timings). * GET /v1/ugoira/metadata * * @param params - Request parameters */ metadata(params: UgoiraMetadataParams): ResultAsync; } //#endregion //#region src/resources/images.d.ts /** Methods for fetching pixiv images. */ declare class ImageResource { #private; constructor(http: HttpClient); /** * Fetches a pixiv image. * * Uses a browser User-Agent and Referer (required for pixiv CDN). * No Authorization header is sent. * * @param imageUrl - Full CDN image URL */ fetch(imageUrl: string): ResultAsync; } //#endregion //#region src/client.d.ts /** Options for constructing a {@link PixivClient}. */ interface PixivClientOptions { /** Rate-limit retry configuration. */ retry?: Partial; /** Optional interceptor called after each successful response (DB seam). */ onResponse?: ResponseInterceptor; } /** * Main client for the pixiv API. * * Create an instance via {@link PixivClient.of} — the constructor is private * because initialisation requires an async token refresh. */ declare class PixivClient { #private; /** Illust API namespace. */ readonly illusts: IllustResource; /** Novel API namespace. */ readonly novels: NovelResource; /** User API namespace. */ readonly users: UserResource; /** Manga API namespace. */ readonly manga: MangaResource; /** Ugoira API namespace. */ readonly ugoira: UgoiraResource; /** Image fetch helpers. */ readonly images: ImageResource; private constructor(); /** * Numeric user ID of the authenticated account. * * Available immediately after {@link PixivClient.of} resolves. * The pixiv OAuth endpoint returns the ID as a string; this getter * normalises it to `number` for consistency with resource method params * (e.g. `UserBookmarksIllustParams.userId`). * * @example * ```ts * const client = await PixivClient.of(refreshToken) * const bookmarks = await client.users.bookmarks.illusts({ userId: client.userId }) * ``` */ get userId(): number; /** * Returns the current OAuth access token. * * The access token is short-lived and changes after each call to * {@link PixivClient.of} and after each automatic token refresh triggered * by a 401 response. * * @returns The current bearer access token string */ getAccessToken(): string; /** * Returns the current OAuth refresh token. * * The refresh token is long-lived and is used to obtain new access tokens. * It may rotate after a successful token refresh. * * @returns The current refresh token string */ getRefreshToken(): string; /** * Creates a PixivClient by refreshing the given token. * * @param refreshToken - Pixiv refresh token * @param options - Optional retry and response interceptor configuration * @returns A fully initialised {@link PixivClient} */ static of(refreshToken: string, options?: PixivClientOptions): Promise; } //#endregion export { type BookmarkDetail, type BookmarkDetailTag, BookmarkRestrict, type BookmarkTag, type ErrResult, FollowRestrict, type Frame, type HttpMethod, type IllustBookmarkAddParams, type IllustBookmarkDeleteParams, type IllustBookmarkDetailParams, type IllustBookmarkDetailResponse, type IllustComment, type IllustCommentsPage, type IllustCommentsParams, type IllustDetailParams, type IllustDetailResponse, type IllustFollowParams, type IllustListPage, type IllustNewParams, type IllustRankingParams, type IllustRecommendedPage, type IllustRecommendedParams, type IllustRelatedParams, type IllustSearchParams, type IllustSeriesDetail, type IllustSeriesPage, type IllustSeriesParams, type IllustTrendingTagsParams, type ImageUrls, type MangaRecommendedPage, type MetaPages, type MetaSinglePage, type NovelBookmarkAddParams, type NovelBookmarkDeleteParams, type NovelComment, type NovelCommentsPage, type NovelCommentsParams, type NovelDetailParams, type NovelDetailResponse, type NovelFollowParams, type NovelListPage, type NovelNewParams, NovelRankingMode, type NovelRankingParams, type NovelRecommendedPage, type NovelRecommendedParams, type NovelRelatedParams, type NovelSearchParams, type NovelSeriesDetail, type NovelSeriesPage, type NovelSeriesParams, type NovelTextParams, OSFilter, type OkResult, type PagedResponse, PaginatedResultAsync, type ParsedNextUrl, type PixivApiErrorBody, PixivClient, type PixivClientOptions, type PixivError, PixivFetchError, type PixivIllustItem, type PixivNovelItem, type PixivUgoiraItem, type PixivUser, type PixivUserItem, type PixivUserPreviewItem, type PixivUserProfile, type PixivUserProfilePublicity, type PixivUserProfileWorkspace, type PrivacyPolicy, type ProfileImageUrls, RankingMode, type ResponseInterceptor, type ResponseRecord, type Result, ResultAsync, SearchDuration, SearchSort, SearchTarget, type Series, type Tag, type TrendingTagIllust, type TrendingTagsIllustResponse, type UgoiraMetadataResponse, type UserBookmarkTagsIllustPage, type UserBookmarkTagsIllustParams, type UserBookmarksIllustPage, type UserBookmarksIllustParams, type UserBookmarksNovelPage, type UserBookmarksNovelParams, type UserDetailParams, type UserDetailResponse, type UserEditAiShowSettingsParams, type UserFollowAddParams, type UserFollowDeleteParams, type UserFollowerPage, type UserFollowerParams, type UserFollowingPage, type UserFollowingParams, UserIllustType, type UserIllustsPage, type UserIllustsParams, type UserListPage, type UserListParams, type UserMypixivPage, type UserMypixivParams, type UserNovelsPage, type UserNovelsParams, type UserRecommendedPage, type UserRecommendedParams, type UserRelatedPage, type UserRelatedParams, type UserSearchPage, type UserSearchParams, type WebviewNovel, type WebviewNovelNavigationInfo, type WebviewNovelRating, type WebviewNovelSeriesNavigation, type ZipUrls, apiError, authFailedError, err, failedPaginated, networkError, ok, parseError, parseNextUrl, rateLimitError }; //# sourceMappingURL=index.d.ts.map