UNPKG

masto

Version:

Mastodon API client for JavaScript, TypeScript, Node.js, browsers

29 lines (28 loc) 1.12 kB
import { type LogType } from "../interfaces/index.js"; import { type mastodon } from "../mastodon/index.js"; import { type MastoHttpConfigProps, type WebSocketConfigProps } from "./config/index.js"; interface LogConfigProps { /** * Log level for the client. * * - `debug`: Log everything. * - `info`: Log important information. * - `warn`: Log warnings. * - `error`: Log errors. * * Defaults to `warn`. */ readonly log?: LogType; } export declare const createRestAPIClient: (props: MastoHttpConfigProps & LogConfigProps) => mastodon.rest.Client; export declare const createOAuthAPIClient: (props: MastoHttpConfigProps & LogConfigProps) => mastodon.oauth.Client; interface WebSocketCustomImplProps { /** * Custom WebSocket implementation. In Deno, you can use `WebSocket` to avoid potential errors. * * Defaults to `window.WebSocket`. */ readonly implementation?: unknown; } export declare function createStreamingAPIClient(props: WebSocketConfigProps & LogConfigProps & WebSocketCustomImplProps): mastodon.streaming.Client; export {};