import { Editor, type FormulaEditorEvent } from './editor'; import type { DataModel, ViewModel } from '../../../treb-data-model/src/index'; import type { GridOptions } from '../types/grid_options'; import { Autocomplete } from './autocomplete'; export interface FormulaButtonEvent { type: 'formula-button'; formula?: string; cursor_position?: number; } export interface AddressLabelEvent { type: 'address-label-event'; text?: string; } export interface TollEvent { type: 'toll'; value?: string; } export interface ToggleReferenceEvent { type: 'toggle-reference'; } export type FormulaBar2Event = FormulaButtonEvent | AddressLabelEvent | TollEvent | ToggleReferenceEvent; export declare class FormulaBar extends Editor { private options; committed: boolean; tolled?: { text: string; substring: string; }; /** * if we're showing a spill array and it's not the first cell, show * the formula using a shadow style (and it's not editable). */ shadow_: boolean; get shadow(): boolean; set shadow(shadow: boolean); /** is the _editor_ currently focused */ focused_: boolean; /** accessor for focused field */ get focused(): boolean; /** address label (may also show other things... ?) */ private address_label_container; /** address label (may also show other things... ?) */ private address_label; /** the function button (optional?) */ private button; /** */ private expand_button; private label_update_timer; /** get formula text */ get formula(): string; /** set formula text */ set formula(text: string); /** get address label text */ get label(): string; /** * set address label text. if the label is too long for the box, * add a title attribute for a tooltip. */ set label(text: string); /** toggle editable property: supports locked cells */ set editable(editable: boolean); constructor(container: HTMLElement, model: DataModel, view: ViewModel, options: GridOptions, autocomplete: Autocomplete); /** * we might be overthinking this, we don't necessarily need to restore. * * this method will focus the editor and set the caret (to the end, atm) * in case of a tolled editor. the idea is you call Restore() after your * dialog is complete and it's like you are back where you started. * * alternatively, call `Release()` to clean up any saved state. */ Restore(): void; /** * release anything that's been tolled. call this if you toll the editor * but don't want to restore it when you are done. I think this will be * the default. */ Release(): void; IsElement(element: HTMLElement): boolean; IsExpandButton(element: HTMLElement): boolean; InitAddressLabel(): void; private GetTextContent; private FormulaKeyUp; private FormulaKeyDown; }