Skip to content

Commit 524af20

Browse files
committed
chore: wip
1 parent 928842d commit 524af20

File tree

1 file changed

+34
-50
lines changed

1 file changed

+34
-50
lines changed

fixtures/output/example-0001.d.ts

Lines changed: 34 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import type { BunPlugin } from 'bun';
2-
import type { DtsGenerationConfig, DtsGenerationOption } from '@stacksjs/dtsx';
3-
import { generate } from '@stacksjs/dtsx';
4-
51
/**
62
* Example of const declaration
73
*/
@@ -42,9 +38,9 @@ export declare const someObject: {
4238
* with another comment in an extra line
4339
*/
4440
export declare interface User {
45-
id: number
46-
name: string
47-
email: string
41+
id: number
42+
name: string
43+
email: string
4844
}
4945

5046
/**
@@ -53,8 +49,8 @@ email: string
5349
* with multiple lines of comments, including an empty line
5450
*/
5551
export declare interface ResponseData {
56-
success: boolean
57-
data: User[]
52+
success: boolean
53+
data: User[]
5854
}
5955

6056
/**
@@ -66,25 +62,22 @@ data: User[]
6662
export declare function fetchUsers(): Promise<ResponseData>;
6763

6864
export declare interface ApiResponse<T> {
69-
status: number
70-
message: string
71-
data: T
65+
status: number
66+
message: string
67+
data: T
7268
}
7369

7470
/**
7571
* Example of another const declaration
76-
*
77-
* with multiple empty lines, including being poorly formatted
72+
*
73+
* with multiple empty lines, including being poorly formatted
7874
*/
79-
declare const settings: { [key: string]: any } = {
80-
theme: 'dark',
81-
language: 'en',
82-
}
75+
declare const settings: { [key: string]: any };
8376

8477
export declare interface Product {
85-
id: number
86-
name: string
87-
price: number
78+
id: number
79+
name: string
80+
price: number
8881
}
8982

9083
/**
@@ -93,8 +86,8 @@ price: number
9386
export declare function getProduct(id: number): Promise<ApiResponse<Product>>;
9487

9588
export declare interface AuthResponse {
96-
token: string
97-
expiresIn: number
89+
token: string
90+
expiresIn: number
9891
}
9992

10093
export declare type AuthStatus = 'authenticated' | 'unauthenticated';
@@ -107,27 +100,15 @@ export declare const defaultHeaders: {
107100

108101
export declare function dts(options?: DtsGenerationOption): BunPlugin;
109102

110-
declare interface interface Options<T> {
111-
name: string
112-
cwd?: string
113-
defaultConfig: T
103+
declare interface Options<T> {
104+
name: string
105+
cwd?: string
106+
defaultConfig: T
114107
}
115108

116109
export declare function loadConfig<T extends Record<string, unknown>>(options: Options<T>): Promise<T>;
117110

118-
declare const dtsConfig: DtsGenerationConfig = await loadConfig({
119-
name: 'dts',
120-
cwd: process.cwd(),
121-
defaultConfig: {
122-
cwd: process.cwd(),
123-
root: './src',
124-
entrypoints: ['**/*.ts'],
125-
outdir: './dist',
126-
keepComments: true,
127-
clean: true,
128-
tsconfigPath: './tsconfig.json',
129-
},
130-
});
111+
declare const dtsConfig: DtsGenerationConfig;
131112

132113
export { generate, dtsConfig }
133114

@@ -136,23 +117,26 @@ export type { DtsGenerationOption };
136117
export { config } from './config';
137118

138119
export declare interface ComplexGeneric<T extends Record<string, unknown>, K extends keyof T> {
139-
data: T
140-
key: K
141-
value: T[K]
142-
transform: (input: T[K]) => string
143-
nested: Array<Partial<T>>
120+
data: T
121+
key: K
122+
value: T[K]
123+
transform: (input: T[K]) => string
124+
nested: Array<Partial<T>>
144125
}
145126

146-
export declare type ComplexUnionIntersection =
147-
| (User & { role: 'admin' })
148-
| (Product & { category: string })
127+
export declare type ComplexUnionIntersection =;
128+
129+
| (User & { role: 'admin' });
130+
131+
| (Product & { category: string });
132+
149133
& {
150134
metadata: Record<string, unknown>
151135
}
152136

137+
export default dts;
138+
153139
export * from './extract';
154140
export * from './generate';
155141
export * from './types';
156142
export * from './utils';
157-
158-
export default dts;

0 commit comments

Comments
 (0)