import { BehaviorSubject } from 'rxjs'; import { Binding } from '@microsoft/fast-element'; import { CaptureType } from '@microsoft/fast-element'; import { ComposableStyles } from '@microsoft/fast-element'; import { Constructable } from '@microsoft/fast-element'; import { Controller } from '@microsoft/fast-element'; import { CSSDesignToken } from '@microsoft/fast-foundation'; import { DesignSystem } from '@microsoft/fast-foundation'; import { ElementStyles } from '@microsoft/fast-element'; import { FASTElement } from '@microsoft/fast-element'; import { InterfaceSymbol } from '@microsoft/fast-foundation'; import type { JSONSchema7 } from 'json-schema'; import { Logger as Logger_2 } from '@genesislcap/foundation-logger'; import { LoggerOptions as LoggerOptions_2 } from '@genesislcap/foundation-logger'; import { LogLevel } from '@genesislcap/foundation-logger'; import { Observable } from 'rxjs'; import { SyntheticViewTemplate } from '@microsoft/fast-element'; import { Types } from '@genesislcap/expression-builder'; import type { ValueConverter } from '@microsoft/fast-element'; /** * @public */ export declare let ACCEPT_TERMS_URL: string; /** * A design token that represents the active color scheme (light or dark). * @public */ export declare const activeColorScheme: CSSDesignToken; /** * The Genesis Server URL (WebSocket or HTTP). * @remarks Optional. * @defaultValue `${PROTOCOL}//${location.host}/${_SOCKET_EXT}/` * @example ws://localhost/gwf/, ws://localhost:9064 * @public */ export declare let API_HOST: string; /** * assureDesignSystem. * * @remarks * Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case * of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system. * * @example * ```ts * async function zeroDesignSystemImport(): Promise { * let module: DesignSystemModule; * let type: ResourceType = ResourceType.remote; * try { * module = await import('foundationZero/ZeroDesignSystem'); * return assureDesignSystem(module); * } catch (e) { * logger.info( * `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`, * ); * type = ResourceType.local; * module = await import('@genesislcap/foundation-zero'); * return assureDesignSystem(module); * } finally { * logger.debug(`Using '${type}' version of foundation-zero`); * } * } * ``` * * @example You should also instruct webpack to use strict module handling. * ```ts * output: { * strictModuleErrorHandling: true, * strictModuleExceptionHandling: true, * } * ``` * * @public */ export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule; /** * Explicitly prevents tree-shaking of custom element classes by referencing them. * * Bundlers may incorrectly remove code that it thinks has no side effects, * such as custom element definitions that are only referenced in templates. * By passing these classes to `avoidTreeShaking`, we create a side effect * that signals to the bundler to preserve the code. * * @param classes - One or more custom element classes that should not be tree-shaken. * @public */ export declare const avoidTreeShaking: (...classes: unknown[]) => void; /** * Base selectors treated as editable context regardless of design system. * Includes native controls, contenteditable, and ARIA-editable roles. */ export declare const BASE_EDITABLE_ELEMENT_SELECTORS: readonly ["input", "textarea", "select", "[contenteditable=\"true\"]", "[contenteditable=\"\"]", "[role=\"textbox\"]", "[role=\"searchbox\"]", "[role=\"combobox\"]"]; /** * @internal */ export declare const BIG_INT_64_BITS = 64; export declare function buildEditableElementSelector(designSystems: readonly EditableDesignSystemPrefix[], customEditableSelectors?: readonly string[]): string; /** * The builder aka file bundler. * @privateRemarks * Provided by default as part of the `resolveDefineConfig` in the build kit. * @example 'webpack', 'vite'. * @defaultValue `'webpack'` * @public */ export declare let BUILDER: string; /** * @public */ export declare let CHANGE_PASSWORD_URL: string; /** * @public */ export declare type ConstructableLifecycleHandler = Constructable; /** * A mixin that provides functionality for raising `pending-state` events. * @public */ export declare type ConstructablePendingState = Constructable; declare type Container = FoundationLayoutContainer | LayoutCacheContainer | DOMContainer; /** * Represents the possible types of value conversion for data synchronization. * @public */ export declare type ConversionType = 'string' | 'number' | 'time' | 'boolean'; /** * A factory to create the error map. * @param logger - A logger error method reference. * @returns A ErrorMap instance. * * @public */ export declare const createErrorMap: (logger: ErrorMapLogger) => ErrorMap; /** * Creates a logger with the given name and options. * @param name - The name to give the logger. * @param options - The options to use when creating the logger. * @returns The resulting logger. * * @deprecated - Use `createLogger` from `@genesislcap/foundation-logger` instead. * @public */ export declare function createLogger(name: string, options?: LoggerOptions): Logger; /** * Creates a new event observer instance. * @public */ export declare const createObserver: () => Observer; /** * A Default Number Parser for deserializing objects. * @public */ export declare function customNumberParser(value: any): number | bigint; /** * Represents a database with basic CRUD operations. * @public */ export declare interface Database { isWorking: boolean; create(newValue: Omit): Promise>; read(id: string): Promise>; update(id: string, newValue: Omit, 'id'>): Promise>; delete(id: string): Promise; visit(visitor: (record: T) => void): Promise; onBeforeUpdate(listener: Listener>): () => void; onAfterUpdate(listener: Listener>): () => void; } /** * Namespace for database access result types. * @public */ export declare namespace DatabaseAccessResult { export interface Access { value: T; } export interface Create extends Access { } export interface Read extends Access { } export interface Update extends Access { } export interface Delete { id: string; success: boolean; } {}; } /** * Namespace for database events. * @public */ export declare namespace DatabaseEvent { export interface Update { value: T; } export interface BeforeUpdate extends Update { newValue: T; } export interface AfterUpdate extends Update { } {}; } /** * Represents a database record. * @public */ export declare interface DatabaseRecord { id: string; } /** * Decodes a value from base64. * @public * @param value - The value to decode from base64. * @returns The decoded value. */ export declare const decodeFromBase64: (base64Value: string) => string | ArrayBuffer; /** * Decodes a value from base64 with a prefix. * @remarks Prefixes are: 'str:' for string and 'bin:' for ArrayBuffer. * @public * @param value - The value to decode from base64. * @returns The decoded value. */ export declare const decodeFromBase64WithPrefix: (value: string) => string | ArrayBuffer; /** * Deep merges two objects, with source values taking precedence over target values. * Arrays are replaced (not merged), and null/undefined values in source are preserved. * * @param target - The target object to merge into (defaults/base values) * @param source - The source object to merge from (overrides) * @returns A new merged object with source values taking precedence * @public * @example * ```ts * const defaults = { a: 1, b: { c: 2, d: 3 } }; * const overrides = { b: { c: 4 } }; * const merged = deepMerge(defaults, overrides); * // Result: { a: 1, b: { c: 4, d: 3 } } * ``` */ export declare const deepMerge: >(target: T, source: Partial) => T; /** * The default Organisation value, used in auth/login flow [`genesislcap-foundation-login`](https://link-to-docs). * @remarks Optional. * @public */ export declare let DEFAULT_ORGANISATION: string; /** * The default Password value, used in auth/login flow [`genesislcap-foundation-login`](https://link-to-docs). * @remarks Optional. * @public */ export declare let DEFAULT_PASSWORD: string; /** * The default Username value, used in auth/login flow [`genesislcap-foundation-login`](https://link-to-docs). * @remarks Optional. * @public */ export declare let DEFAULT_USER: string; /** * @public */ export declare class DefaultErrorMap implements ErrorMap { private logger; private map; /** {@inheritDoc ErrorMap.lastError} */ lastError: Error; /** * @param logger - A logger error method reference. */ constructor(logger: ErrorMapLogger); /** {@inheritDoc ErrorMap.set} */ set(key: keyof TErrorDetailMap, error: Error): void; /** * Get an error by key. * @param key - The key. * @returns The error if it exists, otherwise undefined. * * @public */ get(key: keyof TErrorDetailMap): Error | undefined; /** * Has an error for key. * @param key - The key. * @returns True if it exists, otherwise false. * * @public */ has(key: keyof TErrorDetailMap): boolean; /** * Delete an error. * @param key - The key. * @returns True if successful, otherwise false. * * @public */ delete(key: keyof TErrorDetailMap): boolean; /** * Clear errors. * @public */ clear(): void; /** * The size of the error map. * @returns number * * @public */ get size(): number; /** * @public */ values(): MapIterator; /** {@inheritDoc ErrorMap.messages} */ get messages(): string; } /** * A map that associates specific HTML element tags with their corresponding default event names. * @public */ export declare const defaultEventMap: Map; /** * A Default JSONSerializer Config for serializing and deserializing functions. * @public */ export declare const defaultJSONSerializerConfig: JSONSerializerConfig; /** * The default logger options. * @public */ export declare const defaultLoggerOptions: LoggerOptions; /** * The default `ServerRowDTOMapper`. * @public */ export declare class DefaultServerRowDTOMapper implements ServerRowDTOMapper { /** * Converts a server row DTO to an entity. * @param dto - The DTO to convert. * @returns The resulting entity. * @public */ fromDTO: (dto: ServerRowDTO) => ServerRowEntity; /** * Converts a server row entity to a DTO. * @param entity - The entity to convert. * @returns The resulting DTO. * @public */ toDTO: (entity: ServerRowEntity) => ServerRowDTO; } /** * Default implementation of the ShortcutManager interface * @public */ export declare class DefaultShortcutManager implements ShortcutManager { private shortcuts; private shortcutLookup; private keyCombinationMap; private _isPausedSubject; private _activeContext; private executionGuards; private editableContextConfig; private editableSelector; private blockedMessageConfig; get isPaused(): boolean; get isPaused$(): Observable; get isPausedSubject(): BehaviorSubject; registerShortcuts(shortcuts: ShortcutDefinition[]): void; registerShortcut(shortcut: ShortcutDefinition): ShortcutRegistrationResult; unregisterShortcut(context: string, id: string): void; unregisterShortcutsByContext(context: string): void; executeShortcut(id: string, eventTarget?: EventTarget | null): void; private shouldEmitBlockedEvent; private resolveBlockedMessage; executeShortcutByContext(context: string, id: string, eventTarget?: EventTarget | null): void; getShortcuts(): ShortcutDefinition[]; getShortcutsByContext(context: string): ShortcutDefinition[]; findShortcutByKeyCombination(key: string, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, metaKey?: boolean): ShortcutDefinition | undefined; getContexts(): string[]; getShortcutsByContextMap(): Map>; registerContext(context: string): void; setActiveContext(context: string): void; getActiveContext(): string | undefined; clearActiveContext(): void; registerExecutionGuard(id: string, guard: () => ShortcutExecutionStatus | boolean): void; unregisterExecutionGuard(id: string): void; clearExecutionGuards(): void; configureEditableContext(config?: ShortcutEditableContextConfig): void; getEditableContextConfig(): Required; getEditableSelector(): string; configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void; getBlockedMessages(): Required; pause(): void; resume(): void; /** * Normalizes a shortcut definition to handle option/alt equivalence * If optionKey is set, altKey will also be set to true (and vice versa) */ private normalizeShortcutDefinition; private createKeyCombinationKey; private isElementFocused; private getExecutionStatus; private getExecutionGuardStatus; private refreshEditableSelector; } /** * Delay for a given number of milliseconds * @param ms - The number of milliseconds to delay * @returns A promise that resolves after the given number of milliseconds * @public * @example * ```ts * await delay(1000); * console.log('1 second later'); * ``` */ export declare const delay: (ms: number) => Promise; /** * Design-system specific editable host selectors. */ export declare const DESIGN_SYSTEM_EDITABLE_ELEMENT_SELECTORS: Record; /** * DesignSystemModule. * @public */ export declare interface DesignSystemModule { provideDesignSystem(element?: HTMLElement, prefix?: string): DesignSystem | Pick; [key: string]: any; } /** * DesignSystemResource. * @public */ export declare type DesignSystemResource = Promise; /** * Signifies the element is placed on the DOM, not inside any dynamic layout components * @internal */ export declare type DOMContainer = { _key: 'dom'; }; /** * @public */ export declare interface DTOMapper { fromArgs?: (...args: any[]) => TEntity; fromDTO: (dto: TDTO) => TEntity; toDTO: (entity: Partial) => TDTO; } export declare type EditableDesignSystemPrefix = 'rapid' | 'zero'; export declare function emitShortcutBlockedEvent(detail: Omit & { blockedMessage?: ShortcutBlockedMessage; }, target?: EventTarget | null): void; /** * Encodes the given value to base64. * @public * @param value - The value to encode to base64. * @returns The base64 encoded value. */ export declare const encodeToBase64: (value: string | ArrayBuffer) => string; /** * Encodes the given value with a prefix to base64. * @remarks Prefixes are: 'str:' for string and 'bin:' for ArrayBuffer. * @public * @param value - The value to encode to base64. * @returns The base64 encoded value with a prefix. */ export declare const encodeToBase64WithPrefix: (value: string | ArrayBuffer) => string; /** * @public */ export declare let ENVIRONMENT_LEVEL: string; /** * @public */ export declare type ErrorDetailMap = Record; /** * @public */ export declare interface ErrorMap extends Pick, 'get' | 'has' | 'delete' | 'clear' | 'size' | 'values'> { /** * Error map as messages. * @returns string * * @public */ readonly messages: string; /** * Set an error by key. * @param key - The key. * @param error - The error. * * @public */ set(key: keyof TErrorDetailMap, error: Error): void; /** * The last set error if any. * @returns Error * * @public */ readonly lastError: Error; } /** * @public */ export declare type ErrorMapLogger = (...args: any[]) => void; declare type EventListener_2 = (data: T) => void; /** * Represents the possible event names for data synchronization. * @public */ export declare type EventName = 'input' | 'change' | 'default'; /** * An enum of possible font styles. * @public */ export declare enum FontStyle { Italic = "italic", Normal = "normal" } /** * An enum of possible font weights. * @public */ export declare enum FontWeight { Thin = 100, Light = 300, Regular = 400, Medium = 500, Bold = 700, Black = 900 } /** * The path to a JSON config file for the HTTP mode. * @remarks Optional. * @public */ export declare let FORCE_HTTP: string; /** * @public */ export declare let FORGOT_PASSWORD_URL: string; /** * Formats [DATE] UNIX Timestamps (without time) to readable strings * @public */ export declare function formatDateTimestamp(timestamp: number): string; /** * Formats [DATETIME] UNIX Timestamps (with time) to readable strings * @public */ export declare function formatDateTimeTimestamp(timestamp: number): string; /** * Formats [DATETIME] UNIX Timestamps (with time and milliseconds) to readable strings * @public */ export declare function formatDateTimeTimestampWithMilliseconds(timestamp: number): string; /** * Formats [DATE|DATETIME] Unix Timestamps to readable strings * @public * @param timestamp - The UNIX Timestamp. * @param withTime - The flag to determine if formatted value should contain 'time' info. */ export declare function formatTimestamp(timestamp: number, withTime: boolean): string; /** * Minimum interface to interact with FoundationLayout * without importing it as a dependency of `@genesislcap/foundation-utils` * @internal */ export declare type FoundationLayoutContainer = { dragging: boolean; hasFirstLoaded: boolean; lifecycleUpdateToken: string | undefined; _key: 'foundation-layout'; }; /** * A custom element that listens for keyboard shortcuts. * @public * @remarks Part of the ShortcutManager Service. */ export declare class FoundationShortcutListener extends FASTElement { shortcutManager: ShortcutManager; private keyListener; private isListening; connectedCallback(): void; disconnectedCallback(): void; private addKeyListener; private removeKeyListener; private handleKeyDown; private extractKeyFromCode; private getDeepActiveElement; private getEventElement; private isEditableContext; private isInputElement; } /** @public */ export declare namespace Genesis { const genesisFieldTypes: readonly ["STRING", "ENUM", "INT", "SHORT", "DOUBLE", "LONG", "BOOLEAN", "BIGDECIMAL", "DATE", "DATETIME", "RAW", "NANO_TIMESTAMP"]; export type GenesisFieldTypes = (typeof genesisFieldTypes)[number]; export type JSONSchema7 = JSONSchema7 & { properties?: { [key: string]: JSONSchema7 & { genesisType: GenesisFieldTypes; }; } | undefined; }; export type FieldJsonSchema = JSONSchema7['properties'][string]; } /** * Genesis Socket URL * @remarks * Built from the current {@link https://developer.mozilla.org/en-US/docs/Web/API/Location} object and {@link SOCKET_EXT | socket extension}. * @example * ```ts * await this.connect.connect(GENESIS_SOCKET_URL); // < wss://localhost:6060/gwf/ * ``` * @public */ export declare const GENESIS_SOCKET_URL: string; /** * Recursively gather all elements including those in shadow DOM * @public */ export declare function getAllElements(root: Element | Document): Element[]; /** * Get the current design system provider element and prefix by checking available providers. * If no provider is found, falls back to the provided prefix. * @param element - The starting HTML element * @param fallbackPrefix - The prefix to fallback to if the provider is not available * @returns An object containing the current design system provider element and prefix * * @example * ```ts * const { element: providerElement, prefix } = getCurrentDesignSystem(myElement, 'default-prefix'); * logger.debug(prefix); // e.g., 'rapid' or 'default-prefix' * logger.debug(providerElement); // The provider element or null * ``` * @public */ export declare function getCurrentDesignSystem(element: HTMLElement, fallbackPrefix: string): { element: HTMLElement | null; prefix: string; }; /** * Get the current design system prefix by checking available providers. * If no provider is found, falls back to the provided prefix. * @param element - The starting HTML element * @param fallbackPrefix - The prefix to fallback to if the provider is not available * @returns The current design system prefix * * @example * ```ts * const prefix = getCurrentDesignSystemPrefix(myElement, 'default-prefix'); * logger.debug(prefix); // e.g., 'rapid' or 'default-prefix' * ``` * @public */ export declare function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string; /** * @public */ export declare function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string; /** * Generates a CSS mixin for the specified font family, style, and weight. * @param family - The font family. * @param style - Optional. The font style. Defaults to FontStyle.Normal. * @param weight - Optional. The font weight. Defaults to FontWeight.Regular. * @returns The generated CSS mixin. * @public */ export declare const getFontMixin: (family: string, style?: FontStyle, weight?: FontWeight) => string; /** * @public */ export declare function getNumberFormatter(format: string, locale?: string | null): (params: any) => any; /** * Configuration settings for HTTP, used in http connect flow [`genesislcap-foundation-comms.HttpConnectConfig`](https://link-to-docs). * @remarks Optional. * @public */ export declare let HTTP_CONFIG: string; export declare interface InactivityConfig { timeoutMinutes: number; warningMinutes: number; } export declare class InactivityDialog extends FASTElement { isVisible: boolean; remainingSeconds: number; private onContinue?; private onLogout?; private countdownInterval?; private startTime; private totalSeconds; configure(options: InactivityDialogOptions): void; show(): boolean; hide(): boolean; private startCountdown; private stopCountdown; handleContinue(): void; handleLogout(): void; disconnectedCallback(): void; } export declare interface InactivityDialogOptions { remainingSeconds: number; onContinue: () => void; onLogout: () => void; } export declare interface InactivityEvents { 'inactivity-warning': { remainingSeconds: number; }; 'inactivity-timeout': void; 'inactivity-reset': void; } export declare class InactivityManager { private service; private dialog; private config; private isDialogVisible; constructor(config: InactivityManagerConfig); private setupEventListeners; private showWarningDialog; private hideWarningDialog; private handleContinue; private handleLogout; private handleTimeout; start(): void; stop(): void; reset(): void; destroy(): void; getService(): InactivityService; isWarningVisible(): boolean; } export declare interface InactivityManagerConfig extends InactivityConfig { onLogout: () => void; } export declare class InactivityService { private config; private warningId; private timeoutId; private lastActivity; private isActive; private eventListeners; constructor(config: InactivityConfig); private setupActivityListeners; private checkTimeout; on(event: K, listener: EventListener_2): void; off(event: K, listener: EventListener_2): void; private emit; start(): void; stop(): void; resetTimer(): void; private scheduleTimers; private clearTimers; destroy(): void; } /** * Returns a boolean value indicating whether the current window is inside an iframe. * @returns true if the window is inside an iframe, false otherwise. * @public */ export declare const inIFrame: () => boolean; /** * An in memory database of specific DatabaseRecord types. * @public */ export declare class InMemoryDatabase implements Database { private uuid; isWorking: boolean; private records; private beforeUpdateListeners; private afterUpdateListeners; constructor(uuid: UUID); create(newValue: Omit): Promise>; read(id: string): Promise>; update(id: string, newValue: Omit, 'id'>): Promise>; delete(id: string): Promise; visit(visitor: (record: T) => void): Promise; onBeforeUpdate(listener: Listener>): () => void; onAfterUpdate(listener: Listener>): () => void; } /** * Inserts a CSS rule into the document by creating a new style element or using an existing one with the specified ID. * Returns a function that can be called to remove the rule from the document. * @public * @param cssRule - The CSS rule to insert. * @param styleElementId - The ID of the style element to use or create. * @returns A function that removes the rule from the document. */ export declare const insertDocumentCSSRule: (cssRule: string, styleElementId: string) => (() => void); /** * Inserts a CSS link into the document if it doesn't already exist. * @public * @param href - The URL of the CSS file to insert. */ export declare const insertDocumentLink: (href: string) => void; /** * Returns a boolean value indicating whether the user is running the Symphony desktop app. * @returns true if the user is running the Symphony desktop app, false otherwise. * @public */ export declare const inSymphonyDesktop: () => boolean; /** * Determines if the current environment is a development environment. * @public */ export declare const isDev: () => boolean; export declare const isFeatureActivated: (feature: string) => boolean; /** * JSON replacer function. * @param key - The object key. * @param value - The key value. * @returns The resulting value. * @public */ export declare function JSONReplacer(key: string, value: any): any; /** * JSON reviver function. * @param key - The object key. * @param value - The key value. * @returns The resulting value. * @public */ export declare function JSONReviver(key: string, value: any): any; /** * An interface representing a JSON serializer. * @public */ export declare interface JSONSerializer { /** * Serializes an object to a JSON string. * @param object - The object to serialize. * @returns The serialized JSON string. */ serialize(object: any): string; /** * Deserializes a response object from a HTTP request to a JavaScript object. * @param response - The HTTP response object. * @returns A promise that resolves to the deserialized JavaScript object. */ deserialize(response: Response): Promise; /** * Deserializes a message event object to a JavaScript object. * @param event - The message event object. * @returns The deserialized JavaScript object. */ deserialize(event: MessageEvent): T; /** * Deserializes a JSON string to a JavaScript object. * @param text - The JSON string to deserialize. * @returns The deserialized JavaScript object. */ deserialize(text: string): T; } /** * A DI token for the JSON serializer. * @public */ export declare const JSONSerializer: InterfaceSymbol; /** * Configuration options for the JSONSerializer Config instance. * @public */ export declare interface JSONSerializerConfig { parse(text: string, reviver?: (this: any, key: string, value: any) => any): any; parse(text: string, reviver?: (this: any, key: string, value: any) => any, parseNumber?: any): any; stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; } /** * Configuration options for the JSONSerializer Config instance. * @internal */ export declare const JSONSerializerConfig: InterfaceSymbol; /** * Signifies the internal document fragment that stores the master copy * of the layout item, not part of the DOM. * @internal */ export declare type LayoutCacheContainer = { _key: 'foundation-layout-cache'; }; /** * Stored on the layout's internal cache to signify that the document is not part of the DOM * @public */ export declare const layoutCacheDocument: unique symbol; /** * @beta * Mixin class to expose `shouldRunConnect` and `shouldRunDisconnect` * * @remarks These can be used to control what lifecycle functionality is ran when the elements * are part of a custom layout. The class itself handles all events * @privateRemarks * #_ syntax is used for a javascript private method/variable * we can't use private/protected from typescript in an anonymous class like this */ export declare const LifecycleMixin: (Base: T) => { new (...args: any[]): { /** @internal **/ #_container: Container; /** * If the token changes we suggest blocking the lifecycle methods * @internal **/ #_latestTokenCode: string; /** * Track first loaded to allow us to always run the connect lifecycle on the first load * @internal **/ #_hasFirstLoaded: boolean; /** * When you request to delete an item from the layout it will be removed from the DOM, * but the lifecycle might be blocked due to the same mechanism that we block the other * items. * This would block cleanup of the item, so we need to force a disconnection after a timeout * if this item hasn't reconnected within `CLEANUP_TIMEOUT_MS`. * @internal **/ #_cleanupTimeout: NodeJS.Timeout; /** * Used to force lifecycle to run even if the token has changed, such as in instances where * we are forcing a disconnection due to this item being remove from the layout. * @internal **/ #_shouldForceLifecycle: boolean; /** * @privateRemarks * Rather than using the basic implementation of cloning we run a copy constructor (deepClone) * and then manually clone the children too so they can intercept with an overriden cloneNode * if they want to */ cloneNode(deep?: boolean): Node; /** * @privateRemarks * Basic implementation of a copy constructor which creates a new element of the same class * and copies all attributes over. * None-trivial elements will likely want to override this function, call it using super.deepClone(), * and then perform extra setup such as copying properties, setting up event listeners */ deepClone(): Node; /** * @beta * @returns - boolean controlling whether to run all disconnectedCallback lifecycle functionality */ get shouldRunDisconnect(): boolean; /** * @beta * @returns - boolean controlling whether to run all connectedCallback lifecycle functionality * @privateRemarks * For now its just the same logic as shouldRunDisconnect */ get shouldRunConnect(): boolean; #_blockLifecycleDueToTokenChange(lifecycleType: Lifecycletype): boolean; /** * @internal * Recursive function to try and find containing layout object * * @returns the layout object casted to the {@link @genesislcap/foundation-utils#FoundationLayoutContainer} interface if we are in a * layout object, {@link @genesislcap/foundation-utils#LayoutCacheContainer} if the element is in the layout cache, else {@link @genesislcap/foundation-utils#DOMContainer}. */ #_tryFindContainingLayout(e: Element): Container; connectedCallback(): void; readonly $fastController: Controller; $emit(type: string, detail?: any, options?: Omit): boolean | void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string, newValue: string): void; accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; autocorrect: boolean; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; readonly offsetLeft: number; readonly offsetParent: Element | null; readonly offsetTop: number; readonly offsetWidth: number; outerText: string; popover: string | null; spellcheck: boolean; title: string; translate: boolean; writingSuggestions: string; attachInternals(): ElementInternals; click(): void; hidePopover(): void; showPopover(): void; togglePopover(options?: boolean): boolean; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; readonly attributes: NamedNodeMap; get classList(): DOMTokenList; set classList(value: string); className: string; readonly clientHeight: number; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly currentCSSZoom: number; id: string; innerHTML: string; readonly localName: string; readonly namespaceURI: string | null; onfullscreenchange: (this: Element, ev: Event) => any; onfullscreenerror: (this: Element, ev: Event) => any; outerHTML: string; readonly ownerDocument: Document; get part(): DOMTokenList; set part(value: string); readonly prefix: string | null; readonly scrollHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly shadowRoot: ShadowRoot | null; slot: string; readonly tagName: string; attachShadow(init: ShadowRootInit): ShadowRoot; checkVisibility(options?: CheckVisibilityOptions): boolean; closest(selector: K): HTMLElementTagNameMap[K]; closest(selector: K): SVGElementTagNameMap[K]; closest(selector: K): MathMLElementTagNameMap[K]; closest(selectors: string): E; computedStyleMap(): StylePropertyMapReadOnly; getAttribute(qualifiedName: string): string | null; getAttributeNS(namespace: string | null, localName: string): string | null; getAttributeNames(): string[]; getAttributeNode(qualifiedName: string): Attr | null; getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; getBoundingClientRect(): DOMRect; getClientRects(): DOMRectList; getElementsByClassName(classNames: string): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; getHTML(options?: GetHTMLOptions): string; hasAttribute(qualifiedName: string): boolean; hasAttributeNS(namespace: string | null, localName: string): boolean; hasAttributes(): boolean; hasPointerCapture(pointerId: number): boolean; insertAdjacentElement(where: InsertPosition, element: Element): Element | null; insertAdjacentHTML(position: InsertPosition, string: string): void; insertAdjacentText(where: InsertPosition, data: string): void; matches(selectors: string): boolean; releasePointerCapture(pointerId: number): void; removeAttribute(qualifiedName: string): void; removeAttributeNS(namespace: string | null, localName: string): void; removeAttributeNode(attr: Attr): Attr; requestFullscreen(options?: FullscreenOptions): Promise; requestPointerLock(options?: PointerLockOptions): Promise; scroll(options?: ScrollToOptions): void; scroll(x: number, y: number): void; scrollBy(options?: ScrollToOptions): void; scrollBy(x: number, y: number): void; scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; scrollTo(options?: ScrollToOptions): void; scrollTo(x: number, y: number): void; setAttribute(qualifiedName: string, value: string): void; setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; setAttributeNode(attr: Attr): Attr | null; setAttributeNodeNS(attr: Attr): Attr | null; setHTMLUnsafe(html: string): void; setPointerCapture(pointerId: number): void; toggleAttribute(qualifiedName: string, force?: boolean): boolean; webkitMatchesSelector(selectors: string): boolean; textContent: string; readonly baseURI: string; readonly childNodes: NodeListOf; readonly firstChild: ChildNode | null; readonly isConnected: boolean; readonly lastChild: ChildNode | null; readonly nextSibling: ChildNode | null; readonly nodeName: string; readonly nodeType: number; nodeValue: string | null; readonly parentElement: HTMLElement | null; readonly parentNode: ParentNode | null; readonly previousSibling: ChildNode | null; appendChild(node: T_1): T_1; compareDocumentPosition(other: Node): number; contains(other: Node | null): boolean; getRootNode(options?: GetRootNodeOptions): Node; hasChildNodes(): boolean; insertBefore(node: T_1, child: Node | null): T_1; isDefaultNamespace(namespace: string | null): boolean; isEqualNode(otherNode: Node | null): boolean; isSameNode(otherNode: Node | null): boolean; lookupNamespaceURI(prefix: string | null): string | null; lookupPrefix(namespace: string | null): string | null; normalize(): void; removeChild(child: T_1): T_1; replaceChild(node: Node, child: T_1): T_1; readonly ELEMENT_NODE: 1; readonly ATTRIBUTE_NODE: 2; readonly TEXT_NODE: 3; readonly CDATA_SECTION_NODE: 4; readonly ENTITY_REFERENCE_NODE: 5; readonly ENTITY_NODE: 6; readonly PROCESSING_INSTRUCTION_NODE: 7; readonly COMMENT_NODE: 8; readonly DOCUMENT_NODE: 9; readonly DOCUMENT_TYPE_NODE: 10; readonly DOCUMENT_FRAGMENT_NODE: 11; readonly NOTATION_NODE: 12; readonly DOCUMENT_POSITION_DISCONNECTED: 1; readonly DOCUMENT_POSITION_PRECEDING: 2; readonly DOCUMENT_POSITION_FOLLOWING: 4; readonly DOCUMENT_POSITION_CONTAINS: 8; readonly DOCUMENT_POSITION_CONTAINED_BY: 16; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32; dispatchEvent(event: Event): boolean; ariaActiveDescendantElement: Element | null; ariaAtomic: string | null; ariaAutoComplete: string | null; ariaBrailleLabel: string | null; ariaBrailleRoleDescription: string | null; ariaBusy: string | null; ariaChecked: string | null; ariaColCount: string | null; ariaColIndex: string | null; ariaColIndexText: string | null; ariaColSpan: string | null; ariaControlsElements: ReadonlyArray | null; ariaCurrent: string | null; ariaDescribedByElements: ReadonlyArray | null; ariaDescription: string | null; ariaDetailsElements: ReadonlyArray | null; ariaDisabled: string | null; ariaErrorMessageElements: ReadonlyArray | null; ariaExpanded: string | null; ariaFlowToElements: ReadonlyArray | null; ariaHasPopup: string | null; ariaHidden: string | null; ariaInvalid: string | null; ariaKeyShortcuts: string | null; ariaLabel: string | null; ariaLabelledByElements: ReadonlyArray | null; ariaLevel: string | null; ariaLive: string | null; ariaModal: string | null; ariaMultiLine: string | null; ariaMultiSelectable: string | null; ariaOrientation: string | null; ariaOwnsElements: ReadonlyArray | null; ariaPlaceholder: string | null; ariaPosInSet: string | null; ariaPressed: string | null; ariaReadOnly: string | null; ariaRelevant: string | null; ariaRequired: string | null; ariaRoleDescription: string | null; ariaRowCount: string | null; ariaRowIndex: string | null; ariaRowIndexText: string | null; ariaRowSpan: string | null; ariaSelected: string | null; ariaSetSize: string | null; ariaSort: string | null; ariaValueMax: string | null; ariaValueMin: string | null; ariaValueNow: string | null; ariaValueText: string | null; role: string | null; animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; getAnimations(options?: GetAnimationsOptions): Animation[]; after(...nodes: (Node | string)[]): void; before(...nodes: (Node | string)[]): void; remove(): void; replaceWith(...nodes: (Node | string)[]): void; readonly nextElementSibling: Element | null; readonly previousElementSibling: Element | null; readonly childElementCount: number; readonly children: HTMLCollection; readonly firstElementChild: Element | null; readonly lastElementChild: Element | null; append(...nodes: (Node | string)[]): void; prepend(...nodes: (Node | string)[]): void; querySelector(selectors: K): HTMLElementTagNameMap[K] | null; querySelector(selectors: K): SVGElementTagNameMap[K] | null; querySelector(selectors: K): MathMLElementTagNameMap[K] | null; querySelector(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null; querySelector(selectors: string): E | null; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: string): NodeListOf; replaceChildren(...nodes: (Node | string)[]): void; readonly assignedSlot: HTMLSlotElement | null; readonly attributeStyleMap: StylePropertyMap; get style(): CSSStyleDeclaration; set style(cssText: string); contentEditable: string; enterKeyHint: string; inputMode: string; readonly isContentEditable: boolean; onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null; onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null; onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null; onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; onerror: OnErrorEventHandler; onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null; ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; autofocus: boolean; readonly dataset: DOMStringMap; nonce?: string; tabIndex: number; blur(): void; focus(options?: FocusOptions): void; }; } & T; declare type Lifecycletype = 'connect' | 'disconnect' | 'reconnect'; /** * Creates an observer that facilitates the subscription and publication of events. * @public */ export declare type Listener = (ev: EventType) => void; /** * Loads font faces by inserting a style element with the specified font face rules into the document. * @param fontFaceRules - The CSS rules for the font faces. * @param styleElementId - The ID of the style element to insert into the document. * @public */ export declare const loadFontFaces: (fontFaceRules: string, styleElementId: string) => void; /** * A logger that extends the `Consola` logger. * * @remarks * This logger is part of the package's API but may still be subject to changes and improvements. * * @public */ export declare interface Logger extends Logger_2 { /** * A logger method for deprecated symbols. * * @remarks * Pair with a deprecated tag. See {@link https://tsdoc.org/pages/tags/deprecated/} for more information. * * @example * ```ts * logger.deprecated('someSymbol'); * ``` * * @example With a custom instruction and target removal version. * ```ts * logger.deprecated('routeButtons', 'Use the default slot instead.', '20.0.0'); * ``` * * @param symbol - The deprecated symbol. * @param instruction - An optional alternative instruction. Defaults to `Consult docs for better alternative.` * @param removalVersionTarget - An optional target removal version number. */ deprecated(symbol: string, instruction?: string, removalVersionTarget?: string): void; } /** * Logger for the foundation-utils package * @public */ export declare const logger: Logger_2; /** * Options for creating a logger. * @public */ export declare interface LoggerOptions extends LoggerOptions_2 { } /** * @public */ export declare let LOGIN_DETAILS_URL: string; /** * @public */ export declare let LOGIN_REFRESH_URL: string; /** * @public */ export declare let LOGIN_URL: string; export { LogLevel } /** * @public */ export declare let LOGOUT_URL: string; /** * @internal */ declare type LowercaseOperation = 'insert' | 'modify' | 'delete'; /** * Takes in a valid response from `connect.getJsonSchema(resourceName)` and maps it to * a JsonSchema extended with the genesisType metadata for a field * * @public */ export declare function mapGenesisJsonSchema(jsonSchemResponse: { OUTBOUND: JSONSchema7; }): Genesis.JSONSchema7; /** * Maps fields contained in a JSON schema block enhanced with genesisType metadata * to the field shape required by the expression builder component. * * Only sets the properties that are *required*. Optional properties, such as * `defaultValue`, must be explicitly set by the user separately. * * @example * ```ts * import { mapGenesisJsonSchema, mapJsonSchemaFieldToExprBuilderField } from '@genesislcap/foundation-utils'; * * const response = await connect.getJsonSchema("RESOURCE_NAME"); * // Assuming the response is valid, requires checking * const schema = mapGenesisJsonSchema(response); * const fields = Object.entries(schema.properties).map(mapJsonSchemaFieldToExprBuilderField); * ``` * @public */ export declare function mapJsonSchemaFieldToExprBuilderField([name, schema]: [ string, Genesis.FieldJsonSchema ]): Types.Field | null; /** * A no-operation function that executes an optional callback. * * This is a lower-level utility function. For preventing tree-shaking of custom elements, * prefer using {@link avoidTreeShaking} which provides a more explicit API. * * @param callback - An optional function to execute for its side effects. * @public */ export declare const noop: (fn?: () => void) => void; /** * @public */ export declare class NumberParser { /** * reference: https://observablehq.com/\@mbostock/localized-number-parsing * @internal */ private _group; private _decimal; private _separator; private _numeral; private _index; constructor(locale: string); parse(localeNumber: string): number; hasSeparator(localeNumber: string): boolean; } /** * @privateRemarks * Code borrowed from fast-element v2. We can remove post upgrade. * * @example * Reactive visitor example. * ```ts * const makeObserverVisitor: ObjectVisitor = { * visitObject: noop, * visitArray: noop, * visitProperty(object: any, propertyName: string, value: any): void { * Reflect.defineProperty(object, propertyName, { * enumerable: true, * get() { * Observable.track(object, propertyName); * return value; * }, * set(newValue: any) { * if (value !== newValue) { * value = newValue; * Observable.notify(object, propertyName); * } * }, * }); * }, * }; * ``` * * @beta */ export declare interface ObjectVisitor { visitObject(object: any, data: TVisitorData): void; visitArray(array: any[], data: TVisitorData): void; visitProperty(object: any, key: PropertyKey, value: any, data: TVisitorData): void; } /** * Represents an event observer that manages the subscription and publication of events. * @public */ export declare interface Observer { subscribe: Subscribe; publish: Publish; } /** * Opens a new browser window with the specified URL, target, width, and height. * @param urlNavigate - The URL to navigate to. * @param target - The name of the new window. * @param popUpWidth - The width of the new window (optional). * @param popUpHeight - The height of the new window (optional). * @returns A reference to the new window. * @public */ export declare const openPopup: (urlNavigate: string, target: string, popUpWidth?: number, popUpHeight?: number) => Window; /** * The `PendingState` mixin. * @public */ export declare const PendingState: (Base: TBase) => { new (...args: any[]): { /** * The number of promises that are currently pending. * @public */ pendingCount: number; /** * The number of promises that have been resolved. * @public */ resolvedCount: number; /** * A boolean indicating whether there are any pending children. * @public */ hasPendingChildren: boolean; /** * Gets the progress of the pending promises as a percentage between 0 and 1. * @public */ get progress(): number; /** * Called when the element is connected to the DOM. * @internal */ connectedCallback(): void; /** * Called when the element is disconnected from the DOM. * @internal */ disconnectedCallback(): void; /** * Handles the `pending-state` event. * @param event - The `pending-state` event. * @internal */ onPendingState({ detail }: PendingStateEvent): Promise; readonly $fastController: Controller; $emit(type: string, detail?: any, options?: Omit): boolean | void; attributeChangedCallback(name: string, oldValue: string, newValue: string): void; accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; autocorrect: boolean; dir: string; draggable: boolean; hidden: boolean; inert: boolean; innerText: string; lang: string; readonly offsetHeight: number; readonly offsetLeft: number; readonly offsetParent: Element | null; readonly offsetTop: number; readonly offsetWidth: number; outerText: string; popover: string | null; spellcheck: boolean; title: string; translate: boolean; writingSuggestions: string; attachInternals(): ElementInternals; click(): void; hidePopover(): void; showPopover(): void; togglePopover(options?: boolean): boolean; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; readonly attributes: NamedNodeMap; get classList(): DOMTokenList; set classList(value: string); className: string; readonly clientHeight: number; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; readonly currentCSSZoom: number; id: string; innerHTML: string; readonly localName: string; readonly namespaceURI: string | null; onfullscreenchange: (this: Element, ev: Event) => any; onfullscreenerror: (this: Element, ev: Event) => any; outerHTML: string; readonly ownerDocument: Document; get part(): DOMTokenList; set part(value: string); readonly prefix: string | null; readonly scrollHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; readonly shadowRoot: ShadowRoot | null; slot: string; readonly tagName: string; attachShadow(init: ShadowRootInit): ShadowRoot; checkVisibility(options?: CheckVisibilityOptions): boolean; closest(selector: K): HTMLElementTagNameMap[K]; closest(selector: K): SVGElementTagNameMap[K]; closest(selector: K): MathMLElementTagNameMap[K]; closest(selectors: string): E; computedStyleMap(): StylePropertyMapReadOnly; getAttribute(qualifiedName: string): string | null; getAttributeNS(namespace: string | null, localName: string): string | null; getAttributeNames(): string[]; getAttributeNode(qualifiedName: string): Attr | null; getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; getBoundingClientRect(): DOMRect; getClientRects(): DOMRectList; getElementsByClassName(classNames: string): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: K): HTMLCollectionOf; getElementsByTagName(qualifiedName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; getHTML(options?: GetHTMLOptions): string; hasAttribute(qualifiedName: string): boolean; hasAttributeNS(namespace: string | null, localName: string): boolean; hasAttributes(): boolean; hasPointerCapture(pointerId: number): boolean; insertAdjacentElement(where: InsertPosition, element: Element): Element | null; insertAdjacentHTML(position: InsertPosition, string: string): void; insertAdjacentText(where: InsertPosition, data: string): void; matches(selectors: string): boolean; releasePointerCapture(pointerId: number): void; removeAttribute(qualifiedName: string): void; removeAttributeNS(namespace: string | null, localName: string): void; removeAttributeNode(attr: Attr): Attr; requestFullscreen(options?: FullscreenOptions): Promise; requestPointerLock(options?: PointerLockOptions): Promise; scroll(options?: ScrollToOptions): void; scroll(x: number, y: number): void; scrollBy(options?: ScrollToOptions): void; scrollBy(x: number, y: number): void; scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; scrollTo(options?: ScrollToOptions): void; scrollTo(x: number, y: number): void; setAttribute(qualifiedName: string, value: string): void; setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; setAttributeNode(attr: Attr): Attr | null; setAttributeNodeNS(attr: Attr): Attr | null; setHTMLUnsafe(html: string): void; setPointerCapture(pointerId: number): void; toggleAttribute(qualifiedName: string, force?: boolean): boolean; webkitMatchesSelector(selectors: string): boolean; textContent: string; readonly baseURI: string; readonly childNodes: NodeListOf; readonly firstChild: ChildNode | null; readonly isConnected: boolean; readonly lastChild: ChildNode | null; readonly nextSibling: ChildNode | null; readonly nodeName: string; readonly nodeType: number; nodeValue: string | null; readonly parentElement: HTMLElement | null; readonly parentNode: ParentNode | null; readonly previousSibling: ChildNode | null; appendChild(node: T): T; cloneNode(subtree?: boolean): Node; compareDocumentPosition(other: Node): number; contains(other: Node | null): boolean; getRootNode(options?: GetRootNodeOptions): Node; hasChildNodes(): boolean; insertBefore(node: T, child: Node | null): T; isDefaultNamespace(namespace: string | null): boolean; isEqualNode(otherNode: Node | null): boolean; isSameNode(otherNode: Node | null): boolean; lookupNamespaceURI(prefix: string | null): string | null; lookupPrefix(namespace: string | null): string | null; normalize(): void; removeChild(child: T): T; replaceChild(node: Node, child: T): T; readonly ELEMENT_NODE: 1; readonly ATTRIBUTE_NODE: 2; readonly TEXT_NODE: 3; readonly CDATA_SECTION_NODE: 4; readonly ENTITY_REFERENCE_NODE: 5; readonly ENTITY_NODE: 6; readonly PROCESSING_INSTRUCTION_NODE: 7; readonly COMMENT_NODE: 8; readonly DOCUMENT_NODE: 9; readonly DOCUMENT_TYPE_NODE: 10; readonly DOCUMENT_FRAGMENT_NODE: 11; readonly NOTATION_NODE: 12; readonly DOCUMENT_POSITION_DISCONNECTED: 1; readonly DOCUMENT_POSITION_PRECEDING: 2; readonly DOCUMENT_POSITION_FOLLOWING: 4; readonly DOCUMENT_POSITION_CONTAINS: 8; readonly DOCUMENT_POSITION_CONTAINED_BY: 16; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32; dispatchEvent(event: Event): boolean; ariaActiveDescendantElement: Element | null; ariaAtomic: string | null; ariaAutoComplete: string | null; ariaBrailleLabel: string | null; ariaBrailleRoleDescription: string | null; ariaBusy: string | null; ariaChecked: string | null; ariaColCount: string | null; ariaColIndex: string | null; ariaColIndexText: string | null; ariaColSpan: string | null; ariaControlsElements: ReadonlyArray | null; ariaCurrent: string | null; ariaDescribedByElements: ReadonlyArray | null; ariaDescription: string | null; ariaDetailsElements: ReadonlyArray | null; ariaDisabled: string | null; ariaErrorMessageElements: ReadonlyArray | null; ariaExpanded: string | null; ariaFlowToElements: ReadonlyArray | null; ariaHasPopup: string | null; ariaHidden: string | null; ariaInvalid: string | null; ariaKeyShortcuts: string | null; ariaLabel: string | null; ariaLabelledByElements: ReadonlyArray | null; ariaLevel: string | null; ariaLive: string | null; ariaModal: string | null; ariaMultiLine: string | null; ariaMultiSelectable: string | null; ariaOrientation: string | null; ariaOwnsElements: ReadonlyArray | null; ariaPlaceholder: string | null; ariaPosInSet: string | null; ariaPressed: string | null; ariaReadOnly: string | null; ariaRelevant: string | null; ariaRequired: string | null; ariaRoleDescription: string | null; ariaRowCount: string | null; ariaRowIndex: string | null; ariaRowIndexText: string | null; ariaRowSpan: string | null; ariaSelected: string | null; ariaSetSize: string | null; ariaSort: string | null; ariaValueMax: string | null; ariaValueMin: string | null; ariaValueNow: string | null; ariaValueText: string | null; role: string | null; animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; getAnimations(options?: GetAnimationsOptions): Animation[]; after(...nodes: (Node | string)[]): void; before(...nodes: (Node | string)[]): void; remove(): void; replaceWith(...nodes: (Node | string)[]): void; readonly nextElementSibling: Element | null; readonly previousElementSibling: Element | null; readonly childElementCount: number; readonly children: HTMLCollection; readonly firstElementChild: Element | null; readonly lastElementChild: Element | null; append(...nodes: (Node | string)[]): void; prepend(...nodes: (Node | string)[]): void; querySelector(selectors: K): HTMLElementTagNameMap[K] | null; querySelector(selectors: K): SVGElementTagNameMap[K] | null; querySelector(selectors: K): MathMLElementTagNameMap[K] | null; querySelector(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null; querySelector(selectors: string): E | null; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: string): NodeListOf; replaceChildren(...nodes: (Node | string)[]): void; readonly assignedSlot: HTMLSlotElement | null; readonly attributeStyleMap: StylePropertyMap; get style(): CSSStyleDeclaration; set style(cssText: string); contentEditable: string; enterKeyHint: string; inputMode: string; readonly isContentEditable: boolean; onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null; onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null; onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null; onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; onerror: OnErrorEventHandler; onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null; onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null; ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; autofocus: boolean; readonly dataset: DOMStringMap; nonce?: string; tabIndex: number; blur(): void; focus(options?: FocusOptions): void; }; } & TBase; /** * A custom event that represents a `pending-state-error` event. * @public */ export declare type PendingStateErrorEvent = CustomEvent; /** * The data for a `pending-state-error` event. * @internal */ declare type PendingStateErrorEventData = { message?: string; error: Error; }; /** * A custom event that represents a `pending-state` event. * @public */ export declare type PendingStateEvent = CustomEvent; /** * The data for a `pending-state` event. * @internal */ declare type PendingStateEventData = { promise: Promise; }; /** * An enum that defines the names of the events that can be raised by the `PendingState` mixin. * @public */ export declare enum PendingStateEvents { state = "pending-state", error = "pending-state-error" } /** * The default height (in pixels) for pop-up windows. * @public */ export declare const POPUP_DEFAULT_HEIGHT = 600; /** * The default width (in pixels) for pop-up windows. * @public */ export declare const POPUP_DEFAULT_WIDTH = 483; /** * The public path. * @privateRemarks * Provided by default as part of the `resolveDefineConfig` in the build kit. * @example '/', '/app/'. * @public * @defaultValue `'/'` */ export declare let PUBLIC_PATH: string; /** * Publishes an event of a specific type to all subscribed listeners. * @public */ export declare type Publish = (event: EventType) => void; /** * Converts a plain object to a reactive, observable object. * * @privateRemarks * Code borrowed from fast-element v2. We can remove post upgrade. * * @example * An array or reactive items. * ```ts * this.todos = todosResponse.map((t) => reactive(t)); * ``` * * @example * Add item. * ```ts * add(description: string) { * this.splice(this.todos.length, 0, reactive({ description, done: false })); * } * ``` * * @example * Remove item. * ```ts * remove(todo: Todo) { * const index = this.todos.indexOf(todo); * index !== -1 && this.splice(index, 1); * } *``` * * @param object - The object to make reactive. * @param deep - Indicates whether to deeply convert the object. * @returns The converted object. * * @beta */ export declare function reactive(object: T, deep?: boolean): T; /** * Defines a property changed handler that calls a render() method on the target as an internal observation enhancement. * * @remarks * This is useful if you have a lot of properties that all invalidate the internal state. * See {@link https://www.fast.design/docs/fast-element/observables-and-state#internal-observation} for more information. * * @param target - The target to define the property change handler on. * @param name - The property name. * * @example * ```ts * @attr({ mode: 'boolean', attribute: 'line-numbers' }) * @renderOnChange * lineNumbers: boolean = true; * * @attr * @renderOnChange * indent: number | 'tab' = 2; * * render() { * if (!this.$fastController.isConnected) { * return; * } * // Do something... * } * ``` * * @public */ export declare function renderOnChange(target: FASTElement & { render(): void; }, name: string): void; /** * @public */ export declare let RESET_PASSWORD_URL: string; /** * Resolve a promise after a timeout. * * @example * ```ts * const result = await Promise.race([ * resourceChecks(sourceRef, resource), * resolveAfter(this.config.checkTimeout, () => ({ * isConnected: false, * lastUpdated: Date.now(), * })), * ]); * ``` * * @public */ export declare const resolveAfter: (ms: number, valueCreator: () => T) => Promise; /** * An object that defines two resource types: "local" and "remote". * @public */ export declare const ResourceType: { readonly local: "local"; readonly remote: "remote"; }; /** * A type that represents the resource types defined by the `ResourceType` object. * @public */ export declare type ResourceType = (typeof ResourceType)[keyof typeof ResourceType]; /** * Setup an `IntersectionObserver` which will activate a callback function when an element becomes visible on screen * @param element - HTMLElement to observe * @param callback - any function called when the visibility changes * @returns A cleanup function to disconnect the observer * @public */ export declare const respondToVisibility: (element: HTMLElement, callback: (arg0: boolean) => any) => (() => void); /** * A singleton utility to observe and notify about route changes. * It uses both polling and popstate events to detect changes. * @public */ export declare class RouteUtil { /** * The current pathname of the window location. */ pathName: string; private routeCheckInterval; private static instance; private constructor(); /** * Gets the singleton instance of RouteUtil. */ static get shared(): RouteUtil; /** * Initialize framework-agnostic route detection */ private initializeRouteDetection; /** * Handle route changes by updating the pathName observable */ private handleRouteChange; /** * Clean up route detection listeners and polling. */ destroy(): void; } /** * The data for a server row DTO. * @public */ export declare type ServerRowDTO = { DETAILS: { OPERATION: UppercaseOperation; ROW_REF: string; }; }; /** * A mapper for converting between server row DTOs and entities. * Provides methods to get/set a ServerRow DTO entity mapping. * @public */ export declare interface ServerRowDTOMapper extends DTOMapper { } /** * A DI token used to obtain a `ServerRowDTOMapper` instance. * @public */ export declare const ServerRowDTOMapper: InterfaceSymbol; /** * The data for a server row entity. * @public */ export declare type ServerRowEntity = { serverRowMetadata: { operation: LowercaseOperation; rowRef: string; }; }; export declare const SHORTCUT_BLOCKED_DEFAULT_MESSAGE = "This shortcut is currently unavailable in this context."; export declare const SHORTCUT_BLOCKED_DEFAULT_TITLE = "Shortcut blocked"; export declare const SHORTCUT_BLOCKED_ELEMENT_FOCUS_MESSAGE = "This shortcut is unavailable in the current focus context."; export declare const SHORTCUT_BLOCKED_EVENT = "foundation-shortcut-blocked"; export declare const SHORTCUT_BLOCKED_INPUT_MESSAGE = "This shortcut is unavailable while typing in an input field."; export declare const SHORTCUT_BLOCKED_PAUSED_MESSAGE = "Shortcuts are paused."; export declare type ShortcutBlockedEventDetail = { shortcutId: string; context?: string; reason: ShortcutBlockedReason; blockedMessage: ShortcutBlockedMessage; }; export declare type ShortcutBlockedMessage = { title: string; text: string; }; export declare type ShortcutBlockedMessageConfig = { defaultMessage?: ShortcutBlockedMessage; inputMessage?: ShortcutBlockedMessage; pausedMessage?: ShortcutBlockedMessage; elementFocusMessage?: ShortcutBlockedMessage; emitPausedBlockedEvent?: boolean; }; export declare type ShortcutBlockedReason = 'paused' | 'editable-context' | 'element-not-focused' | 'disabled'; /** * A definition of a keyboard shortcut * @public */ export declare interface ShortcutDefinition { id: string; key: string; ctrlKey?: boolean; altKey?: boolean; optionKey?: boolean; shiftKey?: boolean; metaKey?: boolean; description: string; action: () => void; context: string; priority?: number; elementRef?: HTMLElement; canExecute?: () => ShortcutExecutionStatus; /** * Optional per-shortcut blocked message override. * Set to '' to emit blocked events with an empty message. */ blockedMessage?: ShortcutBlockedMessage; /** * Controls whether blocked shortcut events should be emitted for this shortcut. * @default true */ emitBlockedEvent?: boolean; } export declare type ShortcutDesignSystemPrefix = EditableDesignSystemPrefix; export declare type ShortcutEditableContextConfig = { /** * Which design systems should be considered when detecting editable custom elements. * @default ['rapid'] */ designSystems?: ShortcutDesignSystemPrefix[]; /** * Optional app-specific selectors for editable host elements. * @default [] */ customEditableSelectors?: string[]; }; /** * A type which represents the disabled status and tooltip of an item * @public * */ export declare type ShortcutExecutionStatus = { disabled?: boolean; tooltip?: string; }; /** * Interface of a manager for keyboard shortcuts * @public */ export declare interface ShortcutManager { registerShortcuts(shortcuts: ShortcutDefinition[]): void; registerShortcut(shortcut: ShortcutDefinition): ShortcutRegistrationResult; unregisterShortcut(context: string, id: string): void; unregisterShortcutsByContext(context: string): void; /** * Execute a shortcut by its id * @param id - The id of the shortcut to execute * @remarks This method will execute the shortcut in the active context */ executeShortcut(id: string, eventTarget?: EventTarget | null): void; /** * Execute a shortcut by its id and context * @param context - The context of the shortcut to execute * @param id - The id of the shortcut to execute */ executeShortcutByContext(context: string, id: string, eventTarget?: EventTarget | null): void; getShortcuts(): ShortcutDefinition[]; getShortcutsByContext(context: string): ShortcutDefinition[]; getContexts(): string[]; getShortcutsByContextMap(): Map>; registerContext(context: string): void; setActiveContext(context: string): void; getActiveContext(): string | undefined; clearActiveContext(): void; findShortcutByKeyCombination(key: string, ctrlKey?: boolean, altKey?: boolean, shiftKey?: boolean, metaKey?: boolean): ShortcutDefinition | undefined; pause(): void; resume(): void; isPaused: boolean; isPaused$: Observable; isPausedSubject: BehaviorSubject; /** * Register a global execution guard. * @remarks Guards are evaluated before shortcut-specific canExecute checks. */ registerExecutionGuard(id: string, guard: () => ShortcutExecutionStatus | boolean): void; unregisterExecutionGuard(id: string): void; clearExecutionGuards(): void; /** * Configure editable-context detection used by shortcut listeners. * @remarks This is intended to be set once during app startup. */ configureEditableContext(config?: ShortcutEditableContextConfig): void; getEditableContextConfig(): Required; getEditableSelector(): string; configureBlockedMessages(config?: ShortcutBlockedMessageConfig): void; getBlockedMessages(): Required; } /** * A dependency injection token for the ShortcutManager interface. * @public */ export declare const ShortcutManager: InterfaceSymbol; /** * A result of registering a keyboard shortcut * @public */ export declare interface ShortcutRegistrationResult { shortcut: ShortcutDefinition; id: string; keyCombination: string; keyCombinationDisplay: string; disabled: () => boolean; tooltip: () => string | undefined; } /** * A custom element that encapsulates a set of styles that can be applied to slotted elements. * @public */ export declare class SlottedStyles extends FASTElement { /** * The styles to apply to slotted elements. */ styles: ElementStyles; /** * Called when the `styles` property changes. * Removes the previous styles from the parent element's FAST controller and adds the new styles. * @param prev - The previous value of the `styles` property. * @param next - The new value of the `styles` property. */ stylesChanged(prev: ElementStyles, next: ElementStyles): void; } /** * The sub-path used for WebSocket connections when API_HOST is not set * @public * @defaultValue `'gwf'` * @remarks Optional. * @example * If `API_HOST` is not set, `SOCKET_EXT` is set to `/custom` and UI is served on `https://localhost:1234` * API host URL will be `wss://localhost:1234/custom` */ export declare let SOCKET_EXT: string; /** * @public */ export declare let SSO_LIST_URL: string; /** * @public */ export declare let SSO_LOGIN_URL: string; /** * A {@link @microsoft/fast-element#ValueConverter} that converts between comma-separated string attributes * and `string | string[]` properties. * * @remarks * - fromView: "A,B,C" → ["A","B","C"], "A" → "A", "" → undefined * - toView: ["A","B","C"] → "A,B,C", "A" → "A", undefined → "" * * @public */ export declare const stringArrayConverter: ValueConverter; /** * Subscribes a listener function to receive events of a specific type. * @returns An unsubscribe function. * @public */ export declare type Subscribe = (listener: Listener) => () => void; /** * Creates a synchronization directive that binds a data source to an HTML element, * @public */ export declare function sync(binding: Binding, conversionType?: ConversionType, eventName?: EventName, keyAttr?: string): CaptureType; /** * toElementStyles. * @remarks * Converts {@link @microsoft/fast-element#ComposableStyles} or a ComposableStyles array to {@link @microsoft/fast-element#ElementStyles}. * @param styles - ComposableStyles or a ComposableStyles array. * @public */ export declare function toElementStyles(styles: ComposableStyles | ComposableStyles[]): ElementStyles; /** * An object containing type ramp values. * @public */ export declare const TypeRampValues: { readonly minusOne: -1; readonly minusTwo: -2; readonly plusOne: 1; readonly plusTwo: 2; readonly plusThree: 3; readonly plusFour: 4; readonly plusFive: 5; readonly plusSix: 6; }; /** * @internal */ declare type UppercaseOperation = Uppercase; /** * An interface for generating UUIDs. * @public */ export declare interface UUID { /** * Generates a new UUID. * @param withLogging - Optional. Whether to log the generated UUID to the console. Defaults to false. * @returns The generated UUID. */ createId(withLogging?: boolean): string; /** * Generates a new UUID for a remote object. * @param withLogging - Optional. Whether to log the generated UUID to the console. Defaults to false. * @returns A promise that resolves to the generated UUID. */ createRemoteId(withLogging?: boolean): Promise; } /** * A dependency injection token for the UUID interface. * @public */ export declare const UUID: InterfaceSymbol; /** * A configuration object for customizing UUID generation. * @public */ export declare interface UUIDConfig { } /** * Visit object utility. * * @privateRemarks * Code borrowed from fast-element v2. We can remove post upgrade. * * @example * Reactive example. * ```ts * export function reactive(object: T, deep = false): T { * visitObject(object, deep, makeObserverVisitor, void 0, observed); * return object; * } * ``` * * @param object - The object. * @param deep - A flag to indicate if a recursive visit of sub objects should occur. * @param visitor - The defined {@link ObjectVisitor} logic. * @param data - Visitor data. * @param traversed - The traversed object set. * * @beta */ export declare function visitObject(object: any, deep: boolean, visitor: ObjectVisitor, data: TVisitorData, traversed: WeakSet | Set): void; /** * Directive that allows supplying an "else" template to the traditional {@link https://www.fast.design/docs/api/fast-element.when/#when-function} directive * * @param binding - The condition to test for rendering. * @param trueTemplateOrTemplateBinding - The template or a binding that gets the template to render when the condition is true. * @param falseTemplateOrTemplateBinding - The template or a binding that gets the template to render when the condition is false. * @public */ export declare function whenElse(binding: Binding, trueTemplateOrTemplateBinding: WhenTemplate, falseTemplateOrTemplateBinding: WhenTemplate): CaptureType; declare type WhenTemplate = SyntheticViewTemplate | Binding; export { }