import * as _angular_core from '@angular/core'; import { AfterViewInit, OnDestroy, TemplateRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { CdkDragStart, CdkDragDrop } from '@angular/cdk/drag-drop'; import { Observable } from 'rxjs'; import * as _masterteam_components_formula from '@masterteam/components/formula'; import { FormulaRuntimeMessageCode, FormulaRuntimeMessage, FormulaConditionConfig, FormulaValidationRuleConfig } from '@masterteam/components'; export { FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity } from '@masterteam/components'; /** * Flat Formula Token Model * * The formula is represented as a FLAT array of tokens. * This approach provides: * - Better performance (no deep component nesting) * - Solid drag-drop behavior (functions move as complete units) * - Simple serialization (just join token values) * * STRUCTURE RULES: * - fn-open: "IF(" - function name + opening paren as ONE token * - fn-close: ")" - closing paren, belongs to a function * - fn-separator: "," - argument separator, belongs to a function * - Dragging any structural token moves the ENTIRE function * - Content tokens (property, operator, literal) can move individually */ /** Token types */ type TokenType = 'fn-open' | 'fn-close' | 'fn-separator' | 'property' | 'operator' | 'literal' | 'text'; /** What happens when this token is dragged */ type DragBehavior = 'function' | 'single'; /** * Formula Token - a single element in the flat formula array */ interface FormulaToken { id: string; type: TokenType; value: string; display?: string; functionId?: string; depth: number; argIndex?: number; dragBehavior: DragBehavior; functionName?: string; propertyType?: 'current' | 'children' | 'parent'; literalType?: 'string' | 'number' | 'boolean'; } /** * Function structure info - tracks open/close pairs */ interface FunctionInfo { id: string; name: string; openIndex: number; closeIndex: number; argCount: number; depth: number; } /** Generate unique token ID */ declare function generateTokenId(): string; /** Generate unique function ID */ declare function generateFunctionId(): string; /** Parse function signature like "SUM(values)" or "IF(cond, a, b)" */ declare function parseSignature(signature: string): { name: string; args: string[]; }; /** * Create a function's tokens from signature * e.g., "IF(condition, trueVal, falseVal)" creates: * - fn-open: "IF(" * - fn-separator: "," (x2) * - fn-close: ")" */ declare function createFunctionTokens(signature: string, depth?: number): FormulaToken[]; /** * Create a property token */ declare function createPropertyToken(propertyKey: string, propertyType?: 'current' | 'children' | 'parent', depth?: number, functionId?: string, argIndex?: number, display?: string): FormulaToken; /** * Create an operator token */ declare function createOperatorToken(symbol: string, depth?: number, functionId?: string, argIndex?: number): FormulaToken; /** * Create a literal token */ declare function createLiteralToken(value: string | number | boolean, depth?: number, functionId?: string, argIndex?: number, display?: string): FormulaToken; /** * Create a raw text token for identifiers or syntax fragments that are not * properties, literals, or operators. */ declare function createTextToken(value: string, depth?: number, functionId?: string, argIndex?: number): FormulaToken; /** * Find the complete range of a function in the token array * This includes ALL tokens between fn-open and fn-close (including nested content) * Returns [startIndex, endIndex] inclusive */ declare function findFunctionRange(tokens: FormulaToken[], functionId: string): [number, number] | null; /** * Get all tokens belonging to a function (including nested content) */ declare function getFunctionTokens(tokens: FormulaToken[], functionId: string): FormulaToken[]; /** * Validate if a drop position is allowed */ declare function isValidDropPosition(tokens: FormulaToken[], dropIndex: number, draggedTokens: FormulaToken[]): boolean; /** * Serialize tokens to the canonical, executable formula string. * Uses each token's `value` (e.g. `@Current::startdate`) — never `display` — * so the produced expression is stable and engine/back-end compatible. */ declare function serializeTokens(tokens: FormulaToken[]): string; /** * Serialize tokens to a human-readable preview string using each token's * `display` label (the friendly property name) when present, falling back to * its `value`. Spacing is computed from the canonical `value`/`type` so that a * friendly name containing spaces (e.g. "Start Date") does not corrupt * function/paren/separator spacing. This output is for display/preview ONLY * (e.g. `formulaText`) — never feed it to the validator or persist it as the * executable expression. */ declare function serializeTokensForDisplay(tokens: FormulaToken[]): string; declare function shouldInsertSpace(previousType: TokenType | null, previousValue: string, current: FormulaToken): boolean; /** * Clone a token with new ID */ declare function cloneToken(token: FormulaToken): FormulaToken; /** * Clone multiple tokens with new IDs and new function IDs */ declare function cloneTokens(tokens: FormulaToken[]): FormulaToken[]; /** * Update depth for all tokens (after move) */ declare function recalculateDepths(tokens: FormulaToken[]): FormulaToken[]; /** * Convert a backend template or insertText into builder tokens while * preserving the authored syntax as closely as the flat token model allows. */ declare function tokenizeFormulaTemplate(template: string): FormulaToken[]; /** * Find which argument index a position belongs to within a function */ declare function getArgumentIndexAtPosition(tokens: FormulaToken[], functionId: string, position: number): number; /** * Smart Formula Block - Types and Factory Functions * Defines the block structure and creation helpers */ /** Block type */ type BlockType = 'function' | 'property' | 'operator' | 'literal'; /** Argument slot for functions */ interface ArgumentSlot { id: string; name: string; blocks: SmartBlock[]; placeholder?: string; } /** Smart block structure */ interface SmartBlock { id: string; type: BlockType; value: string; display?: string; functionName?: string; signature?: string; insertText?: string; cursorOffset?: number; arguments?: ArgumentSlot[]; propertyType?: 'current' | 'children' | 'parent'; propertyKey?: string; operatorSymbol?: string; literalValue?: string | number | boolean; } /** Generate unique block ID */ declare function generateSmartBlockId(): string; /** Create a function block from signature */ declare function createFunctionBlock(signature: string, name?: string, insertText?: string, cursorOffset?: number): SmartBlock; /** Create a property block */ declare function createPropertyBlock(propertyKey: string, propertyType?: 'current' | 'children' | 'parent', display?: string): SmartBlock; /** Create an operator block */ declare function createOperatorBlock(symbol: string): SmartBlock; /** Create a literal block */ declare function createLiteralBlock(value: string | number | boolean, display?: string): SmartBlock; /** Deep clone a block with new IDs */ declare function cloneBlock(block: SmartBlock): SmartBlock; /** * Validation Result Models * API response types for formula validation */ /** Validation error/warning severity */ type ValidationSeverity = 'Error' | 'Warning'; /** Validation error or warning */ interface ValidationError { message: string; line: number; column: number; severity: ValidationSeverity; } /** Validation warning (same structure as error) */ type ValidationWarning = ValidationError; /** Complete validation result from API */ interface ValidationResult { isValid: boolean; errors: ValidationError[]; warnings: ValidationWarning[]; dependencies: string[]; complexity: number; /** Type the backend inferred for the formula, e.g. `Number`, `Text`. */ returnType?: string; } /** Validation request payload */ interface ValidationRequest { formula: string; knownProperties?: string[]; levelSchemaId?: number; moduleId?: number; templateId?: number; /** Property view type the result must fit, e.g. `Number`, `Date`. */ expectedType?: string; } /** Autocomplete suggestion */ interface AutocompleteSuggestion { text: string; displayText: string; type: 'Function' | 'Property' | 'Operator' | 'Context' | 'Keyword'; description: string; insertText: string; category?: string; cursorOffset?: number; } /** Autocomplete context */ interface AutocompleteContext { type: 'None' | 'Function' | 'Property' | 'Operator'; scope: string; prefix: string; scopeToken?: string | null; scopeParameter?: string | null; parameterKind?: string | null; tablePath?: string | null; } /** Autocomplete response from API */ interface AutocompleteResponse { suggestions: AutocompleteSuggestion[]; context: AutocompleteContext; } /** Autocomplete request payload */ interface AutocompleteRequest { formula: string; cursorPosition: number; knownProperties?: string[]; levelSchemaId?: number; moduleId?: number; contextEntityTypeKey?: string; } /** API error response */ interface ApiErrorResponse { error: string; message?: string; } /** * Formula Block Model - Types for formula functions and operators */ /** Function category types */ type FunctionCategory = 'Math' | 'Aggregation' | 'Logic' | 'Hierarchy' | 'Date' | 'String' | 'PhaseGate' | any; /** Parameter definition for a function */ interface ParameterDefinition { name: string; type: string; description: string; required: boolean; defaultValue?: unknown; } interface FunctionExample { code: string; description?: string; } /** Function definition */ interface FunctionDefinition { name: string; category: FunctionCategory; description: string; signature: string; parameters?: ParameterDefinition[]; returnType?: string; examples?: Array; template?: string; templateCursorOffset?: number; hints?: string[]; isDeprecated?: boolean; } /** Function category group */ interface FunctionCategoryGroup { name: FunctionCategory; displayName?: string; description?: string; icon?: string; functions: FunctionDefinition[]; } /** Operator definition */ interface OperatorDefinition { symbol: string; name: string; /** * 'grouping' covers the syntax pieces the toolbar also has to offer — the * parens that override precedence and the comma that separates arguments. */ type: 'arithmetic' | 'comparison' | 'logical' | 'grouping'; description: string; precedence: number; } declare class FormulaEditor implements ControlValueAccessor { readonly placeholder: _angular_core.InputSignal; readonly initialTokens: _angular_core.InputSignal; readonly disabled: _angular_core.InputSignal; readonly borderless: _angular_core.InputSignal; readonly formulaChange: _angular_core.OutputEmitterRef; readonly tokensChange: _angular_core.OutputEmitterRef; readonly onBlur: _angular_core.OutputEmitterRef; readonly onFocus: _angular_core.OutputEmitterRef; readonly tokens: _angular_core.WritableSignal; /** Index range being dragged [start, end] inclusive */ private draggedRange; /** Is currently dragging */ readonly isDragging: _angular_core.WritableSignal; /** Hovered function ID for highlighting */ readonly hoveredFunctionId: _angular_core.WritableSignal; /** Is focused */ readonly isFocused: _angular_core.WritableSignal; private onChange; private onTouched; readonly containerClasses: _angular_core.Signal<"flex min-h-20 font-mono text-sm bg-white dark:bg-surface-800" | "flex min-h-20 font-mono text-sm bg-white dark:bg-surface-800 border border-surface-200 dark:border-surface-700 rounded-md focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/10">; readonly lineNumberClasses: _angular_core.Signal<"flex flex-col px-1.5 py-2 bg-surface-50 dark:bg-surface-900 border-r border-surface-200 dark:border-surface-700 select-none min-w-6 text-right" | "flex flex-col px-1.5 py-2 bg-surface-50 dark:bg-surface-900 border-r border-surface-200 dark:border-surface-700 select-none min-w-6 text-right rounded-l-md">; /** Line numbers based on token count */ readonly lines: _angular_core.Signal; /** Serialized formula string */ readonly formulaString: _angular_core.Signal; constructor(); writeValue(value: FormulaToken[] | null): void; registerOnChange(fn: (value: FormulaToken[]) => void): void; registerOnTouched(fn: () => void): void; /** * Add a block from toolbar (converts SmartBlock to tokens) */ addBlock(block: SmartBlock): void; /** * Add tokens directly */ addTokens(newTokens: FormulaToken[]): void; /** * Clear all tokens */ clear(): void; /** * Get current formula string */ serialize(): string; /** * Get current tokens */ getTokens(): FormulaToken[]; handleFocus(): void; handleBlur(): void; /** * Handle drag start - determine what tokens to drag */ onDragStart(event: CdkDragStart, token: FormulaToken, index: number): void; /** * Handle drop - reorder tokens in the formula */ onDrop(event: CdkDragDrop): void; /** * Reset drag state */ private resetDragState; /** * Handle drag end * NOTE: CDK fires cdkDragEnded BEFORE cdkDropListDropped * So we don't reset draggedRange here - onDrop handles it */ onDragEnd(): void; /** * Remove a token or function */ removeToken(token: FormulaToken, index: number): void; onTokenHover(token: FormulaToken): void; onTokenLeave(): void; /** * Check if token should be highlighted * Only structural tokens (fn-open, fn-close, fn-separator) get highlighted * Content tokens (property, operator, literal) inside function are NOT highlighted */ isHighlighted(token: FormulaToken): boolean; /** Base token classes */ private readonly baseTokenClasses; /** * Get Tailwind classes for a token */ getTokenClasses(token: FormulaToken): string; /** * Convert SmartBlock to FormulaTokens */ private smartBlockToTokens; private emit; /** * Track function for ngFor */ trackByToken(_index: number, token: FormulaToken): string; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type AutocompleteProvider = (request: AutocompleteRequest) => AutocompleteResponse | Promise | Observable | null; declare class FormulaEditorCode implements ControlValueAccessor, AfterViewInit, OnDestroy { readonly placeholder: _angular_core.InputSignal; readonly initialFormula: _angular_core.InputSignal; readonly disabled: _angular_core.InputSignal; readonly language: _angular_core.InputSignal; readonly theme: _angular_core.InputSignal<"vs" | "vs-dark" | "hc-black" | "formula-light" | "formula-dark">; readonly borderless: _angular_core.InputSignal; readonly autocompleteProvider: _angular_core.InputSignal; readonly autocompleteDebounceMs: _angular_core.InputSignal; readonly formulaChange: _angular_core.OutputEmitterRef; readonly onBlur: _angular_core.OutputEmitterRef; readonly onFocus: _angular_core.OutputEmitterRef; private readonly editorHost; private readonly zone; private readonly document; private readonly loader; private destroyed; readonly loadState: _angular_core.WritableSignal<"error" | "loading" | "ready">; private readonly controlDisabled; readonly isDisabled: _angular_core.Signal; private monaco; private editor; private model; private readonly disposables; private resizeObserver; private completionProvider; private readonly autocompleteSubject; private autocompleteSubscription; private readonly cancelAutocomplete$; private currentAutocompleteRequestId; private static formulaAssetsReady; private static monacoStylesReady; readonly value: _angular_core.WritableSignal; readonly isFocused: _angular_core.WritableSignal; readonly showPlaceholder: _angular_core.Signal; readonly containerClasses: _angular_core.Signal<"relative flex min-h-20 flex-col bg-white dark:bg-surface-800 font-mono text-sm" | "relative flex min-h-20 flex-col bg-white dark:bg-surface-800 font-mono text-sm rounded-md border border-surface-200 dark:border-surface-700 focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/10">; private hasWrittenValue; private isApplyingExternalValue; private onChange; private onTouched; constructor(); ngAfterViewInit(): void; ngOnDestroy(): void; private disposeEditor; writeValue(value: string | null): void; registerOnChange(fn: (value: string) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(disabled: boolean): void; retryLoadEditor(): void; addBlock(block: SmartBlock): void; insertText(text: string, cursorOffset?: number): void; clear(): void; getValue(): string; private initEditor; private ensureMonacoStylesLoaded; private ensureFormulaAssets; private attachEditorListeners; private setupResizeObserver; private scheduleAutocomplete; private setupAutocompleteStream; private registerCompletionProvider; private resolveAutocompleteResponse; private applyCursorOffset; private getCompletionRanges; private mapSuggestionKind; private syncEditorValue; private smartBlockToText; private formatLiteral; private emitValue; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type ToolbarTab = 'functions' | 'properties' | 'operators'; interface FormulaToolbarPropertiesContext { insertBlock: (block: SmartBlock) => void; } interface FormulaToolbarPropertyItem { key: string; name?: string; description?: string; /** * Marks a property whose comparison values come from a real source (a * lookup, a lookup matrix, a status set) instead of being typed by hand. * The toolbar renders a values toggle on such chips and asks the host for * the items through `onPropertyValuesRequest`. */ hasValues?: boolean; } /** * One selectable value of a value-backed property. `key` is what the formula * stores and what the engine compares against; `name` is only the label shown * on the chip. */ interface FormulaToolbarValueItem { key: string; name: string; /** * How `key` has to serialize. `'number'` emits an unquoted number literal — * required by sources that compare against a numeric id (phase values), where * a quoted id evaluates true in the client engine and false on the server. * Defaults to `'string'`, which every other source compares as. */ valueType?: 'string' | 'number'; } interface OperatorGroup { type: string; operators: OperatorDefinition[]; } declare class FormulaToolbar { private readonly transloco; /** Known properties to show in properties tab */ readonly knownProperties: _angular_core.InputSignal; /** Custom properties template */ readonly propertiesTemplate: _angular_core.InputSignal | null>; /** Projected properties template */ readonly projectedPropertiesTemplate: _angular_core.Signal | undefined>; /** * Values of value-backed properties, keyed by property key. Supplied by the * host (usually lazily, in response to `onPropertyValuesRequest`); a key * present here — even with an empty array — counts as loaded. */ readonly propertyValues: _angular_core.InputSignal>; /** Property key whose values are currently being fetched by the host. */ readonly loadingValuesFor: _angular_core.InputSignal; /** Function categories (from API or static data) */ readonly functionCategories: _angular_core.InputSignal; /** Operators list (overridable) */ readonly operators: _angular_core.InputSignal; /** Initial active tab */ readonly initialTab: _angular_core.InputSignal; /** Tabs visible in the toolbar */ readonly visibleTabs: _angular_core.InputSignal; /** Placeholder for search input */ readonly searchPlaceholder: _angular_core.InputSignal; /** Labels */ readonly labels: _angular_core.InputSignal<{ functions?: string; properties?: string; operators?: string; noFunctionsFound?: string; noPropertiesAvailable?: string; noOperatorsFound?: string; values?: string; noValuesAvailable?: string; }>; /** Insert event - emits SmartBlock for the editor */ readonly onBlockInsert: _angular_core.OutputEmitterRef; /** Tab change event */ readonly onTabChange: _angular_core.OutputEmitterRef; /** * A value-backed property was expanded and its values are not in * `propertyValues` yet — the host should fetch them for this key. */ readonly onPropertyValuesRequest: _angular_core.OutputEmitterRef; /** Active tab */ readonly activeTab: _angular_core.WritableSignal; /** Tab options */ readonly tabOptions: _angular_core.Signal<{ label: string; value: ToolbarTab; }[]>; /** Tabs actually rendered */ readonly resolvedTabOptions: _angular_core.Signal<{ label: string; value: ToolbarTab; }[]>; /** Context for custom properties template */ protected readonly propertiesTemplateContext: FormulaToolbarPropertiesContext; /** Resolve properties template (projected first, input fallback) */ readonly resolvedPropertiesTemplate: _angular_core.Signal | null>; /** Property key whose value list is currently expanded, if any. */ readonly expandedPropertyKey: _angular_core.WritableSignal; /** Search query */ readonly searchQuery: _angular_core.WritableSignal; /** Custom value input */ readonly customValue: _angular_core.WritableSignal; /** Detected type of custom value */ readonly customValueType: _angular_core.Signal<"string" | "number" | "boolean" | "text">; /** Preview of custom value */ readonly customValuePreview: _angular_core.Signal; /** CSS class for custom value type */ readonly customValueTypeClass: _angular_core.Signal<"bg-violet-100 text-violet-700 hover:bg-violet-200 dark:bg-violet-900/30 dark:text-violet-300 dark:hover:bg-violet-900/50" | "bg-rose-100 text-rose-700 hover:bg-rose-200 dark:bg-rose-900/30 dark:text-rose-300 dark:hover:bg-rose-900/50" | "bg-emerald-100 text-emerald-700 hover:bg-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-300 dark:hover:bg-emerald-900/50" | "bg-slate-100 text-slate-700 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-300 dark:hover:bg-slate-600">; constructor(); /** Filtered categories based on search */ readonly filteredCategories: _angular_core.Signal<{ functions: _masterteam_components_formula.FunctionDefinition[]; name: _masterteam_components_formula.FunctionCategory; displayName?: string; description?: string; icon?: string; }[]>; /** Property items normalized from legacy string keys or keyed descriptors */ readonly propertyItems: _angular_core.Signal; /** * Scope hint per property key, present **only** where a display name is * shared by more than one property. Two chips both reading "Status" are * otherwise indistinguishable before clicking one; a name that is already * unique gets no badge, so the common case stays uncluttered. * * Computed over every property, not the filtered list — a search that hides * one of a colliding pair must not make the survivor lose its badge and * appear unambiguous. */ readonly propertyQualifiers: _angular_core.Signal>; /** Scope badge for a property, or '' when its name is already unique. */ qualifierFor(propertyKey: string): string; /** Filtered properties based on search */ readonly filteredProperties: _angular_core.Signal; /** * The expanded property, but only while it survives the current search — * filtering it away collapses the panel without touching the stored key. */ readonly expandedProperty: _angular_core.Signal; /** Values of the expanded property, or an empty list while none is open. */ readonly expandedPropertyValues: _angular_core.Signal; /** True while the expanded property's values are still being fetched. */ readonly isLoadingExpandedValues: _angular_core.Signal; /** * True when the expanded property finished loading and genuinely has no * values — distinct from "still loading", so the empty note does not flash. */ readonly hasNoExpandedValues: _angular_core.Signal; /** Operators translated through the active locale */ private readonly translatedOperators; /** Filtered operators based on search */ readonly filteredOperators: _angular_core.Signal; /** Count of filtered items per tab */ readonly filteredFunctionsCount: _angular_core.Signal; readonly filteredPropertiesCount: _angular_core.Signal; readonly filteredOperatorsCount: _angular_core.Signal; /** Smart search effect - switches to tab with results */ private readonly smartSearchEffect; /** Group operators by type */ readonly operatorGroups: _angular_core.Signal; /** Translate an operator group header, falling back to a capitalized label */ operatorTypeLabel(type: string): string; /** * Resolve a function category header. * The backend already returns a localized `displayName`, so we render it * verbatim instead of re-translating on the client (which only covered a * subset of categories and left newer ones like "Task Baseline" untranslated). */ categoryLabel(category: FunctionCategoryGroup): string; /** Total item count for current tab */ readonly itemCount: _angular_core.Signal; readonly labelFunctions: _angular_core.Signal; readonly labelProperties: _angular_core.Signal; readonly labelOperators: _angular_core.Signal; readonly labelNoFunctions: _angular_core.Signal; readonly labelNoProperties: _angular_core.Signal; readonly labelNoOperators: _angular_core.Signal; readonly labelValues: _angular_core.Signal; readonly labelNoValues: _angular_core.Signal; /** Get count for a specific tab (filtered when searching) */ getTabCount(tab: ToolbarTab): number; /** Check if a tab has results when searching */ tabHasResults(tab: ToolbarTab): boolean; /** Set active tab */ setActiveTab(tab: ToolbarTab): void; /** Emit block insert event */ insertBlock(block: SmartBlock): void; /** Clear search */ clearSearch(): void; /** * Open (or close) the value list of a value-backed property, asking the host * to load the items the first time that key is opened. */ togglePropertyValues(property: FormulaToolbarPropertyItem): void; /** Whether a property's value list is the one currently expanded. */ isPropertyExpanded(propertyKey: string): boolean; /** * Insert a picked value as a literal. The item's `key` is what gets stored * and compared; the name rides along as the chip's display label only. * * A numeric item serializes as a number literal rather than a quoted string — * `createLiteralBlock` keeps the JS type on `literalValue`, which is what the * editor reads to stamp `literalType`. Never infer this from the key looking * numeric: lookup keys fall back to the item id and still compare as strings. */ insertPropertyValue(item: FormulaToolbarValueItem): void; /** Insert custom value */ insertCustomValue(): void; /** Clear custom value input */ clearCustomValue(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare const OPERATOR_SYMBOL_TO_TRANSLATION_KEY: Record; declare const DEFAULT_OPERATORS: OperatorDefinition[]; type ToolbarItemType = 'function' | 'property' | 'operator'; interface ExampleItem { code: string; description?: string; } declare class FormulaToolbarItem { /** Item type */ readonly type: _angular_core.InputSignal; /** Item value (function name, property key, operator symbol) */ readonly value: _angular_core.InputSignal; /** Display value (optional, defaults to value) */ readonly display: _angular_core.InputSignal; /** Description for tooltip */ readonly description: _angular_core.InputSignal; /** Function signature (for functions only, e.g., "SUM(values)") */ readonly signature: _angular_core.InputSignal; /** Function examples (for functions only) - can be strings or objects with code/description */ readonly examples: _angular_core.InputSignal<(string | FunctionExample | ExampleItem)[]>; /** Backend template to insert (preferred over signature) */ readonly template: _angular_core.InputSignal; /** Cursor offset relative to inserted template */ readonly templateCursorOffset: _angular_core.InputSignal; /** Function hints from backend documentation */ readonly hints: _angular_core.InputSignal; /** Function return type */ readonly returnType: _angular_core.InputSignal; /** Function parameters */ readonly parameters: _angular_core.InputSignal; /** Normalized description */ readonly normalizedDescription: _angular_core.Signal; /** Normalized signature */ readonly normalizedSignature: _angular_core.Signal; /** Normalized template */ readonly normalizedTemplate: _angular_core.Signal; /** Normalized return type */ readonly normalizedReturnType: _angular_core.Signal; /** Normalized examples as ExampleItem[] */ readonly normalizedExamples: _angular_core.Signal; /** Normalized hints */ readonly normalizedHints: _angular_core.Signal; /** Normalized parameters */ readonly normalizedParameters: _angular_core.Signal<{ name: string; type: string; description: string; required: boolean; defaultValue?: unknown; }[]>; /** Property type for properties */ readonly propertyType: _angular_core.InputSignal<"current" | "children" | "parent">; /** Insert event - emits SmartBlock */ readonly onInsert: _angular_core.OutputEmitterRef; /** Computed display value */ readonly displayValue: _angular_core.Signal; /** Whether function metadata should use the rich tooltip template */ readonly hasRichTooltip: _angular_core.Signal; /** Keep lightweight tooltip behavior only for small descriptions */ readonly simpleTooltip: _angular_core.Signal; /** Show insert template when it adds useful information beyond the signature */ readonly shouldShowTemplate: _angular_core.Signal; /** PrimeNG tooltip class to widen rich tooltip content */ readonly tooltipStyleClass: _angular_core.Signal<"mt-formula-toolbar-item-tooltip mt-formula-toolbar-item-tooltip-rich" | "mt-formula-toolbar-item-tooltip">; /** Build SmartBlock from item data */ readonly smartBlock: _angular_core.Signal; /** Item CSS class based on type */ readonly itemClass: _angular_core.Signal<"bg-slate-200 text-slate-700 hover:bg-slate-300 dark:bg-slate-700 dark:text-slate-300 dark:hover:bg-slate-600" | "bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:hover:bg-amber-900/50" | "bg-sky-100 text-sky-700 hover:bg-sky-200 dark:bg-sky-900/30 dark:text-sky-300 dark:hover:bg-sky-900/50" | "bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-300">; /** Handle click - emit the SmartBlock */ handleClick(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class FormulaStatusBar { /** Validation result */ readonly validation: _angular_core.InputSignal; /** Labels for i18n support */ readonly labels: _angular_core.InputSignal<{ valid?: string; invalid?: string; complexity?: string; dependencies?: string; }>; /** Is formula valid */ readonly isValid: _angular_core.Signal; /** Complexity score */ readonly complexity: _angular_core.Signal; /** Dependencies list */ readonly dependencies: _angular_core.Signal; /** Dependencies as text */ readonly dependenciesText: _angular_core.Signal; /** First error */ readonly firstError: _angular_core.Signal<_masterteam_components_formula.ValidationError | null>; /** Complexity CSS class */ readonly complexityClass: _angular_core.Signal<"text-emerald-600 dark:text-emerald-400" | "text-amber-600 dark:text-amber-400" | "text-rose-600 dark:text-rose-400">; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type FormulaRuntimeDomain = 'condition' | 'validation'; type FormulaRuntimeEngineErrorCode = Extract; interface FormulaRuntimeEngineError { code: FormulaRuntimeEngineErrorCode; message: string; } interface FormulaEvaluationContext { values: Record; } interface FormulaConditionEvaluation { hidden?: boolean; disabled?: boolean; dependencies: string[]; errors: FormulaRuntimeEngineError[]; } interface FormulaValidationEvaluation { valid: boolean; dependencies: string[]; errors: FormulaRuntimeEngineError[]; } interface FormulaValidationRulesEvaluation { errors: FormulaRuntimeMessage[]; warnings: FormulaRuntimeMessage[]; } interface FormulaRuntimeCatalog { domain: FormulaRuntimeDomain; functions: FunctionCategoryGroup[]; operators: OperatorDefinition[]; } declare const CONDITION_FUNCTION_CATEGORIES: FunctionCategoryGroup[]; declare const CONDITION_OPERATORS: OperatorDefinition[]; declare const VALIDATION_FUNCTION_CATEGORIES: FunctionCategoryGroup[]; declare const VALIDATION_OPERATORS: OperatorDefinition[]; declare const CONDITION_RUNTIME_CATALOG: FormulaRuntimeCatalog; declare const VALIDATION_RUNTIME_CATALOG: FormulaRuntimeCatalog; type RuntimeFunction = (...args: any[]) => any; declare class FormulaRuntimeEngine { private readonly compiledCache; private readonly functionRegistry; constructor(customFunctions?: Record); evaluateCondition(config: FormulaConditionConfig, context: FormulaEvaluationContext): FormulaConditionEvaluation; evaluateValidation(rule: FormulaValidationRuleConfig, context: FormulaEvaluationContext): FormulaValidationEvaluation; evaluateValidationRules(rules: FormulaValidationRuleConfig[], context: FormulaEvaluationContext, options?: { isDependencyActive?: (dependency: string) => boolean; }): FormulaValidationRulesEvaluation; extractDependencies(formulaTokens: string): string[]; private resolveConditionAction; private getCompiledFormula; private deserializeFormulaTokens; private toLexTokens; private evaluateAst; } export { CONDITION_FUNCTION_CATEGORIES, CONDITION_OPERATORS, CONDITION_RUNTIME_CATALOG, DEFAULT_OPERATORS, FormulaEditor, FormulaEditorCode, FormulaRuntimeEngine, FormulaStatusBar, FormulaToolbar, FormulaToolbarItem, OPERATOR_SYMBOL_TO_TRANSLATION_KEY, VALIDATION_FUNCTION_CATEGORIES, VALIDATION_OPERATORS, VALIDATION_RUNTIME_CATALOG, cloneBlock, cloneToken, cloneTokens, createFunctionBlock, createFunctionTokens, createLiteralBlock, createLiteralToken, createOperatorBlock, createOperatorToken, createPropertyBlock, createPropertyToken, createTextToken, findFunctionRange, generateFunctionId, generateSmartBlockId, generateTokenId, getArgumentIndexAtPosition, getFunctionTokens, isValidDropPosition, parseSignature, recalculateDepths, serializeTokens, serializeTokensForDisplay, shouldInsertSpace, tokenizeFormulaTemplate }; export type { ApiErrorResponse, ArgumentSlot, AutocompleteContext, AutocompleteRequest, AutocompleteResponse, AutocompleteSuggestion, BlockType, DragBehavior, ExampleItem, FormulaConditionEvaluation, FormulaEvaluationContext, FormulaRuntimeCatalog, FormulaRuntimeDomain, FormulaRuntimeEngineError, FormulaRuntimeEngineErrorCode, FormulaToken, FormulaToolbarPropertiesContext, FormulaToolbarPropertyItem, FormulaToolbarValueItem, FormulaValidationEvaluation, FormulaValidationRulesEvaluation, FunctionCategory, FunctionCategoryGroup, FunctionDefinition, FunctionExample, FunctionInfo, OperatorDefinition, ParameterDefinition, SmartBlock, TokenType, ToolbarItemType, ToolbarTab, ValidationError, ValidationRequest, ValidationResult, ValidationSeverity, ValidationWarning };