Skip to content

Commit

Permalink
example of export hidden types
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrue committed Jan 11, 2024
1 parent 07e0a53 commit 4ca6b59
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/e2e/test-cases/referenced-hidden-types/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { TestCaseConfig } from '../test-case-config';

const config: TestCaseConfig = {
};

export = config;
9 changes: 9 additions & 0 deletions tests/e2e/test-cases/referenced-hidden-types/hidden1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const hidden = 0 as const;

interface Hidden {
type?: typeof hidden;
}

export default function test(value: Hidden): typeof hidden{
return value?.type ?? hidden;
};
9 changes: 9 additions & 0 deletions tests/e2e/test-cases/referenced-hidden-types/hidden2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const hidden = '' as const;

interface Hidden {
type?: typeof hidden;
}

export default function (value: Hidden): typeof hidden {
return value.type ?? hidden;
};
1 change: 1 addition & 0 deletions tests/e2e/test-cases/referenced-hidden-types/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../run-test-case').runTestCase(__dirname);
2 changes: 2 additions & 0 deletions tests/e2e/test-cases/referenced-hidden-types/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as F1 } from './hidden1';
export { default as F2 } from './hidden2';
17 changes: 17 additions & 0 deletions tests/e2e/test-cases/referenced-hidden-types/output.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
declare const hidden: 0;
export interface Hidden {
type?: typeof hidden;
}
declare function test(value: Hidden): typeof hidden;
declare const hidden$1: "";
interface Hidden$1 {
type?: typeof hidden$1;
}
declare function _default(value: Hidden$1): typeof hidden$1;

export {
_default as F2,
test as F1,
};

export {};

0 comments on commit 4ca6b59

Please sign in to comment.