import { type Applog, ApplogForInsert, CidString } from '../applog/datom-types.ts'; import { Thread } from './basic.ts'; export declare abstract class WriteableThread extends Thread { constructor(name: string, applogs: Applog[], filters: readonly string[]); purge(cidsToPurge: CidString[]): number; insert(appLogsToInsert: ApplogForInsert[]): Applog[]; /** * Insert only applogs not already in this thread. * @param byRef If true, compares by reference; if false, compares by CID (default) * @returns The applogs that were actually inserted */ insertMissing(appLogsToInsert: readonly Applog[], byRef?: boolean): Applog[]; /** * Insert raw applogs directly into the thread. * * STRICT VALIDATION: This method throws errors for: * - Duplicate applogs in input array (programming error) * - Invalid applogs (missing required fields) * - Applogs already in thread (programming error) * * For external imports where duplicates are expected, use removeDuplicateAppLogs(..., 'cleanup') * before calling this method. * * @param appLogsToInsert Must be deduplicated and validated. Needs to be mutable because it will be sorted * (and if you need to clone it, so do it when you need to) - this is weird as TS is slathering type safety onto ducks * @throws Error if validation fails */ insertRaw(appLogsToInsert: Applog[]): Applog[]; get readOnly(): boolean; protected abstract persist(logs: Applog[]): Promise; } export declare class ThreadInMemory extends WriteableThread { readonly _readOnly: boolean; static empty(name?: string): ThreadInMemory; static fromArray(applogs: Applog[], name?: string, readOnly?: boolean): ThreadInMemory; static fromReadOnlyArray(applogs: readonly Applog[], name?: string): ThreadInMemory; constructor(name: string, applogs: Applog[], filters: readonly string[], _readOnly: boolean); get readOnly(): boolean; protected persist(logs: Applog[]): Promise; } //# sourceMappingURL=writeable.d.ts.map