Skip to content

Commit

Permalink
feat(types): Comment
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Mar 8, 2024
1 parent a9c8171 commit bac1a98
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/types/__tests__/comment.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @file Type Tests - Comment
* @module esast/types/tests/unit-d/Comment
*/

import type {
DocblockComment,
MultiLineComment,
SingleLineComment
} from '@flex-development/esast'
import type TestSubject from '../comment'

describe('unit-d:types/Comment', () => {
it('should extract DocblockComment', () => {
expectTypeOf<TestSubject>().extract<DocblockComment>().not.toBeNever()
})

it('should extract MultiLineComment', () => {
expectTypeOf<TestSubject>().extract<MultiLineComment>().not.toBeNever()
})

it('should extract SingleLineComment', () => {
expectTypeOf<TestSubject>().extract<SingleLineComment>().not.toBeNever()
})
})
21 changes: 21 additions & 0 deletions src/types/comment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @file Type Definitions - Comment
* @module esast/types/Comment
*/

import type {
DocblockComment,
MultiLineComment,
SingleLineComment
} from '@flex-development/esast'

/**
* A docblock, multi line, or single line comment.
*
* @see {@linkcode DocblockComment}
* @see {@linkcode MultiLineComment}
* @see {@linkcode SingleLineComment}
*/
type Comment = DocblockComment | MultiLineComment | SingleLineComment

export type { Comment as default }
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @module esast/types
*/

export type { default as Comment } from './comment'
export type { default as EcmaVersion } from './ecma-version'
export type { default as ImportKind } from './kind-import'
export type { default as MethodKind } from './kind-method'
Expand Down

0 comments on commit bac1a98

Please sign in to comment.