import { Observable, Subject } from 'rxjs'; import { Parse } from './query'; export type LogIdx = number; export type PropertyId = string; export interface LogRecord { idx: LogIdx; log: any; index: LogRecord.Index; } export declare namespace LogRecord { interface Index { properties: Set; values: Map>; } function index(logValue: any, propertyPrefixes?: string[], idx?: Index): Index; } export interface LogValueMap { value: any; property: PropertyId; idx: LogIdx; } export interface Filter { match: Parse.Expression.MATCH[]; exclude: Parse.Expression.MATCH[]; } export declare namespace Fuzzysort { interface Result { readonly score: number; readonly target: string; readonly indexes: number[]; } } export interface LogIndex { propertyIndex: Map>; properties: PropertyId[]; valueIndex: Map>>; values: any[]; } export declare namespace LogIndex { function addLogRecord(record: LogRecord, logIndex: LogIndex): LogIndex; function addProperty(logIdx: LogIdx, property: PropertyId, logIndex: LogIndex): LogIndex; function addValue(logIdx: LogIdx, value: any, property: PropertyId, logIndex: LogIndex): LogIndex; function union(lhs: LogIndex, rhs: LogIndex): LogIndex; } export interface FilterMatch { record: LogRecord; matches: ResultSet.Match[]; resultSet: ResultSet; } export interface ResultSet { matches: ResultSet.MatchMap; index: LogIndex; } export declare namespace ResultSet { type MatchMap = Map; interface Match { logRecord: LogRecord; property?: { name: PropertyId; fuzzyResult: FuzzyResult; }; value?: { property: PropertyId; value: any; fuzzyResult: FuzzyResult; }; } interface FuzzyResult { indexes: number[]; score: number; } function addMatch(match: Match, resultSet: ResultSet, skipIndex?: boolean): ResultSet; function union(lhs: ResultSet, rhs: ResultSet): ResultSet; } export declare class LogDb { logs: LogRecord[]; logIndex: LogIndex; logSubject: Subject; constructor(); ingest(line: string, level?: string): LogRecord; matchLog(query: Parse.Expression, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; evaluateMatch(matchQuery: Parse.Expression.MATCH, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; matchFullOrProperty(matchQuery: Parse.Expression.MATCH.FULL_MATCH | Parse.Expression.MATCH.PROPERTY_MATCH, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; matchFullOrValue(matchQuery: Parse.Expression.MATCH.FULL_MATCH | Parse.Expression.MATCH.VALUE_MATCH, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; matchExcludeProperty(matchQuery: Parse.Expression.MATCH.PROPERTY_MATCH, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; matchExcludeValue(matchQuery: Parse.Expression.MATCH.VALUE_MATCH, record: LogRecord, fuzzysortThreshold: number): ResultSet.Match[]; filterAll(query: Parse.Expression, fuzzysortThreshold: number): Observable; } export declare function getProperty(obj: { [property: string]: any; }, property: PropertyId): any; //# sourceMappingURL=logdb.d.ts.map