studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
855 lines (854 loc) • 40.7 kB
TypeScript
/**
* This module handles internationalization (i18n) for the StudioCMS application on the client side.
*
* It provides utilities for loading and managing translation files, as well as functions for
* retrieving translated strings based on the current language context.
*
* If you are interested in contributing to the translation effort, please visit our Crowdin project:
* https://crowdin.com/project/studiocms or submit a pull request to the `translations` folder:
* `packages/studiocms/src/virtuals/i18n/translations/` on https://github.com/withstudiocms/studiocms
*/
import { type Messages, type Translations } from '@nanostores/i18n';
import { defaultLang, type UiTranslationKey, uiTranslationsAvailable } from './config.js';
export { defaultLang, type UiTranslationKey, uiTranslationsAvailable };
/**
* The base translation object containing all translations for the default language.
*/
export declare const baseTranslation: {
"@studiocms/auth:login": {
title: string;
description: string;
header: string;
"sub-header-usernamepasswordoauth": string;
"sub-header-usernamepassword": string;
"sub-header-oauth": string;
"sub-header-noprovider": string;
"username-label": string;
"password-label": string;
"login-button": string;
"allow-registration-noaccount": string;
"allow-registration-register": string;
"forgot-password": string;
"forgot-password-title": string;
"forgot-password-message": string;
"email-label": string;
"demo-mode-credentials": string;
};
"@studiocms/auth:signup": {
title: string;
description: string;
header: string;
"sub-header-usernamepasswordoauth": string;
"sub-header-usernamepassword": string;
"sub-header-oauth": string;
"sub-header-noprovider": string;
"username-label": string;
"email-label": string;
"displayname-label": string;
"password-label": string;
"confirm-password-label": string;
"create-account-button": string;
"allow-login-haveaccount": string;
"allow-login-login": string;
};
"@studiocms/auth:logout": {
title: string;
description: string;
header: string;
"sub-header": string;
"cancel-button-label": string;
};
"@studiocms/auth:oauth-stack": {
"or-login-with": string;
};
"@studiocms/dashboard:index": {
title: string;
description: string;
"welcome-title": string;
"title-button:discord": string;
"title-button:feedback": string;
"sub-header": string;
};
"@studiocms/dashboard:sidebar": {
"category-1-header": string;
"dashboard-link-label": string;
"content-management-label": string;
"category-2-header": string;
"site-configuration-label": string;
"user-management-label": string;
"category-3-header": string;
"category-3-empty-placeholder": string;
"user-dropdown:settings": string;
"user-dropdown:view-site": string;
"user-dropdown:logout": string;
"mailer-configuration-label": string;
};
"@studiocms/dashboard:profile": {
title: string;
description: string;
header: string;
"basic-info-header": string;
"basic-info-save-button": string;
"basic-info-display-name": string;
"basic-info-email": string;
"basic-info-username": string;
"basic-info-website": string;
"user-password-header": string;
"user-password-save-button": string;
"user-password-no-password": string;
"user-password-current": string;
"user-password-new": string;
"user-password-confirm": string;
"social-accounts-header": string;
"social-accounts-connected": string;
"social-accounts-no-connected": string;
"social-accounts-other": string;
"social-accounts-no-other": string;
"api-tokens-header": string;
"api-tokens-create": string;
"api-tokens-description": string;
"api-tokens-delete-button": string;
"api-tokens-created": string;
"api-tokens-no-tokens": string;
"api-tokens-modal-header": string;
"api-tokens-modal-description": string;
"api-tokens-modal-response-header": string;
"api-tokens-modal-response-description": string;
"sync-with-libravatar": string;
"basic-avatar-url": string;
};
"@studiocms/dashboard:password-reset": {
title: string;
description: string;
header: string;
"sub-header-start": string;
"sub-header-end": string;
"password-label": string;
"confirm-password-label": string;
"reset-button": string;
};
"@studiocms/dashboard:configuration": {
title: string;
description: string;
header: string;
"save-button": string;
"dashboard-grid-label": string;
"login-page-preview": string;
"input-site-title": string;
"input-site-description": string;
"input-og-image": string;
"input-site-icon": string;
"input-diff-tracking-limit": string;
"input-custom-login-page": string;
"select-page-diff-tracking": string;
"select-login-page-bg": string;
"select-smtp-mailer": string;
"select-hide-default-index": string;
"true-label": string;
"false-label": string;
};
"@studiocms/dashboard:smtp": {
title: string;
description: string;
header: string;
"save-button": string;
"smtp-settings": string;
"test-smtp": string;
"smtp-host": string;
"smtp-host-placeholder": string;
"smtp-port": string;
"smtp-port-placeholder": string;
"smtp-secure": string;
"smtp-proxy": string;
"smtp-proxy-placeholder": string;
"smtp-tls-reject-unauthorized": string;
"smtp-tls-servername": string;
"smtp-tls-servername-placeholder": string;
"smtp-user": string;
"smtp-user-placeholder": string;
"smtp-password": string;
"smtp-password-placeholder": string;
"smtp-default-sender": string;
"smtp-default-sender-placeholder": string;
"test-email": string;
"test-email-placeholder": string;
"send-test-email": string;
"site-email-settings": string;
emailVerification: string;
requireAdminVerification: string;
requireEditorVerification: string;
oAuthBypassVerification: string;
"save-email-settings": string;
"true-label": string;
"false-label": string;
"template-editor-save-failed": string;
"template-editor-save-success": string;
"template-editor-save-unknown": string;
"template-editor-preloaded-content": string;
"template-editor-not-found": string;
"template-save-reset-button-error": string;
"template-reset-button-confirm": string;
"error-label": string;
"success-label": string;
notifications: string;
passwordReset: string;
userInvite: string;
verifyEmail: string;
"mail-templates": string;
"available-templates": string;
"template-instructions": string;
"available-variables": string;
"variable-global-site.title": string;
"variable-global-site.description": string;
"variable-global-site.icon": string;
"variable-notifications-data.title": string;
"variable-notifications-data.message": string;
"variable-passwordReset-data.link": string;
"variable-verifyEmail-data.link": string;
"variable-userInvite-data.link": string;
"template-save-button": string;
"template-reset-button": string;
"preview-button-title": string;
"template-preview-button-error": string;
"template-preview-modal-header": string;
};
"@studiocms/dashboard:user-mngmt-sidebar": {
"input-placeholder-search": string;
"dropdown-create-user": string;
"dropdown-create-invite": string;
};
"@studiocms/dashboard:user-mngmt-index": {
title: string;
description: string;
header: string;
placeholder: string;
};
"@studiocms/dashboard:user-mngmt-edit": {
title: string;
description: string;
header: string;
"header-delete-button": string;
"header-save-button": string;
"delete-modal-header": string;
"delete-modal-desc-1": string;
"delete-modal-desc-2": string;
"delete-modal-warning": string;
"user-info-header": string;
"user-info-email": string;
"user-info-username": string;
"user-info-website": string;
"user-info-created-at": string;
"user-info-updated-at": string;
"password-reset-button": string;
"password-reset-modal-header": string;
"password-reset-modal-desc-1": string;
"password-reset-modal-desc-2": string;
"password-reset-modal-link": string;
"edit-role-header": string;
"email-verification-status": string;
"social-accounts-header": string;
"social-accounts-non": string;
"api-tokens-header": string;
"api-tokens-delete-button": string;
"api-tokens-created": string;
"api-tokens-no-tokens": string;
"last-edit-pages-header": string;
"last-edit-pages-edited": string;
"last-edit-pages-no-edits": string;
owner: string;
admin: string;
editor: string;
visitor: string;
unknown: string;
"email-verified": string;
"email-unverified": string;
};
"@studiocms/dashboard:plugin-settings": {
title: string;
description: string;
header: string;
"save-button": string;
};
"@studiocms/dashboard:content-sidebar": {
"input-placeholder-search": string;
"dropdown-create-page": string;
"dropdown-create-folder": string;
"items-divider": string;
};
"@studiocms/dashboard:content-header": {
title: string;
"edit-page-title": string;
"edit-folder-title": string;
"create-page-title": string;
"create-folder-title": string;
"delete-button": string;
"save-button": string;
"create-button": string;
"draft-button": string;
"publish-button": string;
"delete-modal-header": string;
"delete-modal-warning": string;
"delete-modal-desc-1": string;
"delete-modal-desc-2": string;
"delete-folder-modal-desc-1": string;
"delete-folder-modal-desc-2": string;
};
"@studiocms/dashboard:content-index": {
title: string;
description: string;
header: string;
placeholder: string;
};
"@studiocms/dashboard:content-diff": {
"view-page": string;
"page-metadata": string;
"page-content": string;
"revert-metadata": string;
"revert-content": string;
"revert-all": string;
"page-title": string;
"edited-by": string;
"edited-on": string;
"no-metadata-changes": string;
};
"@studiocms/dashboard:content-folder": {
"input-folder-name": string;
"input-folder-parent": string;
};
"@studiocms/dashboard:content-page": {
"tab-label-basic-info": string;
"tab-label-content": string;
"tab-label-diff": string;
"input-page-title": string;
"input-page-slug": string;
"input-page-description": string;
"input-page-hero-image": string;
"select-page-type": string;
"select-page-show-in-nav": string;
"select-page-parent-folder": string;
"select-page-draft": string;
"select-page-categories": string;
"select-page-tags": string;
"select-page-show-author": string;
"select-page-show-contributors": string;
"custom-page-type-fields-header": string;
"custom-page-types-description-new": string;
"diff-edited-by-1": string;
"diff-edited-by-2": string;
"diff-no-history": string;
"true-label": string;
"false-label": string;
"requires-supported-frontend": string;
"select-augments-label": string;
"no-augments": string;
};
"@studiocms/dashboard:404": {
title: string;
description: string;
"sub-description": string;
"back-button": string;
};
"@studiocms/dashboard:unverifiedEmail": {
title: string;
description: string;
"sub-description": string;
"resend-button": string;
"back-button": string;
};
"@studiocms/dashboard:versionCheckModal": {
"header-title": string;
"current-version": string;
"latest-version": string;
"last-check": string;
"full-changelog": string;
"view-on": string;
};
"@studiocms/dashboard:user-component": {
admin: string;
editor: string;
owner: string;
visitor: string;
unknown: string;
};
"@studiocms/dashboard:profile-notifications": {
"header-title": string;
"save-button": string;
account_updated: string;
page_updated: string;
page_deleted: string;
new_page: string;
folder_updated: string;
folder_deleted: string;
new_folder: string;
user_updated: string;
user_deleted: string;
new_user: string;
};
};
/**
* A persistent atom representing the user's locale settings.
*/
export declare const $localeSettings: import("nanostores").WritableAtom<string | undefined>;
/**
* A locale store derived from the user's locale settings and browser detection.
*/
export declare const $locale: import("@nanostores/i18n").LocaleStore<string>;
/**
* A formatter function for the current locale.
*/
export declare const format: import("nanostores").ReadableAtom<import("@nanostores/i18n").Formatter>;
/**
* An i18n (internationalization) utility instance for client-side usage.
*
* @remarks
* This instance is created using the `createI18n` function, initialized with the current locale and a base locale.
* It provides a `get` method to asynchronously retrieve translations for a given UI translation key from the `localeMap`.
*
* @example
* ```typescript
* const translation = await $i18n.get('welcome_message');
* ```
*
* @see createI18n
*
* @param $locale - The current locale store or value.
* @param defaultLang - The default language to use as a base locale.
* @param localeMap - An object mapping translation keys to their localized strings.
*/
export declare const $i18n: import("@nanostores/i18n").I18n<string>;
/**
* Updates the document's title, meta description, and language attribute based on the provided component and language.
*
* @param comp - An object containing the `title` and `description` properties to update the document's title and meta description.
* @param lang - The language code to set as the value of the document's `lang` attribute.
*/
export declare const documentUpdater: (comp: any, lang: string) => void;
type BaseTranslation = typeof baseTranslation;
type BaseTranslationKeys = keyof BaseTranslation;
/**
* Create a custom element that will update its text content
* when the translation changes.
*/
export declare const makeTranslation: <Body extends Translations>(currentPage: BaseTranslationKeys, i18n: Messages<Body>) => {
new (): {
connectedCallback(): 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<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(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) | null;
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
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<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
closest<E extends Element = Element>(selectors: string): E | null;
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<Element>;
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
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<void>;
requestPointerLock(options?: PointerLockOptions): Promise<void>;
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;
get textContent(): string;
set textContent(value: string | null);
readonly baseURI: string;
readonly childNodes: NodeListOf<ChildNode>;
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<T extends Node>(node: T): T;
cloneNode(subtree?: boolean): Node;
compareDocumentPosition(other: Node): number;
contains(other: Node | null): boolean;
getRootNode(options?: GetRootNodeOptions): Node;
hasChildNodes(): boolean;
insertBefore<T extends Node>(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<T extends Node>(child: T): T;
replaceChild<T extends Node>(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<Element> | null;
ariaCurrent: string | null;
ariaDescribedByElements: ReadonlyArray<Element> | null;
ariaDescription: string | null;
ariaDetailsElements: ReadonlyArray<Element> | null;
ariaDisabled: string | null;
ariaErrorMessageElements: ReadonlyArray<Element> | null;
ariaExpanded: string | null;
ariaFlowToElements: ReadonlyArray<Element> | null;
ariaHasPopup: string | null;
ariaHidden: string | null;
ariaInvalid: string | null;
ariaKeyShortcuts: string | null;
ariaLabel: string | null;
ariaLabelledByElements: ReadonlyArray<Element> | null;
ariaLevel: string | null;
ariaLive: string | null;
ariaModal: string | null;
ariaMultiLine: string | null;
ariaMultiSelectable: string | null;
ariaOrientation: string | null;
ariaOwnsElements: ReadonlyArray<Element> | 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<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
querySelector<E extends Element = Element>(selectors: string): E | null;
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
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;
onbeforexrselect: ((this: GlobalEventHandlers, ev: XRSessionEvent) => any) | null;
autofocus: boolean;
readonly dataset: DOMStringMap;
nonce?: string;
tabIndex: number;
blur(): void;
focus(options?: FocusOptions): void;
};
};
/**
* Updates the label text for a given form element with a translated string.
*
* Searches for a `<label>` element associated with the specified element ID (`el`)
* and updates its child element with the class `.label` to display the provided translation.
* If the label's inner HTML matches the `requiredLabelRegex`, it appends a required star indicator.
*
* @param el - The ID of the form element whose label should be updated.
* @param translation - The translated string to set as the label's text.
*/
export declare const updateElmLabel: (el: string, translation: string) => void;
/**
* Updates the placeholder text of an input element with the specified ID.
*
* @param el - The ID of the input element whose placeholder should be updated.
* @param translation - The new placeholder text to set for the input element.
*
* @remarks
* This function queries the DOM for an input element with the given ID and sets its
* `placeholder` property to the provided translation string.
*
* @throws {TypeError} If no element with the specified ID is found, or if the element is not an input.
*/
export declare const updateElmPlaceholder: (el: string, translation: string) => void;
/**
* Updates the label of a select element with a translated string.
*
* Finds the corresponding `<label>` element for the given select element by its `for` attribute,
* and updates its content with the provided translation. If the label contains a required field indicator
* (as determined by `requiredLabelRegex`), it preserves the required star (`*`) in the label.
*
* @param el - The base ID of the select element (without the `-select-btn` suffix).
* @param translation - The translated string to set as the label's text.
*/
export declare const updateSelectElmLabel: (el: string, translation: string) => void;
export declare const updateTrueFalseSelectOptions: (el: string, t: {
true: string;
false: string;
}) => void;
export declare const updateSelectOptions: (el: string, t: {
[key: string]: string;
}) => void;
export declare function updateTabLabel(id: string, label: string): void;
/**
* Updates the label text for a toggle element with a given translation.
*
* This function locates the `<label>` element associated with the provided element ID (`el`),
* then finds the corresponding `<span>` inside the label with the ID `label-${el}`.
* If the span's inner HTML matches the `requiredLabelRegex`, it updates the span's inner HTML
* to include the translated text and a required star indicator. Otherwise, it simply updates
* the span's text content with the translation.
*
* @param el - The ID of the element whose label should be updated.
* @param translation - The translated text to set as the label.
*/
export declare const updateToggleElmLabel: (el: string, translation: string) => void;
/**
* Updates the text content of the page header's title element with the provided translation.
*
* @param translation - The translated string to set as the page title.
*
* @remarks
* This function selects the element with the class `.page-header` and then finds its child
* with the class `.page-title`, updating its text content to the given translation.
* It assumes that both elements exist in the DOM.
*/
export declare const pageHeaderUpdater: (translation: string) => void;