@kubb/plugin-swr
Version:
SWR hooks generator plugin for Kubb, creating type-safe data fetching hooks from OpenAPI specifications for React and Next.js applications.
166 lines (165 loc) • 4.55 kB
TypeScript
import { i as __name, n as PluginSwr, r as Transformer } from "./types-wR9RZTnh.js";
import { Operation } from "@kubb/oas";
import { OperationSchemas } from "@kubb/plugin-oas";
import { FabricReactNode } from "@kubb/react-fabric/types";
import { FunctionParams } from "@kubb/react-fabric";
//#region src/components/Mutation.d.ts
type Props$4 = {
/**
* Name of the function
*/
name: string;
typeName: string;
clientName: string;
mutationKeyName: string;
mutationKeyTypeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
paramsType: PluginSwr['resolvedOptions']['paramsType'];
dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
/**
* When true, mutation parameters are passed via trigger() instead of as hook arguments
* @default false
*/
paramsToTrigger?: boolean;
};
declare function Mutation({
name,
clientName,
mutationKeyName,
mutationKeyTypeName,
paramsType,
paramsCasing,
pathParamsType,
dataReturnType,
typeSchemas,
operation,
paramsToTrigger
}: Props$4): FabricReactNode;
//#endregion
//#region src/components/MutationKey.d.ts
type Props$3 = {
name: string;
typeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
transformer: Transformer | undefined;
};
type GetParamsProps$2 = {
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function MutationKey({
name,
typeSchemas,
paramsCasing,
pathParamsType,
operation,
typeName,
transformer
}: Props$3): FabricReactNode;
declare namespace MutationKey {
var getParams: ({}: GetParamsProps$2) => FunctionParams;
var getTransformer: Transformer;
}
//#endregion
//#region src/components/Query.d.ts
type Props$2 = {
/**
* Name of the function
*/
name: string;
queryOptionsName: string;
queryKeyName: string;
queryKeyTypeName: string;
typeSchemas: OperationSchemas;
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
paramsType: PluginSwr['resolvedOptions']['paramsType'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
dataReturnType: PluginSwr['resolvedOptions']['client']['dataReturnType'];
operation: Operation;
};
declare function Query({
name,
typeSchemas,
queryKeyName,
queryKeyTypeName,
queryOptionsName,
operation,
dataReturnType,
paramsType,
paramsCasing,
pathParamsType
}: Props$2): FabricReactNode;
//#endregion
//#region src/components/QueryKey.d.ts
type Props$1 = {
name: string;
typeName: string;
typeSchemas: OperationSchemas;
operation: Operation;
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
transformer: Transformer | undefined;
};
type GetParamsProps$1 = {
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function QueryKey({
name,
typeSchemas,
paramsCasing,
pathParamsType,
operation,
typeName,
transformer
}: Props$1): FabricReactNode;
declare namespace QueryKey {
var getParams: ({
pathParamsType,
paramsCasing,
typeSchemas
}: GetParamsProps$1) => FunctionParams;
var getTransformer: Transformer;
}
//#endregion
//#region src/components/QueryOptions.d.ts
type Props = {
name: string;
clientName: string;
typeSchemas: OperationSchemas;
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
paramsType: PluginSwr['resolvedOptions']['paramsType'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
};
type GetParamsProps = {
paramsType: PluginSwr['resolvedOptions']['paramsType'];
paramsCasing: PluginSwr['resolvedOptions']['paramsCasing'];
pathParamsType: PluginSwr['resolvedOptions']['pathParamsType'];
typeSchemas: OperationSchemas;
};
declare function QueryOptions({
name,
clientName,
typeSchemas,
paramsCasing,
paramsType,
pathParamsType
}: Props): FabricReactNode;
declare namespace QueryOptions {
var getParams: ({
paramsType,
paramsCasing,
pathParamsType,
typeSchemas
}: GetParamsProps) => FunctionParams;
}
//#endregion
export { Mutation, MutationKey, Query, QueryKey, QueryOptions };
//# sourceMappingURL=components.d.ts.map