ctan-openapi-fetch
Version:
A thin wrapper around `openapi-fetch` for use with the CTAN API
26 lines (25 loc) • 1.15 kB
TypeScript
import { type Client, type ClientOptions, type PathBasedClient } from 'openapi-fetch';
import type { MediaType } from 'openapi-typescript-helpers';
import type * as openapi from '../dist/openapi/json-2.0.d.ts';
/**
* The default value of {@link ClientOptions.baseUrl}.
*/
export declare const baseUrl: "https://ctan.org/json/2.0";
export interface CtanClientOptions extends ClientOptions {
/**
* @defaultValue `'https://ctan.org/json/2.0'`
*/
baseUrl?: Required<ClientOptions>['baseUrl'];
}
/**
* openapi-fetch's `createClient` function
* with default `Paths` type and `baseUrl` for CTAN.
*/
export declare function createClient<Paths extends {} = openapi.paths, Media extends MediaType = MediaType>(options?: Readonly<CtanClientOptions>): Client<Paths, Media>;
/**
* openapi-fetch's `createPathBasedClient` function
* with default `Paths` type and `baseUrl` for CTAN.
*/
export declare function createPathBasedClient<Paths extends {} = openapi.paths, Media extends MediaType = MediaType>(options?: Readonly<CtanClientOptions>): PathBasedClient<Paths, Media>;
export type { openapi };
export type * from 'openapi-fetch';