import { type ClientSchema } from '../../../zero-protocol/src/client-schema.ts'; import type { RelationshipsSchema, TableSchema } from '../table-schema.ts'; import type { Relationships } from './relationship-builder.ts'; import { type TableBuilderWithColumns } from './table-builder.ts'; export type Schema = { readonly tables: { readonly [table: string]: TableSchema; }; readonly relationships: { readonly [table: string]: RelationshipsSchema; }; /** * Enables legacy query support. * When this is true, old-style queries that do not require server side implementations will be enabled. * This will flip to false in the future and what we currently call "custom queries" will become "queries" and * the only option for reading data. * The default is true, but will flip to false in the future. */ readonly enableLegacyQueries?: boolean | undefined; /** * Enables legacy mutator support. * When this is true, old-style mutations that do not require server side implementations will be enabled. * This will flip to false in the future and what we currently call "custom mutations" will become "mutations" and * the only option for writing data. * The default is true, but will flip to false in the future. */ readonly enableLegacyMutators?: boolean | undefined; }; /** * Note: the keys of the `tables` and `relationships` parameters do not matter. * You can assign them to any value you like. E.g., * * ```ts * createSchema({rsdfgafg: table('users')...}, {sdfd: relationships(users, ...)}) * ``` */ export declare function createSchema[], const TRelationships extends readonly Relationships[], const TEnableLegacyQueries extends boolean | undefined, const TEnableLegacyMutators extends boolean | undefined>(options: { readonly tables: TTables; readonly relationships?: TRelationships | undefined; /** @see Schema.enableLegacyQueries */ readonly enableLegacyQueries?: TEnableLegacyQueries | undefined; /** @see Schema.enableLegacyMutators */ readonly enableLegacyMutators?: TEnableLegacyMutators | undefined; }): { tables: { readonly [K in TTables[number]['schema']['name']]: Extract; }; relationships: { readonly [K in TRelationships[number]['name']]: Extract['relationships']; }; enableLegacyQueries: TEnableLegacyQueries; enableLegacyMutators: TEnableLegacyMutators; }; export declare function clientSchemaFrom(schema: Schema): { clientSchema: ClientSchema; hash: string; }; //# sourceMappingURL=schema-builder.d.ts.map