File tree Expand file tree Collapse file tree 7 files changed +109
-10
lines changed Expand file tree Collapse file tree 7 files changed +109
-10
lines changed Original file line number Diff line number Diff line change
1
+ import { execSync } from "node:child_process" ;
2
+ import { join , resolve } from "node:path" ;
3
+ import { copyFileSync } from "node:fs" ;
4
+
5
+ execSync ( "npm run build" , {
6
+ stdio : "inherit" ,
7
+ } ) ;
8
+
9
+ let root = resolve ( "." ) ;
10
+ let input = resolve ( "src" ) ;
11
+
12
+ copyFileSync (
13
+ join ( input , "async.d.mts" ) ,
14
+ join ( root , "index.d.mts" ) ,
15
+ ) ;
16
+
17
+ copyFileSync (
18
+ join ( input , "async.d.ts" ) ,
19
+ join ( root , "index.d.ts" ) ,
20
+ ) ;
21
+
22
+ console . log ( "+ async dts files" ) ;
23
+
24
+ copyFileSync (
25
+ join ( input , "sync.d.mts" ) ,
26
+ join ( root , "sync/index.d.mts" ) ,
27
+ ) ;
28
+
29
+ copyFileSync (
30
+ join ( input , "sync.d.ts" ) ,
31
+ join ( root , "sync/index.d.ts" ) ,
32
+ ) ;
33
+
34
+ console . log ( "+ sync dts files" ) ;
Original file line number Diff line number Diff line change
1
+ type Promisable < T > = T | Promise < T > ;
2
+
3
+ export type Callback = (
4
+ directory : string ,
5
+ files : string [ ] ,
6
+ ) => Promisable < string | false | void > ;
7
+
8
+ export default function (
9
+ directory : string ,
10
+ callback : Callback ,
11
+ ) : Promise < string | void > ;
Original file line number Diff line number Diff line change 15
15
"exports" : {
16
16
"." : [
17
17
{
18
- "types" : " ./index.d.ts" ,
19
- "import" : " ./dist/index.mjs" ,
20
- "require" : " ./dist/index.js"
18
+ "import" : {
19
+ "types" : " ./index.d.mts" ,
20
+ "default" : " ./dist/index.mjs"
21
+ },
22
+ "require" : {
23
+ "types" : " ./index.d.ts" ,
24
+ "default" : " ./dist/index.js"
25
+ }
21
26
},
22
27
" ./dist/index.js"
23
28
],
24
29
"./sync" : [
25
30
{
26
- "types" : " ./sync/index.d.ts" ,
27
- "import" : " ./sync/index.mjs" ,
28
- "require" : " ./sync/index.js"
31
+ "import" : {
32
+ "types" : " ./sync/index.d.mts" ,
33
+ "default" : " ./sync/index.mjs"
34
+ },
35
+ "require" : {
36
+ "types" : " ./sync/index.d.ts" ,
37
+ "default" : " ./sync/index.js"
38
+ }
29
39
},
30
40
" ./sync/index.js"
31
41
]
32
42
},
33
43
"files" : [
44
+ " *.d.mts" ,
34
45
" *.d.ts" ,
35
46
" dist" ,
36
47
" sync"
Original file line number Diff line number Diff line change
1
+ type Promisable < T > = T | Promise < T > ;
2
+
3
+ export type Callback = (
4
+ directory : string ,
5
+ files : string [ ] ,
6
+ ) => Promisable < string | false | void > ;
7
+
8
+ export default function (
9
+ directory : string ,
10
+ callback : Callback ,
11
+ ) : Promise < string | void > ;
Original file line number Diff line number Diff line change 1
1
type Promisable < T > = T | Promise < T > ;
2
- export type Callback = ( directory : string , files : string [ ] ) => Promisable < string | false | void > ;
3
- export default function ( directory : string , callback : Callback ) : Promise < string | void > ;
2
+
3
+ declare namespace escalade {
4
+ export type Callback = (
5
+ directory : string ,
6
+ files : string [ ] ,
7
+ ) => Promisable < string | false | void > ;
8
+ }
9
+
10
+ declare function escalade (
11
+ directory : string ,
12
+ callback : escalade . Callback ,
13
+ ) : Promise < string | void > ;
14
+
15
+ export = escalade ;
Original file line number Diff line number Diff line change
1
+ export type Callback = (
2
+ directory : string ,
3
+ files : string [ ] ,
4
+ ) => string | false | void ;
5
+
6
+ export default function (
7
+ directory : string ,
8
+ callback : Callback ,
9
+ ) : string | void ;
Original file line number Diff line number Diff line change 1
- export type Callback = ( directory : string , files : string [ ] ) => string | false | void ;
2
- export default function ( directory : string , callback : Callback ) : string | void ;
1
+ declare namespace escalade {
2
+ export type Callback = (
3
+ directory : string ,
4
+ files : string [ ] ,
5
+ ) => string | false | void ;
6
+ }
7
+
8
+ declare function escalade (
9
+ directory : string ,
10
+ callback : escalade . Callback ,
11
+ ) : string | void ;
12
+
13
+ export = escalade ;
You can’t perform that action at this time.
0 commit comments