import type { UntypedSchemaDef } from '../lib/schema.ts'; import type { OutboxTable, ReadonlyTable, Table } from '../lib/table.ts'; import type { Values } from '../lib/type_util.ts'; /** * A type representing a read-only database view, mapping table names to their corresponding read-only Table handles. */ export type ReadonlyDbView = { readonly [Tbl in Values as Tbl['accessorName']]: ReadonlyTable; } & (SchemaDef extends { namespaces: infer NS extends Record; } ? { readonly [K in keyof NS]: ReadonlyDbView; } : {}); /** * A type representing the database view, mapping table names to their corresponding Table handles. * Only known outboxes use the insert-only API. Erased schema types retain the * existing Table API; runtime outbox handles still omit mutation methods. */ export type DbView = { readonly [Tbl in Values as Tbl['accessorName']]: boolean extends Tbl['isOutbox'] ? Table : Tbl extends { readonly isOutbox: true; } ? OutboxTable : Table; } & (SchemaDef extends { namespaces: infer NS extends Record; } ? { readonly [K in keyof NS]: DbView; } : {}); //# sourceMappingURL=db_view.d.ts.map