import type { Merge } from 'type-fest'; import type { CodeBuilderOptions } from '../helpers/code-builder.js'; import type { Request } from '../index.js'; export type TargetId = keyof typeof targets; export type ClientId = string; export interface ClientInfo = Record> { /** * A description of the client. * * @example Promise based HTTP client for the browser and node.js */ description: string; /** * The default file extension for the client. * * @example `.js` */ extname: Extension; /** * Retrieve or generate a command to install the client. * * @example () => 'npm install axios --save'; */ installation?: Converter; /** * A unique identifier for the client. * * This should be a string that is unique to the client for the given target. * * @example `axios` */ key: ClientId; /** * A link to the documentation or homepage of the client. * * @example https://github.com/axios/axios */ link: string; /** * The formatted name of the client. * * @example Axios */ title: string; } export type Converter> = (request: Request, options?: Merge) => string; export interface Client = Record> { convert: Converter; info: ClientInfo; } export interface ClientPlugin = Record> { client: Client; target: TargetId; } export type Extension = `.${string}` | null; export interface TargetInfo { cli?: string; default: string; key: TargetId; title: string; } export interface Target { clientsById: Record; info: TargetInfo; } type supportedTargets = 'c' | 'clojure' | 'csharp' | 'go' | 'http' | 'java' | 'javascript' | 'json' | 'kotlin' | 'node' | 'objc' | 'ocaml' | 'php' | 'powershell' | 'python' | 'r' | 'ruby' | 'shell' | 'swift'; export declare const targets: Record; export declare const isTarget: (target: Target) => target is Target; export declare const addTarget: (target: Target) => void; export declare const isClient: (client: Client) => client is Client; export declare const addClientPlugin: (plugin: ClientPlugin) => void; export declare const addTargetClient: (targetId: TargetId, client: Client) => void; export {}; //# sourceMappingURL=index.d.ts.map