Skip to content

Commit 54d10f8

Browse files
authoredJan 11, 2023
fix: include enums in typedoc index (#1162)
When generating the typedoc index for a module, include enums.
1 parent 975ff3e commit 54d10f8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed
 

‎src/docs/type-indexer-plugin.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const MODELS = [
1010
'Function',
1111
'Type alias',
1212
'Variable',
13-
'Class'
13+
'Class',
14+
'Enumeration'
1415
]
1516

1617
/**

‎test/docs.js

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ describe('docs', () => {
9090
it('should exclude definitions from node_modules', async function () {
9191
expect(fs.existsSync(join(projectDir, '.docs', 'modules', '_internal_.EventEmitter.html'))).to.be.false('included type from node_modules/@types/node')
9292
})
93+
94+
it('should include definitions for enums', async function () {
95+
const typedocUrls = await fs.readJSON(join(projectDir, 'dist', 'typedoc-urls.json'))
96+
97+
expect(typedocUrls).to.have.property('AnEnum')
98+
})
9399
})
94100

95101
describe('monorepo project', () => {

‎test/fixtures/projects/a-ts-project/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ export interface UsesInternalType extends UsedButNotExported {
2424
export interface ExtendsEmitter extends EventEmitter {
2525

2626
}
27+
28+
export enum AnEnum {
29+
VALUE_1 = 0,
30+
VALUE_2
31+
}

0 commit comments

Comments
 (0)
Please sign in to comment.