Skip to content

Commit 6ecbe9e

Browse files
committed
chore: wip
chore: wip chore: wip chore: wip
1 parent 3fd45d3 commit 6ecbe9e

File tree

3 files changed

+190
-300
lines changed

3 files changed

+190
-300
lines changed

fixtures/output/function.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ export declare function fetchUsers(): Promise<ResponseData>;
44
export declare function getProduct(id: number): Promise<ApiResponse<Product>>;
55
export declare function authenticate(user: string, password: string): Promise<AuthResponse>;
66
export declare function dts(options?: DtsGenerationOption): BunPlugin;
7-
export declare function loadConfig <T extends Record<string, unknown>> ({ name, cwd, defaultConfig }: Options<T>): Promise<T>;
7+
export declare function loadConfig<T extends Record<string, unknown>>(): unknown;
88
export declare function processData(data: string): string;
99
export declare function processData(data: number): number;
1010
export declare function processData(data: boolean): boolean;
11-
export declare function processData <T extends object> (data: T): T;
11+
export declare function processData<T extends object>(data: T): T;
1212
export declare function processData(data: unknown): unknown;
1313
export declare function complexAsyncGenerator(): any;
1414
export declare function isUser(value: unknown): value is User;
1515
export declare function extractFunctionSignature(declaration: string): FunctionSignature;
16+
export declare function createApi<T extends Record<string, (...args: any[]) => any>(): unknown;

fixtures/output/variable.d.ts

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,19 @@ export declare const someObject: {
1111
anotherOne: () => unknown;
1212
someArray: Array<1 | 2 | 3>;
1313
someNestedArray: Array<Array<1 | 2 | 3> | Array<4 | 5 | 6 | 7 | 8 | 9 | 10>>;
14-
someNestedArray2: Array<
15-
Array<1 | 2 | 3> |
16-
Array<4 | 5 | 6 | 7 | 8 | 9 | 10> |
17-
'dummy value'
18-
>;
19-
someNestedArray3: Array<
20-
Array<1 | 2 | 3> |
21-
Array<4 | 5 | 6 | 7 | 8 | 9 | 10> |
22-
'dummy value' |
23-
Array<11 | 12 | 13>
24-
>;
14+
someNestedArray2: Array<Array<1 | 2 | 3> | Array<4 | 5 | 6 | 7 | 8 | 9 | 10> | 'dummy value'>;
15+
someNestedArray3: Array<Array<1 | 2 | 3> | Array<4 | 5 | 6 | 7 | 8 | 9 | 10> | 'dummy value' | Array<11 | 12 | 13>>;
2516
someOtherNestedArray: Array<
2617
Array<'some text' | 2 | unknown | (() => void) | unknown> |
2718
Array<4 | 5 | 6 | 7 | 8 | 9 | 10>
2819
>;
2920
someComplexArray: Array<
30-
Array<
31-
{
32-
key: 'value'
33-
}
34-
> |
35-
Array<
36-
{
37-
key2: 'value2'
38-
} |
39-
'test' |
40-
1000
41-
> |
21+
Array<{
22+
key: 'value'
23+
}> |
24+
Array<{
25+
key2: 'value2'
26+
} | 'test' | 1000> |
4227
Array<'some string' | unknown | unknown>
4328
>;
4429
someObject: {
@@ -55,11 +40,11 @@ export declare const someObject: {
5540
};
5641
someNestedObjectArray: Array<
5742
{
58-
key: 'value'
59-
} |
43+
key: 'value'
44+
} |
6045
{
61-
key2: 'value2'
62-
}
46+
key2: 'value2'
47+
}
6348
>;
6449
someOtherObject: unknown;
6550
someInlineCall2: unknown;
@@ -80,12 +65,7 @@ export declare const complexArrays: {
8065
readonly [1, 'string', true] |
8166
readonly ['literal', 42, false]
8267
];
83-
mixedArrays: Array<
84-
unknown |
85-
unknown |
86-
((...args: any[]) => unknown) |
87-
((...args: any[]) => unknown)
88-
>
68+
mixedArrays: Array<unknown | unknown | ((...args: any[]) => unknown) | ((...args: any[]) => unknown)>
8969
};
9070
export declare const complexObject: {
9171
handlers: {
@@ -100,7 +80,7 @@ export declare const complexObject: {
10080
}
10181
};
10282
export declare const methodDecorator: (...args: any[]) => unknown;
103-
export declare const methodDecoratorWithExplicitType: SomeType;
83+
export declare const methodDecoratorWithExplicitType: (...args: any[]) => unknown;
10484
export declare const CONFIG_MAP: {
10585
development: {
10686
features: {

0 commit comments

Comments
 (0)