Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Oct 22, 2024
1 parent cb2e1d4 commit 5a93a7f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 7 deletions.
38 changes: 32 additions & 6 deletions fixtures/input/example-0001.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,48 @@ export const someObject = {
someBoolean: true,
someFalse: false,
someFunction: () => { console.log('hello world') },
someFunction2: () => {
// some comment
/* some other comment */
return some.object ?? 'default'
},
someArray: [1, 2, 3],
someNestedArray: [
[1, 2, 3],
[4, 5, 6, 7, 8, 9, 10],
],
someComplexArray: [
[
{ key: 'value' },
],
[
{ key2: 'value2' },
'test',
1000,
],
[
'some string',
console.log,
someFunction(),
]
],
someObject: { key: 'value' },
someNestedObject: {
key: {
nestedKey: 'value',
},
otherKey: {
nestedKey: process.cwd(),
nestedKey2: () => { console.log('hello world') },
}
},
someNestedArray: [
[1, 2, 3],
[4, 5, 6],
],
someNestedObjectArray: [
{ key: 'value' },
{ key: 'value' },
{ key2: 'value2' },
],
someInlineCall: process.cwd(),
someOtherObject: some.deep.object,
someInlineCall2: console.log,
someInlineCall3: console.log(),
}

/**
Expand Down
50 changes: 49 additions & 1 deletion fixtures/output/example-0001.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@ export declare const someObject: {
someNumber: 1000;
someBoolean: true;
someFalse: false;
someFunction: Function;
someFunction2: Function;
someArray: [1, 2, 3];
someNestedArray: [
[1, 2, 3],
[4, 5, 6, 7, 8, 9, 10]
];
someComplexArray: [
[{ key: 'value' }],
[{ key2: 'value2' }, 'test', 1000],
['some string', Function, Function]
];
someObject: { key: 'value' };
someNestedObject: {
key: {
nestedKey: 'value';
};
otherKey: {
nestedKey: Function;
nestedKey2: Function;
};
};
someNestedObjectArray: [
{ key: 'value' },
{ key2: 'value2' }
];
someOtherObject: unknown;
someInlineCall2: Function;
someInlineCall3: Function;
};

/**
Expand Down Expand Up @@ -92,7 +121,26 @@ declare interface Options<T> {

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

declare const dtsConfig: DtsGenerationConfig;
declare const dtsConfig: {
name: 'dts';
cwd: process.cwd();
defaultConfig: {
root: './src';
entrypoints: ['**/*.ts'];
outdir: './dist',
keepComments: true,
clean: true,
tsconfigPath: './tsconfig.json',
},
root: './src',
entrypoints: ['**/*.ts'],
outdir: './dist',
keepComments: true,
clean: true,
tsconfigPath: './tsconfig.json',
}

// declare const dtsConfig: DtsGenerationConfig;

export { generate, dtsConfig };

Expand Down

0 comments on commit 5a93a7f

Please sign in to comment.