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 */
4440export 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 */
5551export declare interface ResponseData {
56- success : boolean
57- data : User [ ]
52+ success : boolean
53+ data : User [ ]
5854}
5955
6056/**
@@ -66,25 +62,22 @@ data: User[]
6662export declare function fetchUsers ( ) : Promise < ResponseData > ;
6763
6864export 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
8477export 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
9386export declare function getProduct ( id : number ) : Promise < ApiResponse < Product > > ;
9487
9588export declare interface AuthResponse {
96- token : string
97- expiresIn : number
89+ token : string
90+ expiresIn : number
9891}
9992
10093export declare type AuthStatus = 'authenticated' | 'unauthenticated' ;
@@ -107,27 +100,15 @@ export declare const defaultHeaders: {
107100
108101export 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
116109export 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
132113export { generate , dtsConfig }
133114
@@ -136,23 +117,26 @@ export type { DtsGenerationOption };
136117export { config } from './config' ;
137118
138119export 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+
153139export * from './extract' ;
154140export * from './generate' ;
155141export * from './types' ;
156142export * from './utils' ;
157-
158- export default dts ;
0 commit comments