@ai2070/l0
Version:
L0: The Missing Reliability Substrate for AI
46 lines • 2.24 kB
TypeScript
import type { WindowOptions, DocumentWindow, DocumentChunk, WindowStats, WindowProcessResult, L0WindowOptions } from "./types/window";
import type { L0Options } from "./types/l0";
export declare class DocumentWindowImpl implements DocumentWindow {
readonly document: string;
readonly options: Required<WindowOptions>;
private chunks;
private _currentIndex;
constructor(document: string, options?: WindowOptions);
get totalChunks(): number;
get currentIndex(): number;
get(index: number): DocumentChunk | null;
current(): DocumentChunk | null;
next(): DocumentChunk | null;
prev(): DocumentChunk | null;
jump(index: number): DocumentChunk | null;
reset(): DocumentChunk | null;
getAllChunks(): DocumentChunk[];
getRange(start: number, end: number): DocumentChunk[];
hasNext(): boolean;
hasPrev(): boolean;
processAll(processFn: (chunk: DocumentChunk) => L0Options): Promise<WindowProcessResult[]>;
processSequential(processFn: (chunk: DocumentChunk) => L0Options): Promise<WindowProcessResult[]>;
processParallel(processFn: (chunk: DocumentChunk) => L0Options, options?: {
concurrency?: number;
}): Promise<WindowProcessResult[]>;
getStats(): WindowStats;
getContext(index: number, options?: {
before?: number;
after?: number;
}): string;
findChunks(searchText: string, caseSensitive?: boolean): DocumentChunk[];
getChunksInRange(startPos: number, endPos: number): DocumentChunk[];
}
export declare function createWindow(document: string, options?: WindowOptions): DocumentWindow;
export declare function processWithWindow(document: string, processFn: (chunk: DocumentChunk) => L0Options, options?: WindowOptions): Promise<WindowProcessResult[]>;
export declare function l0WithWindow(options: L0WindowOptions): Promise<import("./types/l0").L0Result<unknown>>;
export declare function mergeResults(results: WindowProcessResult[], separator?: string): string;
export declare function getProcessingStats(results: WindowProcessResult[]): {
total: number;
successful: number;
failed: number;
successRate: number;
avgDuration: number;
totalDuration: number;
};
//# sourceMappingURL=window.d.ts.map