UNPKG

@kubb/plugin-client

Version:

API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.

73 lines (68 loc) 2.85 kB
import { Operation } from '@kubb/oas'; import { OperationSchemas } from '@kubb/plugin-oas'; import { FunctionParams } from '@kubb/react'; import { P as PluginClient } from './types-DFo3xInC.cjs'; import { KubbNode } from '@kubb/react/types'; import '@kubb/core'; type Props$1 = { /** * Name of the function */ name: string; urlName?: string; isExportable?: boolean; isIndexable?: boolean; isConfigurable?: boolean; returnType?: string; baseURL: string | undefined; dataReturnType: PluginClient['resolvedOptions']['dataReturnType']; paramsCasing: PluginClient['resolvedOptions']['paramsCasing']; paramsType: PluginClient['resolvedOptions']['pathParamsType']; pathParamsType: PluginClient['resolvedOptions']['pathParamsType']; parser: PluginClient['resolvedOptions']['parser'] | undefined; typeSchemas: OperationSchemas; zodSchemas: OperationSchemas | undefined; operation: Operation; children?: KubbNode; }; type GetParamsProps$1 = { paramsCasing: PluginClient['resolvedOptions']['paramsCasing']; paramsType: PluginClient['resolvedOptions']['paramsType']; pathParamsType: PluginClient['resolvedOptions']['pathParamsType']; typeSchemas: OperationSchemas; isConfigurable: boolean; }; declare function Client({ name, isExportable, isIndexable, returnType, typeSchemas, baseURL, dataReturnType, parser, zodSchemas, paramsType, paramsCasing, pathParamsType, operation, urlName, children, isConfigurable, }: Props$1): any; declare namespace Client { var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas, isConfigurable }: GetParamsProps$1) => FunctionParams; } type OperationsProps = { name: string; operations: Array<Operation>; }; declare function Operations({ name, operations }: OperationsProps): any; type Props = { /** * Name of the function */ name: string; isExportable?: boolean; isIndexable?: boolean; baseURL: string | undefined; paramsCasing: PluginClient['resolvedOptions']['paramsCasing']; paramsType: PluginClient['resolvedOptions']['pathParamsType']; pathParamsType: PluginClient['resolvedOptions']['pathParamsType']; typeSchemas: OperationSchemas; operation: Operation; }; type GetParamsProps = { paramsCasing: PluginClient['resolvedOptions']['paramsCasing']; paramsType: PluginClient['resolvedOptions']['paramsType']; pathParamsType: PluginClient['resolvedOptions']['pathParamsType']; typeSchemas: OperationSchemas; }; declare function Url({ name, isExportable, isIndexable, typeSchemas, baseURL, paramsType, paramsCasing, pathParamsType, operation }: Props): any; declare namespace Url { var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) => FunctionParams; } export { Client, Operations, Url };