import type { SimpleModelSettings } from './types'; type RequiredFields = Fields[K] extends { optional: boolean; } ? never : K; type OptionalFields = Fields[K] extends { optional: boolean; } ? K : never; type SchemaType = { [K in keyof Fields as RequiredFields]: Fields[K] extends { nullable: boolean; } ? ReturnType | null : ReturnType; } & { [K in keyof Fields as OptionalFields]?: Fields[K] extends { nullable: boolean; } ? ReturnType | null : ReturnType; }; type IA = { [action: string]: (item: Type) => Partial; }; export default function defineModel>, const Singleton, const Includable, const ListMeta>({ schema, belongsTo, hasMany, itemActions, singleton, includable, listMeta, ...settings }: { schema: Schema; itemActions?: ItemActions; belongsTo?: BelongsTo; hasMany?: HasMany; singleton?: Singleton; includable?: Includable; listMeta?: ListMeta; } & SimpleModelSettings): { only?: import("./types").ActionName[]; plural?: string; path?: string; envelope?: boolean; pagination?: { type: "page" | "cursor"; defaultLimit: number; }; inverse?: { [local: string]: string | null; }; schema: Schema; hasMany: HasMany; belongsTo: BelongsTo; itemActions: ItemActions; types: SchemaType; singleton: Singleton; includable: Includable; listMeta: ListMeta; metaTypes: SchemaType; }; export {};