From 1b613fec523d5b26f84392017d86cf687e2ae7e2 Mon Sep 17 00:00:00 2001 From: Lexus Drumgold Date: Wed, 6 Mar 2024 23:43:37 -0500 Subject: [PATCH] feat(types): `VariableKind` Signed-off-by: Lexus Drumgold --- src/types/__tests__/kind-variable.spec-d.ts | 20 ++++++++++++++++++++ src/types/index.ts | 1 + src/types/kind-variable.ts | 11 +++++++++++ 3 files changed, 32 insertions(+) create mode 100644 src/types/__tests__/kind-variable.spec-d.ts create mode 100644 src/types/kind-variable.ts diff --git a/src/types/__tests__/kind-variable.spec-d.ts b/src/types/__tests__/kind-variable.spec-d.ts new file mode 100644 index 0000000..0f49501 --- /dev/null +++ b/src/types/__tests__/kind-variable.spec-d.ts @@ -0,0 +1,20 @@ +/** + * @file Type Tests - VariableKind + * @module esast/types/tests/unit-d/VariableKind + */ + +import type TestSubject from '../kind-variable' + +describe('unit-d:types/VariableKind', () => { + it('should extract "const"', () => { + expectTypeOf().extract<'const'>().not.toBeNever() + }) + + it('should extract "let"', () => { + expectTypeOf().extract<'let'>().not.toBeNever() + }) + + it('should extract "var"', () => { + expectTypeOf().extract<'var'>().not.toBeNever() + }) +}) diff --git a/src/types/index.ts b/src/types/index.ts index 66570ff..8a97f22 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -6,3 +6,4 @@ export type { default as ImportKind } from './kind-import' export type { default as MethodKind } from './kind-method' export type { default as PropertyKind } from './kind-property' +export type { default as VariableKind } from './kind-variable' diff --git a/src/types/kind-variable.ts b/src/types/kind-variable.ts new file mode 100644 index 0000000..7bab1ae --- /dev/null +++ b/src/types/kind-variable.ts @@ -0,0 +1,11 @@ +/** + * @file Type Definitions - VariableKind + * @module esast/types/VariableKind + */ + +/** + * Variable declaration kinds. + */ +type VariableKind = 'const' | 'let' | 'var' + +export type { VariableKind as default }