TomTom Maps for JavaScript
    Preparing search index...

    Type Alias EventRule

    An event rule is a natural-language condition plus its rising-edge state. The compiled code lives on the event rule's Job, not here. affectedDatasetIds are the datasets the rule watches, and a verdict's members are the ones that matched.

    type EventRule = {
        affectedDatasetIds: readonly string[];
        condition: string;
        enabled: boolean;
        id: string;
        inactiveSince?: number;
        name: string;
        openedAt?: number;
        resolveAfterMs?: number;
        wasActive: boolean;
    }
    Index
    affectedDatasetIds: readonly string[]

    The ids of every dataset the rule reads, the per-dataset lookup key (EventsState.rulesForDataset).

    condition: string

    Natural-language condition (LLM-readable). The compiled code lives on the event rule's job.

    enabled: boolean
    id: string
    inactiveSince?: number

    The sample time the verdict of the open episode turned inactive, while it waits out resolveAfterMs.

    name: string
    openedAt?: number

    Rising-edge time of the current open episode, if active.

    resolveAfterMs?: number

    How long, in milliseconds of source-data time, the verdict must stay inactive before the rule resolves, such as 180_000 for a feed that refreshes every minute and flickers. Unset, the first inactive verdict resolves it.

    An active verdict meanwhile keeps the open episode, with no new opened. The rule resolves at the first recompute after the hold, so one whose datasets stop changing stays open.

    wasActive: boolean

    Whether an episode is open: set by an active verdict, cleared when the rule resolves.