/** * Any Lynx Element, such as `view`, `text`, `image`, etc. * * {@link https://lynxjs.org/living-spec/index.html?ts=1743416098203#element%E2%91%A0 | Lynx Spec Reference} * * @public */ export interface LynxElement extends HTMLElement { /** * The map of events bound to the element. */ eventMap?: { [key: string]: any; }; /** * The gestures bound to the element. */ gesture?: { [key: string]: any; }; /** * The cssId of the element */ cssId?: string; /** * Returns the first child. * * {@link https://developer.mozilla.org/docs/Web/API/Node/firstChild | MDN Reference} */ firstChild: LynxElement; /** * Returns the next sibling. * * {@link https://developer.mozilla.org/docs/Web/API/Node/nextSibling | MDN Reference} */ nextSibling: LynxElement; /** * Returns the parent. * * {@link https://developer.mozilla.org/docs/Web/API/Node/parentNode | MDN Reference} */ parentNode: LynxElement; } /** * @public */ export declare const initElementTree: () => { uniqueId2Element: Map; root: LynxElement | undefined; countElement(element: LynxElement, parentComponentUniqueId: number): void; __CreatePage(_tag: string, parentComponentUniqueId: number): LynxElement; __CreateRawText(text: string): LynxElement; __GetElementUniqueID(e: LynxElement): number; __SetClasses(e: LynxElement, cls: string): void; __CreateElement(tag: string, parentComponentUniqueId: number): LynxElement; __CreateView(parentComponentUniqueId: number): LynxElement; __CreateScrollView(parentComponentUniqueId: number): LynxElement; __FirstElement(e: LynxElement): LynxElement; __CreateText(parentComponentUniqueId: number): LynxElement; __CreateImage(parentComponentUniqueId: number): LynxElement; __CreateWrapperElement(parentComponentUniqueId: number): LynxElement; __AddInlineStyle(e: HTMLElement, key: number, value: string): void; __AppendElement(parent: LynxElement, child: LynxElement): void; __SetCSSId(e: LynxElement | LynxElement[], id: string, entryName?: string): void; __SetAttribute(e: LynxElement, key: string, value: any): void; __AddEvent(e: LynxElement, eventType: string, eventName: string, eventHandler: string | Record): void; __GetEvent(e: LynxElement, eventType: string, eventName: string): { type: string; name: string; jsFunction: any; } | undefined; __SetID(e: LynxElement, id: string): void; __SetInlineStyles(e: LynxElement, styles: string | Record): void; __AddDataset(e: LynxElement, key: string, value: string): void; __SetDataset(e: LynxElement, dataset: any): void; __SetGestureDetector(e: LynxElement, id: number, type: number, config: any, relationMap: Record): void; __RemoveGestureDetector(e: LynxElement, id: number): void; __GetDataset(e: LynxElement): DOMStringMap; __RemoveElement(parent: LynxElement, child: LynxElement): void; __InsertElementBefore(parent: LynxElement, child: LynxElement, ref?: LynxElement): void; __ReplaceElement(newElement: LynxElement, oldElement: LynxElement): void; __FlushElementTree(): void; __UpdateListComponents(_list: LynxElement, _components: string[]): void; __UpdateListCallbacks(list: LynxElement, componentAtIndex: (list: LynxElement, listID: number, cellIndex: number, operationID: number, enable_reuse_notification: boolean) => void, enqueueComponent: (list: LynxElement, listID: number, sign: number) => void): void; __CreateList(parentComponentUniqueId: number, componentAtIndex: any, enqueueComponent: any): LynxElement; __GetTag(ele: LynxElement): string; __GetAttributeByName(ele: LynxElement, name: string): string | null; __GetAttributeNames(ele: LynxElement): string[]; __GetComputedStyleByKey(ele: LynxElement, key: string): string; /** @internal */ animationMap: Map; __ElementAnimate(element: LynxElement, args: [number, string, ...any[]]): void; clear(): void; toTree(): LynxElement | undefined; /** * Enter a list-item element at the given index. * It will load the list-item element using the `componentAtIndex` callback. * * @param e - The list element * @param index - The index of the list-item element * @param args - The arguments used to create the list-item element * @returns The unique id of the list-item element */ enterListItemAtIndex(e: LynxElement, index: number, ...args: any[]): number; /** * Leave a list-item element. * It will mark the list-item element as unused using * the `enqueueComponent` callback, and the list-item element * will be reused in the future by other list-item elements. * * @param e - The list element * @param uiSign - The unique id of the list-item element */ leaveListItem(e: LynxElement, uiSign: number): void; toJSON(): LynxElement | undefined; __GetElementByUniqueId(uniqueId: number): LynxElement | undefined; __GetPageElement(): LynxElement | undefined; __QuerySelector(e: LynxElement, cssSelector: string, _params: object): LynxElement | undefined; };