Skip to content

Commit 2eb258e

Browse files
author
Aleksandar Cakalic
committed
chore: fix vite build errors
1 parent 4f1f5a8 commit 2eb258e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { extractConnector, findConnectorById } from "./helpers/connector"
2424
import { getModalTarget } from "./helpers/modal"
2525

2626
import Modal from "./modal/Modal.svelte"
27+
import { ModalInstance } from "./modal/Modal"
2728

2829
let selectedConnector: StarknetkitConnector | null = null
2930

@@ -212,7 +213,7 @@ export const connect = async ({
212213
theme: modalTheme === "system" ? null : (modalTheme ?? null),
213214
modalWallets,
214215
},
215-
})
216+
}) as ModalInstance // Prevents vite build errors
216217
})
217218
}
218219

src/modal/Modal.d.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Callback, Layout, ModalWallet, Theme } from "../types/modal"
2+
3+
declare namespace svelte.JSX {
4+
interface IntrinsicElements {
5+
Modal: svelte.JSX.ModalProps
6+
}
7+
}
8+
9+
interface Modal extends svelte.ComponentType<ModalProps> {}
10+
11+
interface ModalProps {
12+
dappName?: string
13+
layout?: Layout
14+
modalWallets?: ModalWallet[]
15+
selectedWallet?: ModalWallet | null
16+
showBackButton?: boolean
17+
callback?: Callback
18+
theme?: Theme
19+
darkModeControlClass?: string
20+
}
21+
22+
interface ModalInstance extends SvelteComponent {
23+
$set(props: Partial<ModalProps>): void
24+
$destroy(): void
25+
}

0 commit comments

Comments
 (0)