@cds/core
Version:
Clarity Design System - common components, themes, and utilties
34 lines (33 loc) • 1.13 kB
TypeScript
import { LitElement } from 'lit';
/**
* This decorator stores the i18n strings in a private variable __i18n.
* Due to TypeScript decorators being dynamic a type cast is needed here.
*/
declare type I18nElement = LitElement & {
__i18n: Record<string, unknown>;
__i18nKey: string;
};
/**
* A property decorator which accesses a set of string values for use
* inside the element's template. The values can be overridden at runtime
* by changing the property value that's reflected through the attribute value.
*
* @example
*
* class MyElement {
* @i18n()
* i18n = {
* "open" : "Open my element",
* "close" : "Close my element"
* };
* }
*
*/
export declare function i18n(): (protoOrDescriptor: any, name: string) => any;
export declare function getI18nValues(values: Record<string, unknown>, component: I18nElement): Record<string, unknown>;
export declare function getI18nUpdateStrategy(newKey: string, oldKey: string, newValues: Record<string, unknown>, oldValues: Record<string, unknown>): {
values?: object;
key?: string;
update: boolean;
};
export {};