import { EmbeddedSpreadsheet } from '../embedded-spreadsheet'; import type { EmbeddedSpreadsheetOptions } from '../options'; import { type Color } from '../../../treb-base-types/src/index'; import { DOMContext } from '../../../treb-base-types/src/index'; /** @internal */ export declare class SpreadsheetConstructor { /** container, if any */ root?: HTMLElement; /** spreadsheet instance */ sheet?: EmbeddedSpreadsheet; /** current border color. will be applied to new borders. */ protected border_color?: Color; /** color bar elements, since we update them frequently */ protected color_bar_elements: Record; /** some menu buttons change icons from time to time */ protected replace_targets: Record; /** root layout element */ protected layout_element?: HTMLElement; /** views container */ protected views?: HTMLElement; /** * handle to the revert button, so we can adjust it. we can use * container classes for the most part but we are updating the title. * (FIXME: double-up the button, no reference required) */ protected revert_button?: HTMLElement; protected revert_state: boolean; /** cached controls */ protected toolbar_controls: Record; /** swatch lists in color chooser */ protected swatch_lists: { theme?: HTMLDivElement; other?: HTMLDivElement; }; protected DOM: DOMContext; constructor(root?: HTMLElement | string); /** * coerce an attribute value into a more useful type. for attributes, * having no value implies "true". false should be explicitly set as * "false"; we don't, atm, support falsy values like '0' (that would be * coerced to a number). */ CoerceAttributeValue(value: string | null): number | boolean | string; /** * get options from node attributes. we're still working on final * semantics but at the moment we'll translate hyphen-separated-options * to our standard snake_case_options. * * we also support the old-style data-options * * @returns */ ParseOptionAttributes(): Partial; /** * attach content to element. for custom elements, this is called via * the connectedCallback call. for elements created with the API, we * call it immediately. */ AttachElement(options?: EmbeddedSpreadsheetOptions): void; CreateLayout(sheet: EmbeddedSpreadsheet, root: HTMLElement): void; ToggleToolbar(): void; UpdateSelectionStyle(sheet: EmbeddedSpreadsheet, toolbar: HTMLElement, comment_box: HTMLTextAreaElement): void; UpdateDocumentStyles(sheet: EmbeddedSpreadsheet, format_menu: HTMLElement): void; /** * setting explicit state on the revert button (if enabled). * * @param sheet */ UpdateRevertState(sheet: EmbeddedSpreadsheet): void; /** * replace a given template with its contents. */ ReplaceTemplate(root: HTMLElement, selector: string, remove?: boolean): void; AttachToolbar(sheet: EmbeddedSpreadsheet, root: HTMLElement): void; }