Skip to content

Commit edacfe2

Browse files
committed
Replaced instances of InstanceType with vue.ComponentPublicInstance.
1 parent e1cf852 commit edacfe2

5 files changed

Lines changed: 17 additions & 13 deletions

File tree

src/renderer/src/components/MainMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ const items = [
152152
153153
// A few things that can only be done when the component is mounted.
154154
155-
const menuBarRef = vue.ref<(InstanceType<typeof Menubar> & { hide: () => void }) | null>(null);
155+
const menuBarRef = vue.ref<(vue.ComponentPublicInstance<typeof Menubar> & { hide: () => void }) | null>(null);
156156
157157
vue.onMounted(() => {
158158
if (menuBarRef.value) {
159159
// Ensure that the menubar never gets the 'p-menubar-mobile' class, which would turn it into a hamburger menu.
160160
161-
const menuBarElement = menuBarRef.value.$el as HTMLElement;
161+
const menuBarElement = menuBarRef.value.$el;
162162
const mutationObserver = new MutationObserver(() => {
163163
if (menuBarElement.classList.contains('p-menubar-mobile')) {
164164
menuBarElement.classList.remove('p-menubar-mobile');

src/renderer/src/components/OpenCOR.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ const props = defineProps<IOpenCORProps>();
141141
142142
const { isDialogActive } = provideDialogState();
143143
144-
const blockUiRef = vue.ref<InstanceType<typeof BlockUI> | null>(null);
145-
const mainMenuRef = vue.ref<InstanceType<typeof MainMenu> | null>(null);
144+
const blockUiRef = vue.ref<vue.ComponentPublicInstance<typeof BlockUI> | null>(null);
145+
const mainMenuRef = vue.ref<vue.ComponentPublicInstance<typeof MainMenu> | null>(null);
146146
const filesRef = vue.ref<HTMLElement | null>(null);
147-
const contentsRef = vue.ref<InstanceType<typeof ContentsComponent> | null>(null);
147+
const contentsRef = vue.ref<vue.ComponentPublicInstance<typeof ContentsComponent> | null>(null);
148148
const issues = vue.ref<locApi.IIssue[]>([]);
149149
const compIssues = vue.computed(() => {
150150
return [...initialisation.issues.value, ...issues.value];

src/renderer/src/components/dialogs/SimulationExperimentViewSettingsDialog.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,9 @@ const emit = defineEmits<{
787787
const DEFAULT_TAB = 'interactive';
788788
const DEFAULT_INTERACTIVE_TAB = 'simulationInputs';
789789
790-
const simulationSettingsIssuesPopoverRef = vue.ref<InstanceType<typeof Popover> | null>(null);
791-
const solversSettingsIssuesPopoverRef = vue.ref<InstanceType<typeof Popover> | null>(null);
792-
const uiJsonIssuesPopoverRef = vue.ref<InstanceType<typeof Popover> | null>(null);
790+
const simulationSettingsIssuesPopoverRef = vue.ref<vue.ComponentPublicInstance<typeof Popover> | null>(null);
791+
const solversSettingsIssuesPopoverRef = vue.ref<vue.ComponentPublicInstance<typeof Popover> | null>(null);
792+
const uiJsonIssuesPopoverRef = vue.ref<vue.ComponentPublicInstance<typeof Popover> | null>(null);
793793
const activeTab = vue.ref(DEFAULT_TAB);
794794
const activeInteractiveTab = vue.ref(DEFAULT_INTERACTIVE_TAB);
795795
const showSimulationSettingsIssuesPanel = vue.ref(false);

src/renderer/src/components/views/SimulationExperimentView.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
:title="`Change ${run.isLiveRun ? 'live run' : 'run'} colour`"
166166
@click="onToggleRunColorPopover(index, $event)"
167167
/>
168-
<Popover :ref="(element: any) => interactiveRunColorPopoverRefs[index] = element as unknown as InstanceType<typeof Popover> ?? undefined"
168+
<Popover :ref="(element: any) => interactiveRunColorPopoverRefs[index] = element as unknown as vue.ComponentPublicInstance<typeof Popover> ?? undefined"
169169
v-if="interactiveRunColorPopoverIndex === index"
170170
>
171171
<div class="flex gap-2">
@@ -212,7 +212,7 @@
212212
<IssuesView v-show="interactiveInstanceIssues.length" class="mt-4 mr-4" style="height: calc(100% - 2rem);" :issues="interactiveInstanceIssues" />
213213
<GraphPanelWidget v-show="!interactiveInstanceIssues.length"
214214
v-for="(_plot, index) in interactiveUiJson.output.plots"
215-
:ref="(element: any) => interactiveGraphPanelRefs[index] = element as unknown as InstanceType<typeof GraphPanelWidget> ?? undefined"
215+
:ref="(element: any) => interactiveGraphPanelRefs[index] = element as unknown as vue.ComponentPublicInstance<typeof GraphPanelWidget> ?? undefined"
216216
:key="`plot_${index}`"
217217
class="w-full min-h-0"
218218
:margins="interactiveCompMargins"
@@ -543,8 +543,12 @@ const interactiveRuns = vue.ref<ISimulationRun[]>([
543543
}
544544
]);
545545
const interactiveRunColorPopoverIndex = vue.ref<number>(-1);
546-
const interactiveRunColorPopoverRefs = vue.ref<Record<number, InstanceType<typeof Popover> | undefined>>({});
547-
const interactiveGraphPanelRefs = vue.ref<Record<number, InstanceType<typeof GraphPanelWidget> | undefined>>({});
546+
const interactiveRunColorPopoverRefs = vue.ref<Record<number, vue.ComponentPublicInstance<typeof Popover> | undefined>>(
547+
{}
548+
);
549+
const interactiveGraphPanelRefs = vue.ref<
550+
Record<number, vue.ComponentPublicInstance<typeof GraphPanelWidget> | undefined>
551+
>({});
548552
const interactiveCompData = vue.computed(() => {
549553
// Combine the live data with the data from the tracked runs.
550554

src/renderer/src/components/widgets/GraphPanelWidget.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const mainDivRef = vue.ref<HTMLElement | null>(null);
8989
const isVisible = vue.ref(false);
9090
const margins = vue.ref<IGraphPanelMargins>({ left: -1, right: -1 });
9191
const theme = vueCommon.useTheme();
92-
const contextMenuRef = vue.ref<InstanceType<typeof ContextMenu> | null>(null);
92+
const contextMenuRef = vue.ref<vue.ComponentPublicInstance<typeof ContextMenu> | null>(null);
9393
let updatingMargins = false;
9494
const progressMessage = vue.inject<IProgressMessage>('progressMessage');
9595

0 commit comments

Comments
 (0)