Open History to see the last commit
1import type { ApiModel } from '#/server/catalog.ts'
2
3/** Plain JSON — what server functions may return to loaders. */
4export type Json =
5 | string
6 | number
7 | boolean
8 | null
9 | { [key: string]: Json }
10 | Array<Json>
11
12/**
13 * ApiModel with its `unknown` JSON columns (drizzle json mode) narrowed so
14 * TanStack's server-fn serializability check accepts it. The values really
15 * are plain JSON — they come out of D1 text columns.
16 */
17export type SerializableModel = Omit<
18 ApiModel,
19 | 'modalities'
20 | 'pricing'
21 | 'providerMetadata'
22 | 'reasoning'
23 | 'serverTools'
24 | 'requestMap'
25 | '_links'
26> & {
27 modalities: Json
28 pricing: Json
29 providerMetadata: Json
30 reasoning: Json
31 serverTools: Json
32 requestMap: Json
33 _links: Json
34}