Interface OsAPIClientBeta

Interface representing a client for interacting with the OctoStar API.

interface OsAPIClient {
    fetchData<T>(options: FetchOptions): Promise<T>;
    streamData(options: FetchOptions): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
    streamJson<T>(options: StreamJsonOptions<T>): Promise<void>;
    streamText(options: StreamTextOptions): Promise<void>;
}

Methods

  • Beta

    Fetch data from the API.

    Type Parameters

    • T

    Parameters

    • options: FetchOptions

      Configuration options for the fetch request.

    Returns Promise<T>

    A promise that resolves with the fetched data of type T.

  • Beta

    Stream data from the API.

    Parameters

    • options: FetchOptions

      Configuration options for the stream request.

    Returns Promise<ReadableStream<Uint8Array<ArrayBuffer>>>

    A promise that resolves when the streaming is complete.

  • Beta

    Streams JSON line data from the API.

    Type Parameters

    • T

    Parameters

    Returns Promise<void>

    A promise that resolves when the streaming is complete.

  • Beta

    Streams text data from the API.

    Parameters

    Returns Promise<void>

    A promise that resolves when the streaming is complete.