diff --git a/packages/db/src/core/types.ts b/packages/db/src/core/types.ts index 2645c56fe2..398373d121 100644 --- a/packages/db/src/core/types.ts +++ b/packages/db/src/core/types.ts @@ -218,15 +218,15 @@ export const collectionsSchema = z.preprocess((rawCollections) => { }, z.record(collectionSchema)); export type BooleanField = z.infer; -export type BooleanFieldInput = z.input['schema']; +export type BooleanFieldInput = z.input; export type NumberField = z.infer; -export type NumberFieldInput = z.input['schema']; +export type NumberFieldInput = z.input; export type TextField = z.infer; -export type TextFieldInput = z.input['schema']; +export type TextFieldInput = z.input; export type DateField = z.infer; -export type DateFieldInput = z.input['schema']; +export type DateFieldInput = z.input; export type JsonField = z.infer; -export type JsonFieldInput = z.input['schema']; +export type JsonFieldInput = z.input; export type FieldType = | BooleanField['type'] @@ -353,7 +353,6 @@ export function defineWritableCollection( export type AstroConfigWithDB = z.input; -type FieldOpts = Omit; // We cannot use `Omit`, // since Omit collapses our union type on primary key. type NumberFieldOpts = z.input; @@ -373,16 +372,16 @@ export const field = { number: (opts: T = {} as T) => { return createField('number', opts) satisfies { type: 'number' }; }, - boolean: >(opts: T = {} as T) => { + boolean: (opts: T = {} as T) => { return createField('boolean', opts) satisfies { type: 'boolean' }; }, text: (opts: T = {} as T) => { return createField('text', opts) satisfies { type: 'text' }; }, - date>(opts: T = {} as T) { + date(opts: T = {} as T) { return createField('date', opts) satisfies { type: 'date' }; }, - json>(opts: T = {} as T) { + json(opts: T = {} as T) { return createField('json', opts) satisfies { type: 'json' }; }, };