diff --git a/src/types/__tests__/imports-key.spec-d.ts b/src/types/__tests__/imports-key.spec-d.ts new file mode 100644 index 00000000..613f7d2a --- /dev/null +++ b/src/types/__tests__/imports-key.spec-d.ts @@ -0,0 +1,12 @@ +/** + * @file Unit Tests - ImportsKey + * @module pkg-types/types/tests/ImportsKey + */ + +import type TestSubject from '../imports-key' + +describe('unit:types/ImportsKey', () => { + it('should allow "#src"', () => { + assertType('#src') + }) +}) diff --git a/src/types/imports-key.ts b/src/types/imports-key.ts new file mode 100644 index 00000000..bcac11f3 --- /dev/null +++ b/src/types/imports-key.ts @@ -0,0 +1,13 @@ +/** + * @file Type Definitions - ImportsKey + * @module pkg-types/types/ImportsKey + */ + +/** + * [Subpath imports][1] object key. + * + *[1]: https://nodejs.org/api/packages.html#subpath-imports + */ +type ImportsKey = `#${string}` + +export type { ImportsKey as default } diff --git a/src/types/index.ts b/src/types/index.ts index 9ebf8725..d61a1b84 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -14,6 +14,7 @@ export type { default as ExportConditions } from './export-conditions' export type { default as Exports } from './exports' export type { default as FundingType } from './funding-type' export type { default as HoistingLimits } from './hoisiting-limits' +export type { default as ImportsKey } from './imports-key' export type { default as OS } from './os' export type { default as Registry } from './registry' export type { default as Type } from './type'