File tree 2 files changed +20
-16
lines changed
2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ const defaultPromptOptions = (form: string): PromptOptions => ({
116
116
} )
117
117
118
118
const UseBootstrapDialog = {
119
- alert ( text : string | AlertOptions ) {
119
+ alert ( text : string | AlertOptions ) : AlertReturnType | undefined {
120
120
const Modal = getModal ( )
121
121
if ( Modal ) {
122
122
let options : AlertOptions = merge ( defaultAlertOptions , getOptionsFromGlobal ( 'alert' ) )
@@ -165,7 +165,7 @@ const UseBootstrapDialog = {
165
165
}
166
166
} ,
167
167
168
- confirm ( confirmOptions : ConfirmOptions ) {
168
+ confirm ( confirmOptions : ConfirmOptions ) : void {
169
169
const Modal = getModal ( )
170
170
if ( Modal ) {
171
171
const options : ConfirmOptions = merge ( defaultConfirmOptions , getOptionsFromGlobal ( 'confirm' ) , confirmOptions )
@@ -202,7 +202,7 @@ const UseBootstrapDialog = {
202
202
}
203
203
} ,
204
204
205
- prompt ( promptOptions : PromptOptions ) {
205
+ prompt ( promptOptions : PromptOptions ) : void {
206
206
const Modal = getModal ( )
207
207
if ( Modal ) {
208
208
const formId = `form-${ Math . random ( ) } `
@@ -277,6 +277,11 @@ export interface AlertOptions extends ModalTitle {
277
277
modalDialogClassName ?: string
278
278
}
279
279
280
+ interface AlertReturnType {
281
+ modal : HTMLDivElement
282
+ hide : ( ) => void
283
+ }
284
+
280
285
export interface ConfirmOptions extends Content {
281
286
staticBackdrop ?: boolean
282
287
modalDialogClassName ?: string
Original file line number Diff line number Diff line change 1
- import { parse , resolve } from 'node:path'
2
- import { rename } from 'node:fs/promises'
1
+ import { resolve } from 'node:path'
2
+ import { readFile , writeFile } from 'node:fs/promises'
3
3
import { defineConfig } from 'vite'
4
4
import solid from 'vite-plugin-solid'
5
- import dts from 'vite-plugin-dts '
5
+ import oxc from 'oxc-transform '
6
6
import pkg from './package.json'
7
7
8
8
// https://vitejs.dev/config/
@@ -20,15 +20,14 @@ export default defineConfig({
20
20
} ,
21
21
plugins : [
22
22
solid ( ) ,
23
- dts ( {
24
- // library source only.
25
- include : pkg . source ,
26
-
27
- // fix the generated declaration files following the source structure.
28
- entryRoot : parse ( pkg . source ) . dir ,
29
-
30
- // follow package.json "types" property.
31
- afterBuild : ( ) => rename ( `dist/js/${ parse ( pkg . source ) . name } .d.ts` , pkg . types ) ,
32
- } ) ,
23
+ {
24
+ name : 'dts' ,
25
+ async closeBundle ( ) {
26
+ const file = pkg . source
27
+ const text = await readFile ( file , 'utf8' )
28
+ const code = oxc . isolatedDeclaration ( file , text )
29
+ await writeFile ( pkg . types , code . sourceText )
30
+ } ,
31
+ } ,
33
32
] ,
34
33
} )
You can’t perform that action at this time.
0 commit comments