import { XPEvent, XPEventType } from '../events'; import { FileNode } from '../types'; import { Action, Condition, FlagValue, Scalar, Scenario, Trigger } from './types'; export declare const all: (...cs: Condition[]) => Condition; export declare const any: (...cs: Condition[]) => Condition; export declare const not: (c: Condition) => Condition; export declare const flag: (name: string, cmp?: { eq?: FlagValue; gte?: number; lte?: number; }) => Condition; export declare const eventMatch: (match: Record) => Condition; export declare const happened: (type: XPEventType, match?: Record) => Condition; export declare const count: (type: XPEventType, cmp: { gte?: number; lte?: number; eq?: number; }, match?: Record) => Condition; export declare const exists: (path: string[]) => Condition; export declare const unlocked: (path: string[]) => Condition; export declare const contentContains: (path: string[], contains: string) => Condition; export declare const pinned: (itemId: string) => Condition; export declare const linked: (a: string, b: string) => Condition; export declare const searched: (term: string) => Condition; export declare const found: (resultId: string) => Condition; export declare const reportClaim: (reportId: string, claimId: string, result?: import('../apps/EvidenceReport/logic').ClaimResult) => Condition; export declare const setFlag: (name: string, value?: FlagValue) => Action; export declare const incFlag: (name: string, by?: number) => Action; export declare const unlock: (path: string[]) => Action; export declare const addFile: (path: string[], node?: Partial, contentKey?: string) => Action; export declare const removeFile: (path: string[]) => Action; export declare const writeFile: (path: string[], content: string) => Action; export declare const notify: (opts: { title?: string; titleKey?: string; body?: string; bodyKey?: string; icon?: string; timeout?: number; anchorId?: string; }) => Action; export declare const qqMessage: (buddyId: string, text: string) => Action; export declare const qqOnline: (buddyId: string) => Action; export declare const openApp: (appId: string, props?: Record) => Action; export declare const openFile: (path: string[]) => Action; export declare const playSound: (name: string) => Action; export declare const emit: (event: XPEvent) => Action; export declare const alert: (title: string, message: string) => Action; export declare const after: (delayMs: number, ...actions: Action[]) => Action; /** Parse a duration to milliseconds. Accepts a number (ms) or `'90s'`/`'10m'`/`'1h'`. */ export declare const ms: (spec: number | string) => number; /** A trigger under construction; commit it with `.do(...)`. */ declare class TriggerBuilder { private readonly parent; private readonly on; private readonly matchCond?; private whenCond?; private onceFlag; private maxN?; private triggerId?; constructor(parent: ScenarioBuilder, on: XPEventType | XPEventType[], matchCond?: Condition | undefined); when(c: Condition): this; once(): this; max(n: number): this; id(name: string): this; /** Commit the trigger with its action list and return the scenario for chaining. */ do(...actions: Action[]): ScenarioBuilder; } /** A scenario under construction. Call `.build()` for the Layer-1 {@link Scenario}. */ export declare class ScenarioBuilder { private readonly scenarioId; private readonly initial; private readonly triggers; constructor(scenarioId: string); /** Seed an initial flag value. */ initialFlag(name: string, value: FlagValue): this; /** * Begin a trigger. An optional `match` becomes an implicit `event` payload * condition ANDed with any `.when(...)`. */ on(on: XPEventType | XPEventType[], match?: Record): TriggerBuilder; /** @internal */ _push(trigger: Trigger): void; /** Compile to the Layer-1 Scenario JSON. */ build(): Scenario; } /** Start a fluent scenario definition (Layer 2). */ export declare const defineScenario: (id: string) => ScenarioBuilder; export {};