Skip to content

Commit e10d1b3

Browse files
authored
fix(tanstack): build OOM type fix (#640)
* fix(tanstack): build OOM type fix * use Record<never, never> instead of {} for ProcedureHooks type fixes #610
1 parent 392b8a2 commit e10d1b3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/clients/tanstack-query/src/react.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ type ProcedureHookGroup<Schema extends SchemaDef> = {
195195
};
196196
};
197197

198-
export type ProcedureHooks<Schema extends SchemaDef> = Schema extends { procedures: Record<string, any> }
198+
export type ProcedureHooks<Schema extends SchemaDef> = Schema['procedures'] extends Record<string, any>
199199
? {
200200
/**
201201
* Custom procedures.
202202
*/
203203
$procs: ProcedureHookGroup<Schema>;
204204
}
205-
: {};
205+
: Record<never, never>;
206206

207207
// Note that we can potentially use TypeScript's mapped type to directly map from ORM contract, but that seems
208208
// to significantly slow down tsc performance ...

packages/clients/tanstack-query/src/svelte/index.svelte.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ type ProcedureHookGroup<Schema extends SchemaDef> = {
182182
};
183183
};
184184

185-
export type ProcedureHooks<Schema extends SchemaDef> = Schema extends { procedures: Record<string, any> }
185+
export type ProcedureHooks<Schema extends SchemaDef> = Schema['procedures'] extends Record<string, any>
186186
? {
187187
/**
188188
* Custom procedures.
189189
*/
190190
$procs: ProcedureHookGroup<Schema>;
191191
}
192-
: {};
192+
: Record<never, never>;
193193

194194
// Note that we can potentially use TypeScript's mapped type to directly map from ORM contract, but that seems
195195
// to significantly slow down tsc performance ...

packages/clients/tanstack-query/src/vue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ type ProcedureHookGroup<Schema extends SchemaDef> = {
184184
};
185185
};
186186

187-
export type ProcedureHooks<Schema extends SchemaDef> = Schema extends { procedures: Record<string, any> }
187+
export type ProcedureHooks<Schema extends SchemaDef> = Schema['procedures'] extends Record<string, any>
188188
? {
189189
/**
190190
* Custom procedures.
191191
*/
192192
$procs: ProcedureHookGroup<Schema>;
193193
}
194-
: {};
194+
: Record<never, never>;
195195

196196
// Note that we can potentially use TypeScript's mapped type to directly map from ORM contract, but that seems
197197
// to significantly slow down tsc performance ...

0 commit comments

Comments
 (0)