@orpc/react 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/dist/src/general-hooks.d.ts +1 -0
- package/dist/src/general-utils.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/orpc-path.d.ts +1 -0
- package/dist/src/procedure-hooks.d.ts +1 -0
- package/dist/src/procedure-utils.d.ts +1 -0
- package/dist/src/react-context.d.ts +1 -0
- package/dist/src/react-hooks.d.ts +3 -2
- package/dist/src/react-utils.d.ts +3 -2
- package/dist/src/react.d.ts +1 -0
- package/dist/src/tanstack-key.d.ts +1 -0
- package/dist/src/tanstack-query.d.ts +1 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/use-queries/builder.d.ts +1 -0
- package/dist/src/use-queries/builders.d.ts +1 -0
- package/dist/src/use-queries/hook.d.ts +1 -0
- package/package.json +8 -7
package/dist/index.js
CHANGED
@@ -21,3 +21,4 @@ export interface CreateGeneralHooksOptions {
|
|
21
21
|
path: string[];
|
22
22
|
}
|
23
23
|
export declare function createGeneralHooks<TInputSchema extends Schema = undefined, TOutputSchema extends Schema = undefined, TFuncOutput extends SchemaOutput<TOutputSchema> = SchemaOutput<TOutputSchema>>(options: CreateGeneralHooksOptions): GeneralHooks<TInputSchema, TOutputSchema, TFuncOutput>;
|
24
|
+
//# sourceMappingURL=general-hooks.d.ts.map
|
@@ -38,3 +38,4 @@ export interface CreateGeneralUtilsOptions {
|
|
38
38
|
path: string[];
|
39
39
|
}
|
40
40
|
export declare function createGeneralUtils<TInputSchema extends Schema = undefined, TOutputSchema extends Schema = undefined, TFuncOutput extends SchemaOutput<TOutputSchema> = SchemaOutput<TOutputSchema>>(options: CreateGeneralUtilsOptions): GeneralUtils<TInputSchema, TOutputSchema, TFuncOutput>;
|
41
|
+
//# sourceMappingURL=general-utils.d.ts.map
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/orpc-path.d.ts
CHANGED
@@ -2,3 +2,4 @@ import type { ProcedureHooks } from './procedure-hooks';
|
|
2
2
|
import type { ORPCHooksWithContractRouter, ORPCHooksWithRouter } from './react-hooks';
|
3
3
|
export declare const orpcPathSymbol: unique symbol;
|
4
4
|
export declare function getORPCPath(orpc: ORPCHooksWithContractRouter<any> | ORPCHooksWithRouter<any> | ProcedureHooks<any, any, any>): string[];
|
5
|
+
//# sourceMappingURL=orpc-path.d.ts.map
|
@@ -28,3 +28,4 @@ export interface CreateProcedureHooksOptions {
|
|
28
28
|
path: string[];
|
29
29
|
}
|
30
30
|
export declare function createProcedureHooks<TInputSchema extends Schema = undefined, TOutputSchema extends Schema = undefined, TFuncOutput extends SchemaOutput<TOutputSchema> = SchemaOutput<TOutputSchema>>(options: CreateProcedureHooksOptions): ProcedureHooks<TInputSchema, TOutputSchema, TFuncOutput>;
|
31
|
+
//# sourceMappingURL=procedure-hooks.d.ts.map
|
@@ -32,3 +32,4 @@ export interface CreateProcedureUtilsOptions<TInputSchema extends Schema = undef
|
|
32
32
|
path: string[];
|
33
33
|
}
|
34
34
|
export declare function createProcedureUtils<TInputSchema extends Schema, TOutputSchema extends Schema, TFuncOutput extends SchemaOutput<TOutputSchema>>(options: CreateProcedureUtilsOptions<TInputSchema, TOutputSchema, TFuncOutput>): ProcedureUtils<TInputSchema, TOutputSchema, TFuncOutput>;
|
35
|
+
//# sourceMappingURL=procedure-utils.d.ts.map
|
@@ -10,3 +10,4 @@ export interface ORPCContextValue<TRouter extends ContractRouter | Router<any>>
|
|
10
10
|
export type ORPCContext<TRouter extends ContractRouter | Router<any>> = Context<ORPCContextValue<TRouter> | undefined>;
|
11
11
|
export declare function createORPCContext<TRouter extends ContractRouter | Router<any>>(): ORPCContext<TRouter>;
|
12
12
|
export declare function useORPCContext<TRouter extends ContractRouter | Router<any>>(context: ORPCContext<TRouter>): ORPCContextValue<TRouter>;
|
13
|
+
//# sourceMappingURL=react-context.d.ts.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ContractProcedure, ContractRouter, SchemaOutput } from '@orpc/contract';
|
2
|
-
import type { Procedure, Router } from '@orpc/server';
|
2
|
+
import type { Lazy, Procedure, Router } from '@orpc/server';
|
3
3
|
import type { ORPCContext } from './react-context';
|
4
4
|
import { type GeneralHooks } from './general-hooks';
|
5
5
|
import { type ProcedureHooks } from './procedure-hooks';
|
@@ -7,7 +7,7 @@ export type ORPCHooksWithContractRouter<TRouter extends ContractRouter> = {
|
|
7
7
|
[K in keyof TRouter]: TRouter[K] extends ContractProcedure<infer UInputSchema, infer UOutputSchema> ? ProcedureHooks<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> & GeneralHooks<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> : TRouter[K] extends ContractRouter ? ORPCHooksWithContractRouter<TRouter[K]> : never;
|
8
8
|
} & GeneralHooks<undefined, undefined, unknown>;
|
9
9
|
export type ORPCHooksWithRouter<TRouter extends Router<any>> = {
|
10
|
-
[K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> ? ProcedureHooks<UInputSchema, UOutputSchema, UFuncOutput> & GeneralHooks<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCHooksWithRouter<TRouter[K]> : never;
|
10
|
+
[K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? ProcedureHooks<UInputSchema, UOutputSchema, UFuncOutput> & GeneralHooks<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCHooksWithRouter<TRouter[K]> : never;
|
11
11
|
} & GeneralHooks<undefined, undefined, unknown>;
|
12
12
|
export interface CreateORPCHooksOptions<TRouter extends ContractRouter | Router<any>> {
|
13
13
|
context: ORPCContext<TRouter>;
|
@@ -19,3 +19,4 @@ export interface CreateORPCHooksOptions<TRouter extends ContractRouter | Router<
|
|
19
19
|
path?: string[];
|
20
20
|
}
|
21
21
|
export declare function createORPCHooks<TRouter extends ContractRouter | Router<any>>(options: CreateORPCHooksOptions<TRouter>): TRouter extends Router<any> ? ORPCHooksWithRouter<TRouter> : TRouter extends ContractRouter ? ORPCHooksWithContractRouter<TRouter> : never;
|
22
|
+
//# sourceMappingURL=react-hooks.d.ts.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ContractProcedure, ContractRouter, SchemaOutput } from '@orpc/contract';
|
2
|
-
import type { Procedure, Router } from '@orpc/server';
|
2
|
+
import type { Lazy, Procedure, Router } from '@orpc/server';
|
3
3
|
import type { ORPCContextValue } from './react-context';
|
4
4
|
import { type GeneralUtils } from './general-utils';
|
5
5
|
import { type ProcedureUtils } from './procedure-utils';
|
@@ -7,7 +7,7 @@ export type ORPCUtilsWithContractRouter<TRouter extends ContractRouter> = {
|
|
7
7
|
[K in keyof TRouter]: TRouter[K] extends ContractProcedure<infer UInputSchema, infer UOutputSchema> ? ProcedureUtils<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> & GeneralUtils<UInputSchema, UOutputSchema, SchemaOutput<UOutputSchema>> : TRouter[K] extends ContractRouter ? ORPCUtilsWithContractRouter<TRouter[K]> : never;
|
8
8
|
} & GeneralUtils<undefined, undefined, unknown>;
|
9
9
|
export type ORPCUtilsWithRouter<TRouter extends Router<any>> = {
|
10
|
-
[K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> ? ProcedureUtils<UInputSchema, UOutputSchema, UFuncOutput> & GeneralUtils<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCUtilsWithRouter<TRouter[K]> : never;
|
10
|
+
[K in keyof TRouter]: TRouter[K] extends Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput> | Lazy<Procedure<any, any, infer UInputSchema, infer UOutputSchema, infer UFuncOutput>> ? ProcedureUtils<UInputSchema, UOutputSchema, UFuncOutput> & GeneralUtils<UInputSchema, UOutputSchema, UFuncOutput> : TRouter[K] extends Router<any> ? ORPCUtilsWithRouter<TRouter[K]> : never;
|
11
11
|
} & GeneralUtils<undefined, undefined, unknown>;
|
12
12
|
export interface CreateORPCUtilsOptions<TRouter extends ContractRouter | Router<any>> {
|
13
13
|
contextValue: ORPCContextValue<TRouter>;
|
@@ -19,3 +19,4 @@ export interface CreateORPCUtilsOptions<TRouter extends ContractRouter | Router<
|
|
19
19
|
path?: string[];
|
20
20
|
}
|
21
21
|
export declare function createORPCUtils<TRouter extends ContractRouter | Router<any>>(options: CreateORPCUtilsOptions<TRouter>): TRouter extends Router<any> ? ORPCUtilsWithRouter<TRouter> : TRouter extends ContractRouter ? ORPCUtilsWithContractRouter<TRouter> : never;
|
22
|
+
//# sourceMappingURL=react-utils.d.ts.map
|
package/dist/src/react.d.ts
CHANGED
@@ -18,3 +18,4 @@ export declare function createORPCReact<TRouter extends ContractRouter | Router<
|
|
18
18
|
orpc: TRouter extends Router<any> ? ORPCReactWithRouter<TRouter> : TRouter extends ContractRouter ? ORPCReactWithContractRouter<TRouter> : never;
|
19
19
|
ORPCContext: ORPCContext<TRouter>;
|
20
20
|
};
|
21
|
+
//# sourceMappingURL=react.d.ts.map
|
@@ -12,3 +12,4 @@ export declare function getQueryKey<T extends ORPCHooksWithContractRouter<any> |
|
|
12
12
|
export declare function getQueryKeyFromPath(path: string[], options?: GetQueryKeyOptions<unknown>): QueryKey;
|
13
13
|
export declare function getMutationKey<T extends ORPCHooksWithContractRouter<any> | ORPCHooksWithRouter<any> | ProcedureHooks<any, any, any>>(orpc: T): MutationKey;
|
14
14
|
export declare function getMutationKeyFromPath(path: string[]): MutationKey;
|
15
|
+
//# sourceMappingURL=tanstack-key.d.ts.map
|
@@ -16,3 +16,4 @@ export interface ORPCQueryFilters<TFilterInput> extends SetOptional<QueryFilters
|
|
16
16
|
}
|
17
17
|
export interface ORPCInvalidateQueryFilters<TFilterInput> extends SetOptional<InvalidateQueryFilters, 'queryKey'>, ORPCAdditionalQueryFilters<TFilterInput> {
|
18
18
|
}
|
19
|
+
//# sourceMappingURL=tanstack-query.d.ts.map
|
package/dist/src/types.d.ts
CHANGED
@@ -17,3 +17,4 @@ export interface CreateUseQueriesBuilderOptions<TInputSchema extends Schema, TOu
|
|
17
17
|
}
|
18
18
|
export declare function createUseQueriesBuilder<TInputSchema extends Schema = undefined, TOutputSchema extends Schema = undefined, TFuncOutput extends SchemaOutput<TOutputSchema> = SchemaOutput<TOutputSchema>>(options: CreateUseQueriesBuilderOptions<TInputSchema, TOutputSchema, TFuncOutput>): UseQueriesBuilder<TInputSchema, TOutputSchema, TFuncOutput>;
|
19
19
|
export {};
|
20
|
+
//# sourceMappingURL=builder.d.ts.map
|
@@ -16,3 +16,4 @@ export interface CreateUseQueriesBuildersOptions<TRouter extends Router<any> | C
|
|
16
16
|
path?: string[];
|
17
17
|
}
|
18
18
|
export declare function createUseQueriesBuilders<TRouter extends Router<any> | ContractRouter>(options: CreateUseQueriesBuildersOptions<TRouter>): TRouter extends Router<any> ? UseQueriesBuildersWithRouter<TRouter> : TRouter extends ContractRouter ? UseQueriesBuildersWithContractRouter<TRouter> : never;
|
19
|
+
//# sourceMappingURL=builders.d.ts.map
|
@@ -13,3 +13,4 @@ export interface UseQueriesFactoryOptions<TRouter extends Router<any> | Contract
|
|
13
13
|
context: ORPCContext<TRouter>;
|
14
14
|
}
|
15
15
|
export declare function useQueriesFactory<TRouter extends Router<any> | ContractRouter>(options: UseQueriesFactoryOptions<TRouter>): TRouter extends Router<any> ? UseQueriesWithRouter<TRouter> : TRouter extends ContractRouter ? UseQueriesWithContractRouter<TRouter> : never;
|
16
|
+
//# sourceMappingURL=hook.d.ts.map
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/react",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.14.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -24,24 +24,25 @@
|
|
24
24
|
}
|
25
25
|
},
|
26
26
|
"files": [
|
27
|
-
"
|
27
|
+
"!**/*.map",
|
28
|
+
"!**/*.tsbuildinfo",
|
28
29
|
"dist"
|
29
30
|
],
|
30
31
|
"peerDependencies": {
|
31
32
|
"@tanstack/react-query": ">=5.59.0",
|
32
33
|
"react": ">=18.3.0",
|
33
|
-
"@orpc/client": "0.
|
34
|
-
"@orpc/server": "0.
|
35
|
-
"@orpc/contract": "0.
|
34
|
+
"@orpc/client": "0.14.0",
|
35
|
+
"@orpc/server": "0.14.0",
|
36
|
+
"@orpc/contract": "0.14.0"
|
36
37
|
},
|
37
38
|
"dependencies": {
|
38
|
-
"@orpc/shared": "0.
|
39
|
+
"@orpc/shared": "0.14.0"
|
39
40
|
},
|
40
41
|
"devDependencies": {
|
41
42
|
"zod": "^3.23.8"
|
42
43
|
},
|
43
44
|
"scripts": {
|
44
|
-
"build": "tsup --clean --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|
45
|
+
"build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|
45
46
|
"build:watch": "pnpm run build --watch",
|
46
47
|
"type:check": "tsc -b"
|
47
48
|
}
|