@@ -16,7 +16,7 @@ import { useCreateComponent } from "../../composables/useCreateComponent.js";
16
16
// import * as fs from "fs";
17
17
import { Component , HtmlElement , HtmlElementMap } from " ../../../../types" ;
18
18
// @ts-ignore
19
- const { fs, ipcRenderer } = window ;
19
+ const { fs, ipcRenderer } = window as any ;
20
20
const store = useStore ();
21
21
22
22
const props = defineProps ([" title" ]);
@@ -72,7 +72,7 @@ const importComponent = () => {
72
72
},
73
73
],
74
74
})
75
- .then ((res : { filePaths: fs . PathOrFileDescriptor }) => {
75
+ .then ((res : { filePaths }) => {
76
76
openVueFile (res .filePaths );
77
77
alert (" Successfully Imported" );
78
78
})
@@ -81,7 +81,7 @@ const importComponent = () => {
81
81
82
82
// parses script tag string for props
83
83
const parsingStringToProps = (str : string ) => {
84
- let props = [];
84
+ let props: string [] = [];
85
85
let split = str .split (" " );
86
86
for (let i = 0 ; i < split .length ; i ++ ) {
87
87
if (
@@ -267,8 +267,8 @@ const openVueFile = (data) => {
267
267
// OverVue adds a <div></div> wrapper to all components. remove this before importing.
268
268
269
269
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 [] = [];
272
272
for (const key in groupingObj ) {
273
273
groupingArray .push (groupingObj [key ]);
274
274
}
@@ -338,7 +338,7 @@ const openVueFile = (data) => {
338
338
339
339
function findGroupings(array : string []) {
340
340
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
342
342
for (let i = 0 ; i < array .length ; i ++ ) {
343
343
if (array [i ][1 ] !== " /" ) {
344
344
if (
@@ -360,7 +360,7 @@ const openVueFile = (data) => {
360
360
stopIndexes .push (i );
361
361
}
362
362
}
363
- let groupings = [];
363
+ let groupings: string [][] = [];
364
364
let startIndex = 0 ;
365
365
for (let i = 0 ; i < stopIndexes .length ; i ++ ) {
366
366
groupings .push (array .slice (startIndex , stopIndexes [i ] + 1 ));
@@ -390,7 +390,7 @@ const openVueFile = (data) => {
390
390
if (array [i ].length > 0 ) {
391
391
const childGroupings = findGroupings (array [i ]);
392
392
const childrenObj = objectGenerator (childGroupings );
393
- const childrenArray = [];
393
+ const childrenArray: any [] = [];
394
394
for (const key in childrenObj ) {
395
395
childrenArray .push (childrenObj [key ]);
396
396
}
0 commit comments