diff --git a/packages/iobroker.vis-2/src/src/Attributes/index.tsx b/packages/iobroker.vis-2/src/src/Attributes/index.tsx index 124d8fc6..b4b5fa12 100644 --- a/packages/iobroker.vis-2/src/src/Attributes/index.tsx +++ b/packages/iobroker.vis-2/src/src/Attributes/index.tsx @@ -20,7 +20,7 @@ import { type LegacyConnection, } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import type { VisTheme } from '@iobroker/types-vis-2'; import commonStyles from '@/Utils/styles'; import CSS from './CSS'; @@ -49,20 +49,20 @@ interface AttributesProps { adapterName: string; instance: number; projectName: string; - saveCssFile: EditorClass['saveCssFile']; + saveCssFile: Editor['saveCssFile']; editMode: boolean; onHide: (hide: boolean) => void; adapterId: string; - userGroups: EditorClass['state']['userGroups']; + userGroups: Editor['state']['userGroups']; selectedWidgets: string[]; widgetsLoaded: boolean; selectedView: string; - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; socket: LegacyConnection; fonts: string[]; - cssClone: EditorClass['cssClone']; - onPxToPercent: EditorClass['onPxToPercent']; - onPercentToPx: EditorClass['onPercentToPx']; + cssClone: Editor['cssClone']; + onPxToPercent: Editor['onPxToPercent']; + onPercentToPx: Editor['onPercentToPx']; theme: VisTheme; } diff --git a/packages/iobroker.vis-2/src/src/Editor.tsx b/packages/iobroker.vis-2/src/src/Editor.tsx index c365d8c5..a90c8d91 100644 --- a/packages/iobroker.vis-2/src/src/Editor.tsx +++ b/packages/iobroker.vis-2/src/src/Editor.tsx @@ -162,9 +162,9 @@ const styles: Record = { interface ViewDropProps { // eslint-disable-next-line no-use-before-define - addMarketplaceWidget: EditorClass['addMarketplaceWidget']; + addMarketplaceWidget: Editor['addMarketplaceWidget']; // eslint-disable-next-line no-use-before-define - addWidget: EditorClass['addWidget']; + addWidget: Editor['addWidget']; editMode: boolean; children: React.JSX.Element; } @@ -2211,6 +2211,4 @@ class Editor extends Runtime { } } -export type EditorClass = Editor; - export default Editor; diff --git a/packages/iobroker.vis-2/src/src/Palette/index.tsx b/packages/iobroker.vis-2/src/src/Palette/index.tsx index ebfdf69a..75ea1f99 100644 --- a/packages/iobroker.vis-2/src/src/Palette/index.tsx +++ b/packages/iobroker.vis-2/src/src/Palette/index.tsx @@ -33,7 +33,7 @@ import type { WidgetType } from '@/Vis/visWidgetsCatalog'; import { getWidgetTypes } from '@/Vis/visWidgetsCatalog'; import { loadComponent } from '@/Vis/visLoadWidgets'; import commonStyles from '@/Utils/styles'; -import type { EditorClass } from '../Editor'; +import type Editor from '../Editor'; import Widget from './Widget'; import MarketplacePalette from '../Marketplace/MarketplacePalette'; @@ -144,11 +144,11 @@ interface WidgetSetProps { interface PaletteProps { onHide: (hide: boolean) => void; - changeView: EditorClass['changeView']; - changeProject: EditorClass['changeProject']; - uninstallWidget: EditorClass['uninstallWidget']; - setMarketplaceDialog: EditorClass['setMarketplaceDialog']; - updateWidgets: EditorClass['updateWidgets']; + changeView: Editor['changeView']; + changeProject: Editor['changeProject']; + uninstallWidget: Editor['uninstallWidget']; + setMarketplaceDialog: Editor['setMarketplaceDialog']; + updateWidgets: Editor['updateWidgets']; widgetsLoaded: boolean; socket: LegacyConnection; themeType: ThemeType; diff --git a/packages/iobroker.vis-2/src/src/Runtime.tsx b/packages/iobroker.vis-2/src/src/Runtime.tsx index 4aa6c4b9..0077e6d6 100644 --- a/packages/iobroker.vis-2/src/src/Runtime.tsx +++ b/packages/iobroker.vis-2/src/src/Runtime.tsx @@ -117,8 +117,9 @@ export interface RuntimeState extends GenericAppState { declare global { interface Window { - sentryDSN: string; - disableDataReporting: boolean; + sentryDSN?: string; + disableDataReporting?: boolean; + visAdapterInstance?: number; } } @@ -261,6 +262,7 @@ class Runtime

{ interface ImportProjectDialogProps { onClose: (isYes?: boolean, projectName?: string) => void; projectName: string; - refreshProjects: EditorClass['refreshProjects']; + refreshProjects: Editor['refreshProjects']; socket: LegacyConnection; themeType: ThemeType; - loadProject: EditorClass['loadProject']; + loadProject: Editor['loadProject']; adapterName: string; instance: number; openNewProjectOnCreate?: boolean; diff --git a/packages/iobroker.vis-2/src/src/Toolbar/ProjectsManager/index.tsx b/packages/iobroker.vis-2/src/src/Toolbar/ProjectsManager/index.tsx index baf3166e..e4854f8f 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/ProjectsManager/index.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/ProjectsManager/index.tsx @@ -17,7 +17,7 @@ import { BiImport, BiExport } from 'react-icons/bi'; import { I18n, type ThemeType, type LegacyConnection } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import type { VisTheme } from '@iobroker/types-vis-2'; import commonStyles from '@/Utils/styles'; import IODialog from '../../Components/IODialog'; @@ -62,22 +62,22 @@ const styles: Record = { }; interface ProjectsManageProps { - addProject: EditorClass['addProject']; - loadProject: EditorClass['loadProject']; + addProject: Editor['addProject']; + loadProject: Editor['loadProject']; onClose: () => void; open: boolean; projects: string[]; projectName: string; - refreshProjects: EditorClass['refreshProjects']; + refreshProjects: Editor['refreshProjects']; socket: LegacyConnection; themeType: ThemeType; theme: VisTheme; adapterName: string; instance: number; selectedView: string; - changeProject: EditorClass['changeProject']; - deleteProject: EditorClass['deleteProject']; - renameProject: EditorClass['renameProject']; + changeProject: Editor['changeProject']; + deleteProject: Editor['deleteProject']; + renameProject: Editor['renameProject']; } const ProjectsManage: React.FC = props => { diff --git a/packages/iobroker.vis-2/src/src/Toolbar/Settings.tsx b/packages/iobroker.vis-2/src/src/Toolbar/Settings.tsx index 1de5c7f7..00268494 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/Settings.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/Settings.tsx @@ -18,7 +18,7 @@ import { Save as SaveIcon } from '@mui/icons-material'; import type { LegacyConnection } from '@iobroker/adapter-react-v5'; import { I18n } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import { store } from '@/Store'; import { deepClone } from '@/Utils/utils'; import type { ProjectSettings } from '@iobroker/types-vis-2'; @@ -67,7 +67,7 @@ interface SettingsFieldNumber extends SettingsFieldBase { type SettingsField = SettingsFieldSelect | SettingsFieldRaw | SettingsFieldCheckbox | SettingsFieldSwitchMode | SettingsFieldNumber; interface SettingsProps { - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; onClose: () => void; socket: LegacyConnection; adapterName: string; diff --git a/packages/iobroker.vis-2/src/src/Toolbar/ToolbarItems.tsx b/packages/iobroker.vis-2/src/src/Toolbar/ToolbarItems.tsx index ed67ea23..e6de65b8 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/ToolbarItems.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/ToolbarItems.tsx @@ -20,7 +20,7 @@ import { I18n, type ThemeType } from '@iobroker/adapter-react-v5'; import { deepClone } from '@/Utils/utils'; import type { ViewSettings, VisTheme } from '@iobroker/types-vis-2'; import { store } from '@/Store'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import commonStyles from '@/Utils/styles'; import MultiSelect from './MultiSelect'; @@ -130,11 +130,11 @@ interface ToolbarItemsProps { last?: boolean; toolbarHeight: 'full' | 'narrow' | 'veryNarrow'; // eslint-disable-next-line react/no-unused-prop-types - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; // eslint-disable-next-line react/no-unused-prop-types selectedView: string; // eslint-disable-next-line react/no-unused-prop-types - setSelectedWidgets: EditorClass['setSelectedWidgets']; + setSelectedWidgets: Editor['setSelectedWidgets']; } // eslint-disable-next-line no-use-before-define diff --git a/packages/iobroker.vis-2/src/src/Toolbar/Views.tsx b/packages/iobroker.vis-2/src/src/Toolbar/Views.tsx index 1572a19b..699e36b2 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/Views.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/Views.tsx @@ -14,7 +14,7 @@ import { import type { ThemeName, ThemeType } from '@iobroker/adapter-react-v5'; import { I18n } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import type { VisTheme } from '@iobroker/types-vis-2'; import commonStyles from '@/Utils/styles'; import ViewsManager from './ViewsManager'; @@ -40,19 +40,19 @@ const styles: Record = { interface ViewsProps { projectName: string; selectedView: string; - setViewsManager: EditorClass['setViewsManager']; + setViewsManager: Editor['setViewsManager']; viewsManager: boolean; selectedGroup: string; editMode: boolean; - setProjectsDialog: EditorClass['setProjectsDialog']; - changeProject: EditorClass['changeProject']; + setProjectsDialog: Editor['setProjectsDialog']; + changeProject: Editor['changeProject']; theme: VisTheme; - changeView: EditorClass['changeView']; - setSelectedWidgets: EditorClass['setSelectedWidgets']; + changeView: Editor['changeView']; + setSelectedWidgets: Editor['setSelectedWidgets']; themeType: ThemeType; toolbarHeight: 'full' | 'narrow' | 'veryNarrow'; themeName: ThemeName; - toggleView: EditorClass['toggleView']; + toggleView: Editor['toggleView']; } const Views = (props: ViewsProps) => { diff --git a/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/FolderDialog.tsx b/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/FolderDialog.tsx index 5206812c..28bde319 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/FolderDialog.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/FolderDialog.tsx @@ -10,7 +10,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import { I18n } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import React from 'react'; import { deepClone } from '@/Utils/utils'; import IODialog from '../../Components/IODialog'; @@ -18,7 +18,7 @@ import { useFocus } from '../../Utils'; import { store } from '../../Store'; interface FolderDialogProps { - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; dialog: 'add' | 'rename' | 'delete'; dialogFolder: string; dialogName: string; diff --git a/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/index.tsx b/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/index.tsx index 584e5519..79338ab6 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/index.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/ViewsManager/index.tsx @@ -16,7 +16,7 @@ import { BiImport } from 'react-icons/bi'; import { I18n, type ThemeName, type ThemeType } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import type { View as ViewType, AnyWidgetId, VisTheme, @@ -68,7 +68,7 @@ const styles: Record = { }; interface ViewsManagerProps { - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; name?: string; onClose: () => void; open: boolean; @@ -81,7 +81,7 @@ interface ViewsManagerProps { themeName: ThemeName; themeType: ThemeType; theme: VisTheme; - toggleView: EditorClass['toggleView']; + toggleView: Editor['toggleView']; editMode: boolean; selectedView: string; } diff --git a/packages/iobroker.vis-2/src/src/Toolbar/WidgetFilterDialog.tsx b/packages/iobroker.vis-2/src/src/Toolbar/WidgetFilterDialog.tsx index d9b39aa0..81440a80 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/WidgetFilterDialog.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/WidgetFilterDialog.tsx @@ -20,12 +20,12 @@ import { } from '@mui/icons-material'; import { I18n } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import type { AnyWidgetId } from '@iobroker/types-vis-2'; import { store } from '../Store'; interface WidgetFilterDialogProps { - changeProject: EditorClass['changeProject']; + changeProject: Editor['changeProject']; onClose: () => void; selectedView: string; } diff --git a/packages/iobroker.vis-2/src/src/Toolbar/Widgets.tsx b/packages/iobroker.vis-2/src/src/Toolbar/Widgets.tsx index d6299846..ac0b99bd 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/Widgets.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/Widgets.tsx @@ -26,7 +26,7 @@ import { import type { ThemeType } from '@iobroker/adapter-react-v5'; import { I18n } from '@iobroker/adapter-react-v5'; import type { AnyWidgetId, GroupWidgetId, VisTheme } from '@iobroker/types-vis-2'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import { store } from '../Store'; import type { ToolbarItem } from './ToolbarItems'; @@ -41,27 +41,27 @@ interface WidgetsProps { themeType: ThemeType; selectedView: string; selectedWidgets: AnyWidgetId[]; - setSelectedWidgets: EditorClass['setSelectedWidgets']; + setSelectedWidgets: Editor['setSelectedWidgets']; selectedGroup: GroupWidgetId; editMode: boolean; lockDragging: boolean; widgetHint: string; historyCursor: number; - history: EditorClass['state']['history']; + history: Editor['state']['history']; widgetsLoaded: boolean; - changeProject: EditorClass['changeProject']; - deleteWidgets: EditorClass['deleteWidgets']; - cloneWidgets: EditorClass['cloneWidgets']; - cutWidgets: EditorClass['cutWidgets']; - copyWidgets: EditorClass['copyWidgets']; - pasteWidgets: EditorClass['pasteWidgets']; - undo: EditorClass['undo']; - redo: EditorClass['redo']; - alignWidgets: EditorClass['alignWidgets']; - orderWidgets: EditorClass['orderWidgets']; - toggleLockDragging: EditorClass['toggleLockDragging']; - toggleWidgetHint: EditorClass['toggleWidgetHint']; - widgetsClipboard: EditorClass['state']['widgetsClipboard']; + changeProject: Editor['changeProject']; + deleteWidgets: Editor['deleteWidgets']; + cloneWidgets: Editor['cloneWidgets']; + cutWidgets: Editor['cutWidgets']; + copyWidgets: Editor['copyWidgets']; + pasteWidgets: Editor['pasteWidgets']; + undo: Editor['undo']; + redo: Editor['redo']; + alignWidgets: Editor['alignWidgets']; + orderWidgets: Editor['orderWidgets']; + toggleLockDragging: Editor['toggleLockDragging']; + toggleWidgetHint: Editor['toggleWidgetHint']; + widgetsClipboard: Editor['state']['widgetsClipboard']; toolbarHeight: 'full' | 'narrow' | 'veryNarrow'; theme: VisTheme; } diff --git a/packages/iobroker.vis-2/src/src/Toolbar/index.tsx b/packages/iobroker.vis-2/src/src/Toolbar/index.tsx index 839900d8..4804e169 100644 --- a/packages/iobroker.vis-2/src/src/Toolbar/index.tsx +++ b/packages/iobroker.vis-2/src/src/Toolbar/index.tsx @@ -32,7 +32,7 @@ import { ToggleThemeMenu, } from '@iobroker/adapter-react-v5'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import commonStyles from '@/Utils/styles'; import type { AnyWidgetId, GroupWidgetId, VisTheme } from '@iobroker/types-vis-2'; import Views from './Views'; @@ -88,53 +88,53 @@ const styles: Record = { interface ToolbarProps { adapterName: string; - addProject: EditorClass['addProject']; - alignWidgets: EditorClass['alignWidgets']; - changeProject: EditorClass['changeProject']; - changeView: EditorClass['changeView']; - cloneWidgets: EditorClass['cloneWidgets']; - copyWidgets: EditorClass['copyWidgets']; + addProject: Editor['addProject']; + alignWidgets: Editor['alignWidgets']; + changeProject: Editor['changeProject']; + changeView: Editor['changeView']; + cloneWidgets: Editor['cloneWidgets']; + copyWidgets: Editor['copyWidgets']; currentUser: Record; - cutWidgets: EditorClass['cutWidgets']; - deleteProject: EditorClass['deleteProject']; - deleteWidgets: EditorClass['deleteWidgets']; + cutWidgets: Editor['cutWidgets']; + deleteProject: Editor['deleteProject']; + deleteWidgets: Editor['deleteWidgets']; editMode: boolean; - history: EditorClass['state']['history']; - historyCursor: EditorClass['state']['historyCursor']; + history: Editor['state']['history']; + historyCursor: Editor['state']['historyCursor']; instance: number; - loadProject: EditorClass['loadProject']; + loadProject: Editor['loadProject']; lockDragging: boolean; needSave: boolean; openedViews: string[]; - orderWidgets: EditorClass['orderWidgets']; - pasteWidgets: EditorClass['pasteWidgets']; + orderWidgets: Editor['orderWidgets']; + pasteWidgets: Editor['pasteWidgets']; projectName: string; projects: string[]; projectsDialog: boolean; - redo: EditorClass['redo']; - refreshProjects: EditorClass['refreshProjects']; - renameProject: EditorClass['renameProject']; + redo: Editor['redo']; + refreshProjects: Editor['refreshProjects']; + renameProject: Editor['renameProject']; selectedGroup: GroupWidgetId; selectedView: string; selectedWidgets: AnyWidgetId[]; - setProjectsDialog: EditorClass['setProjectsDialog']; - setSelectedWidgets: EditorClass['setSelectedWidgets']; + setProjectsDialog: Editor['setProjectsDialog']; + setSelectedWidgets: Editor['setSelectedWidgets']; setToolbarHeight: (value: 'narrow' | 'veryNarrow' | 'full') => void; - setViewsManager: EditorClass['setViewsManager']; + setViewsManager: Editor['setViewsManager']; socket: LegacyConnection; theme: VisTheme; themeName: ThemeName; themeType: ThemeType; - toggleLockDragging: EditorClass['toggleLockDragging']; - toggleTheme: EditorClass['toggleTheme']; - toggleView: EditorClass['toggleView']; - toggleWidgetHint: EditorClass['toggleWidgetHint']; + toggleLockDragging: Editor['toggleLockDragging']; + toggleTheme: Editor['toggleTheme']; + toggleView: Editor['toggleView']; + toggleWidgetHint: Editor['toggleWidgetHint']; toolbarHeight: 'full' | 'narrow' | 'veryNarrow'; - undo: EditorClass['undo']; + undo: Editor['undo']; version: string; viewsManager: boolean; widgetHint: string; - widgetsClipboard: EditorClass['state']['widgetsClipboard']; + widgetsClipboard: Editor['state']['widgetsClipboard']; widgetsLoaded: boolean; } diff --git a/packages/iobroker.vis-2/src/src/Vis/visContextMenu.tsx b/packages/iobroker.vis-2/src/src/Vis/visContextMenu.tsx index 37f6dbca..6cfb3f9b 100644 --- a/packages/iobroker.vis-2/src/src/Vis/visContextMenu.tsx +++ b/packages/iobroker.vis-2/src/src/Vis/visContextMenu.tsx @@ -28,7 +28,7 @@ import type { View, Widget, } from '@iobroker/types-vis-2'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import IOContextMenu from '../Components/IOContextMenu'; import WidgetExportDialog from '../Toolbar/WidgetExportDialog'; import WidgetImportDialog from '../Toolbar/WidgetImportDialog'; @@ -53,7 +53,7 @@ interface VisContextMenuProps { ungroupWidgets: () => void; widgetsClipboard: Record; themeType: ThemeType; - setMarketplaceDialog: EditorClass['setMarketplaceDialog']; + setMarketplaceDialog: Editor['setMarketplaceDialog']; } export interface VisMarketplaceProps { diff --git a/packages/iobroker.vis-2/src/src/Vis/visEngine.tsx b/packages/iobroker.vis-2/src/src/Vis/visEngine.tsx index 5a8c2be6..b45e504d 100644 --- a/packages/iobroker.vis-2/src/src/Vis/visEngine.tsx +++ b/packages/iobroker.vis-2/src/src/Vis/visEngine.tsx @@ -60,7 +60,7 @@ import type { VisLegacy, VisLinkContext, VisLinkContextBinding, VisLinkContextItem, VisTheme, VisFormatUtils as VisFormatUtilsType, } from '@iobroker/types-vis-2'; -import type { EditorClass } from '@/Editor'; +import type Editor from '@/Editor'; import { deepClone } from '@/Utils/utils'; import type JQuery from 'jquery'; import './visWords'; @@ -143,25 +143,25 @@ interface VisEngineProps { themeName: ThemeName; theme: VisTheme; adapterId: string; - userGroups: EditorClass['state']['userGroups']; + userGroups: Editor['state']['userGroups']; widgetsLoaded: number; lockDragging: boolean; disableInteraction: boolean; - registerEditorCallback: EditorClass['registerCallback']; - setSelectedWidgets: EditorClass['setSelectedWidgets']; - onWidgetsChanged: EditorClass['onWidgetsChanged']; - showLegacyFileSelector: EditorClass['showLegacyFileSelector']; - setLoadingText: EditorClass['setLoadingText']; - onFontsUpdate: EditorClass['onFontsUpdate']; - setSelectedGroup: EditorClass['setSelectedGroup']; + registerEditorCallback: Editor['registerCallback']; + setSelectedWidgets: Editor['setSelectedWidgets']; + onWidgetsChanged: Editor['onWidgetsChanged']; + showLegacyFileSelector: Editor['showLegacyFileSelector']; + setLoadingText: Editor['setLoadingText']; + onFontsUpdate: Editor['onFontsUpdate']; + setSelectedGroup: Editor['setSelectedGroup']; onConfirmDialog: (message: string, title: string, icon: string, width: number, callback: (isYes: boolean) => void) => void; onShowCode: (code: string, title: string, mode: string) => void; - renderAlertDialog: EditorClass['renderAlertDialog']; - toggleTheme: EditorClass['toggleTheme']; - askAboutInclude: EditorClass['askAboutInclude']; - changeProject: EditorClass['changeProject']; + renderAlertDialog: Editor['renderAlertDialog']; + toggleTheme: Editor['toggleTheme']; + askAboutInclude: Editor['askAboutInclude']; + changeProject: Editor['changeProject']; onLoaded: () => void; - onIgnoreMouseEvents: EditorClass['onIgnoreMouseEvents']; + onIgnoreMouseEvents: Editor['onIgnoreMouseEvents']; } interface VisEngineState { diff --git a/packages/iobroker.vis-2/src/src/bootstrap.tsx b/packages/iobroker.vis-2/src/src/bootstrap.tsx index a48cbb42..fa0be5f6 100644 --- a/packages/iobroker.vis-2/src/src/bootstrap.tsx +++ b/packages/iobroker.vis-2/src/src/bootstrap.tsx @@ -2,17 +2,29 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; import { Utils } from '@iobroker/adapter-react-v5'; + +import type VisRxWidget from '@/Vis/visRxWidget'; import './index.css'; import App from './Editor'; import * as serviceWorker from './serviceWorker'; import packageJson from './version.json'; +declare global { + interface Window { + adapterName: string; + visRxWidget?: typeof VisRxWidget; + disableDataReporting?: boolean; + sentryDSN?: string; + visConfigLoaded?: Promise; + } +} + window.adapterName = 'vis-2'; console.log(`iobroker.${window.adapterName}@${packageJson.version}`); import('./Vis/visRxWidget') - .then(VisRxWidget => window.visRxWidget = VisRxWidget.default); + .then(_VisRxWidget => window.visRxWidget = _VisRxWidget.default); function modifyClasses(className: string, addClass?: string, removeClass?: string): string { const classes = (className || '').split(' ').map(c => c.trim()).filter(c => c); diff --git a/packages/iobroker.vis-2/src/src/global.d.ts b/packages/iobroker.vis-2/src/src/global.d.ts index 80b88fa9..81d9c2d4 100644 --- a/packages/iobroker.vis-2/src/src/global.d.ts +++ b/packages/iobroker.vis-2/src/src/global.d.ts @@ -4,9 +4,12 @@ import type VisRxWidget from '@/Vis/visRxWidget'; declare global { interface Window { webkitSpeechRecognition?: SpeechRecognition; + adapterName: string; /** The vis-2 adapter instance */ visAdapterInstance?: number; - visRxWidget?: VisRxWidget; + visRxWidget?: typeof VisRxWidget; visConfigLoaded?: Promise; + sentryDSN?: string; + disableDataReporting?: boolean; } }