import type { JsonValue } from 'type-fest'; import { type OscillateClock } from './ExpressionFunctions.js'; import type { SomeExpressionNode } from './ExpressionParse.js'; /** Properties that must never be accessed or written via MemberExpression to prevent prototype pollution */ export declare const BANNED_PROPS: Set; export declare const DEFAULT_MAX_OPERATIONS = 50000; export declare const DEFAULT_MAX_CALL_DEPTH = 250; export interface ResolveExpressionOptions { /** The value to substitute when a variable is undefined */ unknownVariableValue: JsonValue | undefined; /** Function to retrieve the value of a companion variable */ getVariableValue: (variableIdOrLabel: string, nameOrUndefined?: string) => JsonValue | undefined; /** * Function to parse and interpolate variables in a string * eg: `$(ab:cd) = $(ab:cd)` => `1 = 1` */ parseVariables: ((input: string) => string) | null; /** * Implements `blink()`: return whether the blink is currently in its "on" state. Both arguments are * validated before they get here - `intervalMs` is a number no smaller than `MIN_CLOCK_PERIOD_MS`, * and `dutyCycle` is a number in 0-1 (defaulting to `BLINK_DEFAULT_DUTY_CYCLE`) - so a host never * sees whatever the expression happened to pass. * * Omit to leave `blink()` unsupported. */ blink?: (intervalMs: number, dutyCycle: number) => boolean; /** * Provides the clock for `oscillate()`: where the host currently is within the cycle, and how finely * it can tell. The `phase` argument and the waveform shaping are applied on top of it, so a host does * not implement the waveforms itself. * * Omit to leave `oscillate()` unsupported. */ oscillate?: OscillateClock; /** Maximum number of loop iterations + function calls before aborting (default DEFAULT_MAX_OPERATIONS) */ maxOperations?: number; /** Maximum closure call-stack depth before aborting (default DEFAULT_MAX_CALL_DEPTH) */ maxCallDepth?: number; /** * Controls how the `+` operator treats its operands. * - `false` (default): always coerce both operands to numbers (the Companion behaviour, * so `'a' + 1` is `NaN`). * - `true`: prefer numeric addition, but fall back to string concatenation when the numeric result * would be `NaN` (so `'a' + 1` is `'a1'`, while `'1' + '2'` still resolves to `3`). */ stringConcatenation?: boolean; /** * Controls how escape sequences in template literal string parts are handled. * - `false` (default): the raw source text is used verbatim, so `` `a\nb` `` keeps the literal * backslash-n (the original Companion behaviour). Safe for strings such as Windows paths. * - `true`: escape sequences are processed (the "cooked" value), so `` `a\nb` `` contains a real * newline, matching standard JavaScript template literals. */ processTemplateEscapes?: boolean; /** * The effective timezone for date/time functions when no explicit `tz` argument is given. * Either an IANA timezone name (undefined/empty uses the process-local timezone), or a getter that * returns it. A getter is called each time a date function falls back to the default, which lets * Companion register a dependency on the active timezone so expressions re-evaluate when it changes. */ defaultTimezone?: string | (() => string | undefined); } export declare function ResolveExpression(node: SomeExpressionNode, options: ResolveExpressionOptions): JsonValue | undefined; //# sourceMappingURL=ExpressionResolve.d.ts.map