File tree Expand file tree Collapse file tree 3 files changed +266
-89
lines changed Expand file tree Collapse file tree 3 files changed +266
-89
lines changed Original file line number Diff line number Diff line change 8
8
9
9
## Features
10
10
11
- - Fast .d.ts generation _ (via isolatedDeclaration) _
11
+ - Fast .d.ts generation
12
12
- Highly configurable
13
13
- Lightweight library
14
14
- Cross-platform binary
@@ -32,6 +32,16 @@ pkgx install dtsx # wip
32
32
33
33
There are two ways of using this ".d.ts generation" tool: _ as a library or as a CLI._
34
34
35
+ _ But before you get started, please ensure you enabled ` isolatedDeclarations ` in your ` tsconfig.json ` file._
36
+
37
+ ``` json
38
+ {
39
+ "compilerOptions" : {
40
+ "isolatedDeclaration" : true
41
+ }
42
+ }
43
+ ```
44
+
35
45
## Library
36
46
37
47
Given the npm package is installed, you can use the ` generate ` function to generate TypeScript declaration files from your project.
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export declare function fetchUsers(): Promise<ResponseData>;
4
4
export declare function getProduct ( id : number ) : Promise < ApiResponse < Product > > ;
5
5
export declare function authenticate ( user : string , password : string ) : Promise < AuthResponse > ;
6
6
export declare function dts ( options ?: DtsGenerationOption ) : BunPlugin ;
7
- export declare function loadConfig < T extends Record < string , unknown > > ( ) : unknown ;
7
+ export declare function loadConfig < T extends Record < string , unknown > > ( ) : void ;
8
8
export declare function processData ( data : string ) : string ;
9
9
export declare function processData ( data : number ) : number ;
10
10
export declare function processData ( data : boolean ) : boolean ;
@@ -13,4 +13,4 @@ export declare function processData(data: unknown): unknown;
13
13
export declare function complexAsyncGenerator ( ) : any ;
14
14
export declare function isUser ( value : unknown ) : value is User ;
15
15
export declare function extractFunctionSignature ( declaration : string ) : FunctionSignature ;
16
- export declare function createApi < T extends Record < string , ( ...args : any [ ] ) => any > ( ) : unknown ;
16
+ export declare function createApi < T extends Record < string , ( ...args : any [ ] ) => any > ( ) : void ;
You can’t perform that action at this time.
0 commit comments