@kubb/plugin-svelte-query
Version:
Svelte Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for Svelte applications.
114 lines (107 loc) • 4.86 kB
text/typescript
import { Operation } from '@kubb/oas';
import { OperationSchemas } from '@kubb/plugin-oas';
import { ReactNode } from 'react';
import { P as PluginSvelteQuery, T as Transformer } from './types-BIWbWacf.cjs';
import { FunctionParams } from '@kubb/react';
import '@kubb/core';
import '@kubb/plugin-client';
type Props$4 = {
/**
* Name of the function
*/
name: string;
typeName: string;
clientName: string;
mutationKeyName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
paramsType: PluginSvelteQuery['resolvedOptions']['paramsType'];
dataReturnType: PluginSvelteQuery['resolvedOptions']['client']['dataReturnType'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
};
declare function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName, }: Props$4): ReactNode;
type Props$3 = {
/**
* Name of the function
*/
name: string;
queryOptionsName: string;
queryKeyName: string;
queryKeyTypeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
paramsType: PluginSvelteQuery['resolvedOptions']['paramsType'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
dataReturnType: PluginSvelteQuery['resolvedOptions']['client']['dataReturnType'];
};
type GetParamsProps$3 = {
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
paramsType: PluginSvelteQuery['resolvedOptions']['paramsType'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
dataReturnType: PluginSvelteQuery['resolvedOptions']['client']['dataReturnType'];
typeSchemas: OperationSchemas;
};
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$3): ReactNode;
declare namespace Query {
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$3) => FunctionParams;
}
type Props$2 = {
name: string;
typeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
transformer: Transformer | undefined;
};
type GetParamsProps$2 = {
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$2): ReactNode;
declare namespace QueryKey {
var getParams: ({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps$2) => FunctionParams;
var getTransformer: Transformer;
}
type Props$1 = {
name: string;
typeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
transformer: Transformer | undefined;
};
type GetParamsProps$1 = {
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$1): ReactNode;
declare namespace MutationKey {
var getParams: ({}: GetParamsProps$1) => FunctionParams;
var getTransformer: Transformer;
}
type Props = {
name: string;
clientName: string;
queryKeyName: string;
typeSchemas: OperationSchemas;
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
paramsType: PluginSvelteQuery['resolvedOptions']['paramsType'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
dataReturnType: PluginSvelteQuery['resolvedOptions']['client']['dataReturnType'];
};
type GetParamsProps = {
paramsCasing: PluginSvelteQuery['resolvedOptions']['paramsCasing'];
paramsType: PluginSvelteQuery['resolvedOptions']['paramsType'];
pathParamsType: PluginSvelteQuery['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }: Props): ReactNode;
declare namespace QueryOptions {
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps) => FunctionParams;
}
export { Mutation, MutationKey, Query, QueryKey, QueryOptions };