@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
73 lines (72 loc) • 3.07 kB
TypeScript
import { ESLBaseElement } from '../../esl-base-element/core';
import type { ESLNote } from './esl-note';
import type { FootnotesItem } from './esl-footnotes-data';
export declare class ESLFootnotes extends ESLBaseElement {
static is: string;
/** Event to request acknowledgment from {@link ESLNotes} instances */
FOOTNOTE_REQUEST_EVENT: string;
/** Event to acknowledge {@link ESLFootnotes} instance about footnote */
FOOTNOTE_RESPONSE_EVENT: string;
/** Target element {@link ESLTraversingQuery} to define scope */
scopeTarget: string;
/** Grouping note instances with identical content enable/disable */
grouping: string;
/** Label for 'return to note' button title */
backToNoteLabel: string;
protected _notes: ESLNote[];
protected deferredOnUpdate: import("../../esl-utils/async/debounce").Debounced<() => void>;
/** Scope element */
protected get scopeEl(): HTMLElement;
/** Notes that are allowed to be processed by footnotes */
get notes(): ESLNote[];
/** List of notes to show */
protected get footnotesList(): FootnotesItem[];
protected connectedCallback(): void;
protected disconnectedCallback(): void;
/** Adds the note to the footnotes list */
linkNote(note: ESLNote): void;
/** Reindexes the list of notes */
reindex(): void;
/** Removes the note from the footnotes list */
unlinkNote(note: ESLNote): void;
/** Updates the content of footnotes */
update(): void;
/** Sorts list of notes */
protected _sortNotes(): void;
/** Builds content of footnotes */
protected buildItems(): string;
/** Builds one item from footnotes list */
protected buildItem(footnote: FootnotesItem): string;
/** Builds item index */
protected buildItemIndex(footnote: FootnotesItem): string;
/** Builds item index wrapped with span related to esl-note by id */
protected buildWrappedItemIndex(index: string): string;
/** Builds item text */
protected buildItemText(footnote: FootnotesItem): string;
/** Builds item back-to-note button */
protected buildItemBack(footnote: FootnotesItem): string;
/** Actions on update footnotes */
protected _onUpdate(): void;
/** Handles `response` event from note */
protected _onNoteSubscribe(e: CustomEvent): void;
/** Handles `click` event */
protected _onItemClick(e: MouseEvent | KeyboardEvent): void;
/** Handles `keydown` event */
protected _onKeydown(event: KeyboardEvent): void;
/** Actions on back-to-note click */
protected _onBackToNote(order: number[]): void;
/** Turns off highlight for notes with the same text */
turnOffHighlight(note: ESLNote): void;
/**
* Sends a request to all notes, expecting to get a response from
* the unlinked ones and link up with them */
protected _notifyNotes(): void;
}
declare global {
export interface ESLLibrary {
Footnotes: typeof ESLFootnotes;
}
export interface HTMLElementTagNameMap {
'esl-footnotes': ESLFootnotes;
}
}