declare module "hub-dashboard-addons" { export type WidgetApi = (props: WidgetApiProps) => void; export type WidgetApiProps = { onRefresh?(): Promise; onConfigure?(): Promise; }; export interface HubService { id: string; applicationName: string; homeUrl: string; key: string; name: string; trusted: boolean; type: string; vendor: string; version: string; } type AlertType = "error" | "message" | "success" | "warning" | "loading"; export type DashboardApi = { setTitle(label: string, labelUri?: string): Promise; setLoadingAnimationEnabled(enabled: boolean): Promise; alert( message: string, type?: AlertType, timeout?: number, options?: object, ): string | number; setError(e: Error): Promise; clearError(): Promise; enterConfigMode(): Promise; exitConfigMode(): Promise; readCache(): Promise; storeCache(cache: object): Promise; readConfig(): Promise; storeConfig(config: object): Promise; fetch(serviceID: string, url: string, fetchConfig?: object): Promise; fetchHub(url: string, fetchConfig?: object): Promise; downloadFile( serviceID: string, relativeURL: string, requestParams: unknown, fileName?: string, ): Promise; loadServices(applicationName: string): Promise; removeWidget(): void; }; const addon: { locale: string; editable: boolean; registerWidget: ( widget: ( dashboardApi: DashboardApi, widgetApi: WidgetApi, ) => Promise, ) => void; }; export default addon; } declare module "hub-dashboard-addons/dist/localization" { interface Dictionary { [key: string]: string | Record; } interface Translations { [lang: string]: Dictionary; } export const i18n: { ( text: string, interpolationObject?: Record, numberForPlurals?: number, context?: string, ): string; plural( count: number, textForUnique: string, textForPlural: string, interpolationObject?: Record, context?: string, ): string; }; export const i18nTimeIdentifiers: Record; export function setLocale(lang: string, translations: Translations): void; }