26 lines
782 B
TypeScript
26 lines
782 B
TypeScript
import { Thread } from '../types';
|
|
import { DatabaseManager } from './db';
|
|
export declare class ThreadsDAO {
|
|
private dbManager;
|
|
constructor(dbManager: DatabaseManager);
|
|
private get db();
|
|
create(input: Partial<Thread>): Thread;
|
|
findById(id: string): Thread | null;
|
|
findAll(options?: {
|
|
limit?: number;
|
|
offset?: number;
|
|
sortBy?: 'updatedAt' | 'createdAt' | 'messageCount';
|
|
order?: 'asc' | 'desc';
|
|
tags?: string[];
|
|
}): {
|
|
threads: Thread[];
|
|
total: number;
|
|
};
|
|
update(id: string, updates: Partial<Thread>): Thread | null;
|
|
delete(id: string): boolean;
|
|
setActive(id: string): boolean;
|
|
getActive(): Thread | null;
|
|
findByPrefix(prefix: string): Thread[];
|
|
private mapRowToThread;
|
|
}
|