UNPKG

@lion/ui

Version:

A package of extendable web components

66 lines 2.77 kB
import { Constructor } from '@open-wc/dedupe-mixin'; import { LitElement } from 'lit'; import { DirectiveResult } from 'lit/directive.js'; import { LocalizeManager } from '../src/LocalizeManager.js'; export interface FormatNumberPart { type: string; value: string; } declare function DatePostProcessorImplementation(date: string): string; export type DatePostProcessor = typeof DatePostProcessorImplementation; export declare interface FormatDateOptions extends Intl.DateTimeFormatOptions { locale?: string; calendar?: string; numberingSystem?: string; timeZone?: string; roundMode?: string; returnIfNaN?: string; mode?: 'pasted' | 'auto' | 'user-edited'; postProcessors?: Map<string, DatePostProcessor>; } declare function NumberPostProcessorImplementation(number: string): string; export type NumberPostProcessor = typeof NumberPostProcessorImplementation; export declare interface FormatNumberOptions extends Intl.NumberFormatOptions { locale?: string; numberingSystem?: string; roundMode?: string; returnIfNaN?: string; decimalSeparator?: ',' | '.'; groupSeparator?: ',' | '.' | ' ' | '_' | ' ' | "'"; mode?: 'pasted' | 'auto' | 'user-edited'; viewValueStates?: 'formatted'[]; postProcessors?: Map<string, NumberPostProcessor>; } export interface StringToFunctionMap { [key: string]: Function; } export type NamespaceObject = StringToFunctionMap | string; export interface msgVariables { [key: string]: unknown; } export interface msgOptions { locale?: string; } export declare class LocalizeMixinHost { static get localizeNamespaces(): NamespaceObject[]; static get waitForLocalizeNamespaces(): boolean; localizeNamespacesLoaded: Promise<Object> | undefined; onLocaleReady(): void; onLocaleChanged(newLocale: string, oldLocale: string): void; onLocaleUpdated(): void; connectedCallback(): void; disconnectedCallback(): void; msgLit(keys: string | string[], variables?: msgVariables, options?: msgOptions): string | DirectiveResult; protected _localizeManager: LocalizeManager; private __boundLocalizeOnLocaleChanged; private __boundLocalizeOnLocaleChanging; private __getUniqueNamespaces; private __localizeOnLocaleChanged; private __localizeMessageSync; private __localizeStartLoadingNamespaces; private __localizeOnLocaleChanging; } declare function LocalizeMixinImplementation<T extends Constructor<LitElement>>(superclass: T): T & Constructor<LocalizeMixinHost> & Pick<typeof LocalizeMixinHost, keyof typeof LocalizeMixinHost> & Pick<typeof LitElement, keyof typeof LitElement>; export type LocalizeMixin = typeof LocalizeMixinImplementation; export {}; //# sourceMappingURL=LocalizeMixinTypes.d.ts.map