RspcTypescript apiTs rspc solid
@rspc/solid
TypeScript API reference for @rspc/solid, version 0.0.0-main-45466c86.
0.0.0-main-45466c86
0.2.1 ↗0.2.00.0.0-main-b8b35d280.0.0-main-45466c860.0.0-main-9452a4610.0.0-main-842dee87 ↗0.0.0-main-2e237f7b ↗0.0.0-main-50d5642f ↗0.0.0-main-52bdb3c1 ↗0.0.0-main-bca3242b ↗0.0.0-main-f10683d0 ↗0.0.0-main-ee02fc57 ↗0.0.0-main-6ed8cc980.0.0-main-9c15d2d40.0.0-main-799eec5d0.0.0-main-4caedb140.0.0-main-3c0947890.0.0-main-a312a5050.0.0-main-a2d5effc0.0.0-main-5d4b97910.0.0-main-cc3386190.0.0-main-333a38d40.0.0-main-f9ac6b780.0.0-main-7cdd90da0.1.30.0.0-main-32fe3d8a0.0.0-main-7c0a67c10.1.20.1.10.1.00.0.90.0.80.0.70.0.6
Generated from the published type declarations for this exact release.
Public exports of @rspc/solid at version 0.0.0-main-45466c86.
This page documents 0.0.0-main-45466c86. The documented version is 0.2.0.
Interfaces
BaseOptions
export interface BaseOptions<TProcedures extends ProceduresDef> {
rspc?: {
client?: Client<TProcedures>;
};
}
Context
export interface Context<TProcedures extends ProceduresDef> {
client: Client<TProcedures>;
queryClient: QueryClient;
}
SubscriptionOptions
export interface SubscriptionOptions<TOutput> {
enabled?: boolean;
onStarted?: () => void;
onData: (data: TOutput) => void;
onError?: (err: RSPCError) => void;
}
Type aliases
HooksOpts
export type HooksOpts<P extends ProceduresDef> = {
context: Solid.Context<Context<P>>;
};
KeyAndInput
export type KeyAndInput = [
string
] | [
string,
any
];
Functions
createReactQueryHooks
export declare function createReactQueryHooks<P extends ProceduresDef>(client: AlphaClient<P>, opts?: HooksOpts<P>): {
_rspc_def: P;
Provider: (props: {
children?: Solid.JSX.Element;
client: AlphaClient<P>;
queryClient: QueryClient;
}) => Solid.JSX.Element;
useContext: () => Context<P>;
createQuery: <K extends P["queries"]["key"] & string, TQueryFnData = inferQueryResult<P, K>, TData = inferQueryResult<P, K>>(keyAndInput: () => [
key: K,
...input: _inferProcedureHandlerInput<P, "queries", K>
], opts?: Omit<CreateQueryOptions<TQueryFnData, AlphaRSPCError, TData, () => [
K,
inferQueryInput<P, K>
]>, "queryFn" | "queryKey"> & BaseOptions<P>) => CreateQueryResult<TData, RSPCError>;
createMutation: <K_1 extends P["mutations"]["key"] & string, TContext = unknown>(key: K_1 | [
K_1
// … truncated, see the source link
