import { File, MetadataTemplateFieldTypeEnum } from '../../types/openapi'; export type EmbedLocation = 'ui_app' | 'canvas' | 'dsr' | 'admin_instance' | 'overlay_app' | 'canvas_section_execution' | 'canvas_drawer'; export interface AppRouteConfig { display_name?: string; icon?: string; [key: string]: unknown; } export type AppRoutesMap = Record; export type ModuleSettingsOption = { label: string; value: string; }; export type ModuleSettingsField = { type: MetadataTemplateFieldTypeEnum; name: string; label: string; help_text?: string; is_required?: boolean; options?: ModuleSettingsOption[]; /** * For SELECT fields whose options aren't known at publish time: a key the host resolves to a live * option list injected via `provide('dynamicFieldOptions', { : Option[] })`. The Embeddable * settings panel uses that resolved list in place of the field's static `options`. Used by assessment-canvas (T2.4): * `dynamic_options: 'assessments'` → the instance's assessments, forwarded by ld-app. */ dynamic_options?: string; }; export type ModuleSettingsSection = { label?: string; fields: ModuleSettingsField[]; }; export type ModuleSettings = { sections: ModuleSettingsSection[]; }; export type EmbeddedLocationProperties = { start_in_loading_mode?: boolean; }; export type EmbeddedAppShortcut = { id: string; order_override?: number; icon?: string; tooltip?: string; }; export type EmbeddedAppShortcutsDict = { fullscreen: EmbeddedAppShortcut[]; presentation: EmbeddedAppShortcut[]; edit: EmbeddedAppShortcut[]; }; export type Module = { enabled: boolean; headless?: boolean; auto_install?: boolean; /** * L&D-only marker (module.canvas). When true, the app is offered in the Add-Component / * Embeddable pickers ONLY where the host opts in via `provide('allowCourseOnlyApps', true)` — * i.e. the L&D course host — and hidden in normal sales / DSR canvases where it can't function. * Used by the assessment-canvas wrap app (T2.4 / PIT-6978). */ course_only?: boolean; entry?: string; settings?: ModuleSettings; defaults: { dimensions?: { width?: string; height?: string; }; settings?: Record; }; shortcuts: EmbeddedAppShortcutsDict; } & EmbeddedLocationProperties; type AppTypeJsonOptions = { dimensions?: { width?: number | string; height?: number | string; }; placement?: 'top-left' | 'top-center' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; mode_config?: { fullscreen?: { show?: boolean; icon?: string; order_override?: number; }; presentation?: { show?: boolean; icon?: string; order_override?: number; }; edit?: { show?: boolean; icon?: string; order_override?: number; }; }; }; export type AppJson = { name: string; display_name: string; icon?: string; type?: 'web'; provide?: ('ui' | 'account_browser' | 'scheduler' | 'postcall' | 'crm_shape' | 'multimedia_selector')[]; require?: 'crm'[]; version: string; description?: string; authors?: string[]; module: Record; app_type?: 'canvas-popup' | 'section-selector' | 'sharebox' | 'ui-global-popup'; app_options?: AppTypeJsonOptions; order_override?: number; has_multiple_routes?: boolean; configure_entry?: string; }; export type AppFile = File & { app_metadata?: AppJson; }; export type PitcherInfo = { accessToken: string; instanceId: string; apiOrigin: string; isAnyTypeOfAdmin: boolean; platform?: 'impact' | 'admin'; isOrgAdmin?: boolean; } | undefined; export {};