Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
chore: wip

chore: wip

chore: wip

chore: wip

chore: wip

chore: wip

chore: wip

chore: wip

chore: wip
  • Loading branch information
chrisbbreuer committed Nov 4, 2024
1 parent a516408 commit a22e238
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 89 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Features

- Fast .d.ts generation _(via isolatedDeclaration)_
- Fast .d.ts generation
- Highly configurable
- Lightweight library
- Cross-platform binary
Expand All @@ -32,6 +32,16 @@ pkgx install dtsx # wip

There are two ways of using this ".d.ts generation" tool: _as a library or as a CLI._

_But before you get started, please ensure you enabled `isolatedDeclarations` in your `tsconfig.json` file._

```json
{
"compilerOptions": {
"isolatedDeclaration": true
}
}
```

## Library

Given the npm package is installed, you can use the `generate` function to generate TypeScript declaration files from your project.
Expand Down
4 changes: 2 additions & 2 deletions fixtures/output/function.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export declare function fetchUsers(): Promise<ResponseData>;
export declare function getProduct(id: number): Promise<ApiResponse<Product>>;
export declare function authenticate(user: string, password: string): Promise<AuthResponse>;
export declare function dts(options?: DtsGenerationOption): BunPlugin;
export declare function loadConfig<T extends Record<string, unknown>>(): unknown;
export declare function loadConfig<T extends Record<string, unknown>>(): void;
export declare function processData(data: string): string;
export declare function processData(data: number): number;
export declare function processData(data: boolean): boolean;
Expand All @@ -13,4 +13,4 @@ export declare function processData(data: unknown): unknown;
export declare function complexAsyncGenerator(): any;
export declare function isUser(value: unknown): value is User;
export declare function extractFunctionSignature(declaration: string): FunctionSignature;
export declare function createApi<T extends Record<string, (...args: any[]) => any>(): unknown;
export declare function createApi<T extends Record<string, (...args: any[]) => any>(): void;
Loading

0 comments on commit a22e238

Please sign in to comment.