tsdoc-defaults demo
    Preparing search index...

    Interface ClientOptions

    Options for an example HTTP client.

    The source of this page, with its @default tags:

    // tsdoc-defaults: import os from 'node:os'
    export interface ClientOptions {
    /**
    * Request timeout in milliseconds.
    * @default `10_000`
    */
    timeoutMs?: number;

    /**
    * Retries after a failed request.
    * @defaultValue 3
    */
    retries?: number;

    /**
    * Directory for cached responses.
    * @default `os.tmpdir()`
    */
    cacheDir?: string;

    /**
    * Base URL for relative request paths. Prose stays a "Default" block.
    * @default the origin of the current page
    */
    baseUrl?: string;
    }

    The file tsdoc-defaults generates from those tags:

    // Generated by tsdoc-defaults from the @default/@defaultValue tags in ./options.ts. Do not edit.
    import type { ClientOptions } from './options.js';
    import os from 'node:os';

    export const DEFAULTS: {
    ClientOptions: Required<
    Pick<ClientOptions, 'timeoutMs' | 'retries' | 'cacheDir'>
    >;
    } = {
    ClientOptions: {
    timeoutMs: 10_000,
    retries: 3,
    cacheDir: os.tmpdir(),
    },
    };
    interface ClientOptions {
        baseUrl?: string;
        cacheDir?: string;
        retries?: number;
        timeoutMs?: number;
    }
    Index
    baseUrl?: string

    Base URL for relative request paths. Prose stays a "Default" block.

    the origin of the current page
    
    cacheDir?: string = os.tmpdir()

    Directory for cached responses.

    retries?: number = 3

    Retries after a failed request.

    timeoutMs?: number = 10_000

    Request timeout in milliseconds.