diff --git a/packages/core/src/editor/types.ts b/packages/core/src/editor/types.ts index 47811ee26..012cf8402 100644 --- a/packages/core/src/editor/types.ts +++ b/packages/core/src/editor/types.ts @@ -6,6 +6,7 @@ import { CommandEvent, CommandsEventCallback } from '../commands/types'; import { DataSourceEvent, DataSourcesEventCallback } from '../data_sources/types'; import { DeviceEvent, DevicesEventCallback } from '../device_manager/types'; import { ComponentEvent } from '../dom_components'; +import { I18nEvent, I18nEventCallback } from '../i18n/types'; import { KeymapEvent } from '../keymaps'; import { ModalEvent } from '../modal_dialog'; import { RichTextEditorEvent } from '../rich_text_editor'; @@ -19,6 +20,7 @@ type GeneralEvent = 'canvasScroll' | 'undo' | 'redo' | 'load' | 'update'; type EditorBuiltInEvents = | DataSourceEvent | DeviceEvent + | I18nEvent | ComponentEvent | BlockEvent | AssetEvent @@ -44,7 +46,8 @@ export interface EditorEventCallbacks CanvasEventCallback, CommandsEventCallback, DataSourcesEventCallback, - DevicesEventCallback + DevicesEventCallback, + I18nEventCallback { [key: string]: any[]; } diff --git a/packages/core/src/i18n/types.ts b/packages/core/src/i18n/types.ts index 90f4527f5..ef31073d2 100644 --- a/packages/core/src/i18n/types.ts +++ b/packages/core/src/i18n/types.ts @@ -27,5 +27,13 @@ export enum I18nEvents { } /**{END_EVENTS}*/ +export type I18nEvent = `${I18nEvents}`; + +export interface I18nEventCallback { + [I18nEvents.add]: [Messages]; + [I18nEvents.update]: [Messages]; + [I18nEvents.locale]: [{ value: string; valuePrev: string | undefined }]; +} + // need this to avoid the TS documentation generator to break export default I18nEvents;