import { Connection } from 'sharedb/lib/client'; import type Agent = require('sharedb/lib/agent'); export { type Connection }; declare module './Model' { interface DocConstructor { new (any: unknown[]): DocConstructor; } interface Model { /** Returns a child model where ShareDB operations are always composed. */ allowCompose(): ChildModel; close(cb?: (err?: Error) => void): void; closePromised: () => Promise; disconnect(): void; /** * Returns a reference to the ShareDB agent if it is connected directly on the * server. Will return null if the ShareDB connection has been disconnected or * if we are not in the same process and we do not have a reference to the * server-side agent object */ getAgent(): Agent; hasPending(): boolean; hasWritePending(): boolean; /** Returns a child model where ShareDB operations are never composed. */ preventCompose(): ChildModel; reconnect(): void; /** * Calls the callback once all pending operations, fetches, and subscribes * have settled. */ whenNothingPending(cb: () => void): void; whenNothingPendingPromised(): Promise; _finishCreateConnection(): void; _getDocConstructor(name: string): any; _isLocal(name: string): boolean; } }