tag-rpc 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +7 -5
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -11,14 +11,16 @@ declare class TAG_API_ERROR extends Error {
11
11
  constructor(status: number, statusText: string, body: any, url: string);
12
12
  }
13
13
  declare function createTagRPC<TApiRoutes extends {
14
- [K in string]: {
14
+ [K in keyof TApiRoutes]: {
15
15
  PathParams: any;
16
16
  Methods: Record<string, MethodShape>;
17
17
  };
18
- }, TNamedRoutes extends Record<string, {
19
- path: keyof TApiRoutes;
20
- method: string;
21
- }>>(registry: {
18
+ }, TNamedRoutes extends {
19
+ [K in keyof TNamedRoutes]: {
20
+ path: keyof TApiRoutes;
21
+ method: string;
22
+ };
23
+ }>(registry: {
22
24
  namedRoutes: TNamedRoutes;
23
25
  }): { [K in keyof TNamedRoutes]: <TPath extends TNamedRoutes[K]["path"] & keyof TApiRoutes, TMethod extends TNamedRoutes[K]["method"] & keyof TApiRoutes[TPath]["Methods"] & string>(options: Omit<RequestInit, "method" | "body"> & (TApiRoutes[TPath]["PathParams"] extends never ? {
24
26
  pathParams?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tag-rpc",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "End-to-end type safety for Next.js Route Handlers",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",