import type { UntypedRemoteModule } from './spacetime_module.ts'; import type { ClientTable } from './client_table.ts'; import type { NestAccessors } from '../lib/type_util.ts'; /** * A type representing a client-side database view, mapping table names to their corresponding client Table handles. */ type IfAny = 0 extends 1 & T ? Y : N; type ClientDbViewLoose = { readonly [k: string]: any }; export type ClientDbView = IfAny< RemoteModule, ClientDbViewLoose, NestAccessors<{ readonly [Key in keyof RemoteModule['tables']]: ClientTable< RemoteModule, RemoteModule['tables'][Key]['accessorName'] >; }> >;