Skip to content

Commit 1cfc533

Browse files
committed
resolved issues in ImportComponent
1 parent 9dc4a45 commit 1cfc533

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/components/left-sidebar/ComponentTab/ImportComponent.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useCreateComponent } from "../../composables/useCreateComponent.js";
1616
// import * as fs from "fs";
1717
import { Component, HtmlElement, HtmlElementMap } from "../../../../types";
1818
// @ts-ignore
19-
const { fs, ipcRenderer } = window;
19+
const { fs, ipcRenderer } = window as any;
2020
const store = useStore();
2121
2222
const props = defineProps(["title"]);
@@ -72,7 +72,7 @@ const importComponent = () => {
7272
},
7373
],
7474
})
75-
.then((res: { filePaths: fs.PathOrFileDescriptor }) => {
75+
.then((res: { filePaths }) => {
7676
openVueFile(res.filePaths);
7777
alert("Successfully Imported");
7878
})
@@ -81,7 +81,7 @@ const importComponent = () => {
8181
8282
//parses script tag string for props
8383
const parsingStringToProps = (str: string) => {
84-
let props = [];
84+
let props: string[] = [];
8585
let split = str.split(" ");
8686
for (let i = 0; i < split.length; i++) {
8787
if (
@@ -267,8 +267,8 @@ const openVueFile = (data) => {
267267
//OverVue adds a <div></div> wrapper to all components. remove this before importing.
268268
269269
let groupings = findGroupings(htmlList);
270-
let groupingObj: { [key: string]: string[] } = objectGenerator(groupings);
271-
let groupingArray = [];
270+
let groupingObj: { [key: string]: HtmlElement } = objectGenerator(groupings);
271+
let groupingArray: HtmlElement[] = [];
272272
for (const key in groupingObj) {
273273
groupingArray.push(groupingObj[key]);
274274
}
@@ -338,7 +338,7 @@ const openVueFile = (data) => {
338338
339339
function findGroupings(array: string[]) {
340340
let count = 0; //tracks where the parent ends
341-
let stopIndexes = []; //an array that will be used to slice out the parent/child relationships
341+
let stopIndexes: number[] = []; //an array that will be used to slice out the parent/child relationships
342342
for (let i = 0; i < array.length; i++) {
343343
if (array[i][1] !== "/") {
344344
if (
@@ -360,7 +360,7 @@ const openVueFile = (data) => {
360360
stopIndexes.push(i);
361361
}
362362
}
363-
let groupings = [];
363+
let groupings: string[][] = [];
364364
let startIndex = 0;
365365
for (let i = 0; i < stopIndexes.length; i++) {
366366
groupings.push(array.slice(startIndex, stopIndexes[i] + 1));
@@ -390,7 +390,7 @@ const openVueFile = (data) => {
390390
if (array[i].length > 0) {
391391
const childGroupings = findGroupings(array[i]);
392392
const childrenObj = objectGenerator(childGroupings);
393-
const childrenArray = [];
393+
const childrenArray: any[] = [];
394394
for (const key in childrenObj) {
395395
childrenArray.push(childrenObj[key]);
396396
}

src/components/nav-buttons/ExportMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
4646
const store = useStore();
4747
// @ts-ignore
48-
const { fs, ipcRenderer } = window;
48+
const { fs, ipcRenderer, path } = window;
4949
5050
const componentMap = computed(() => store.componentMap);
5151
const imagePath = computed(() => store.imagePath);

0 commit comments

Comments
 (0)