import type { TypesaurusCore as Core } from "./core.js"; import type { TypesaurusUpdate as Update } from "./update.js"; export declare const batch: TypesaurusBatch.Function; export declare namespace TypesaurusBatch { interface Function { , Environment extends Core.RuntimeEnvironment, Props extends Core.DocProps & { environment: Environment; }>(db: DB, options?: Core.OperationOptions): RootDB; } type RootDB, Props extends Core.DocProps> = BatchDB & { (): Promise; }; type BatchDB, Props extends Core.DocProps> = { [Path in keyof DB]: DB[Path] extends Core.NestedCollection ? NestedCollection> : DB[Path] extends Core.Collection ? Collection : never; }; type AnyCollection = Collection | NestedCollection>; interface NestedCollection extends Collection { (id: Def["Id"]): NestedSchema; } /** * */ interface Collection extends Core.PlainCollection { /** The Firestore path */ path: string; set(id: Def["Id"], data: Core.AssignArg, Props>): void; upset(id: Def["Id"], data: Core.AssignArg, Props>): void; update(id: Def["Id"], data: Update.Arg): void; remove(id: Def["Id"]): void; } interface Schema { [CollectionPath: string]: AnyCollection; } }