-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
e14d68a
commit 01f8e6c
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @file Type Tests - DecoratorTarget | ||
* @module tutils/types/tests/unit-d/DecoratorTarget | ||
*/ | ||
|
||
import type AbstractConstructor from '../constructor-abstract' | ||
import type TestSubject from '../decorator-target' | ||
import type Objectify from '../objectify' | ||
|
||
describe('unit-d:types/DecoratorTarget', () => { | ||
it('should extract AbstractConstructor<any>', () => { | ||
expectTypeOf<TestSubject>() | ||
.extract<AbstractConstructor<any>>() | ||
.not.toBeNever() | ||
}) | ||
|
||
it('should extract Objectify<any>', () => { | ||
expectTypeOf<TestSubject>() | ||
.exclude<AbstractConstructor<any>>() | ||
.toEqualTypeOf<Objectify<any>>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @file Type Definitions - MethodDecorator | ||
* @module tutils/types/MethodDecorator | ||
*/ | ||
|
||
import type AbstractConstructor from './constructor-abstract' | ||
import type Objectify from './objectify' | ||
|
||
/** | ||
* A class declaration or prototype passed as a decorator target. | ||
* | ||
* @see https://mirone.me/a-complete-guide-to-typescript-decorator | ||
*/ | ||
type DecoratorTarget = AbstractConstructor<any> | Objectify<any> | ||
|
||
export type { DecoratorTarget as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters