-
-
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
0c1f420
commit f913557
Showing
5 changed files
with
47 additions
and
4 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,21 @@ | ||
/** | ||
* @file Type Tests - AbstractConstructor | ||
* @module tutils/types/tests/unit-d/AbstractConstructor | ||
*/ | ||
|
||
import type TestSubject from '../constructor-abstract' | ||
|
||
describe('unit-d:types/AbstractConstructor', () => { | ||
abstract class Vehicle { | ||
constructor( | ||
public readonly vin: number, | ||
public readonly make: string, | ||
public readonly model: string, | ||
public readonly year: number | ||
) {} | ||
} | ||
|
||
it('should match abstract class declaration', () => { | ||
assertType<TestSubject<Vehicle, [number, string, string, number]>>(Vehicle) | ||
}) | ||
}) |
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
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,18 @@ | ||
/** | ||
* @file Type Definitions - AbstractConstructor | ||
* @module tutils/types/AbstractConstructor | ||
*/ | ||
|
||
/** | ||
* An [`abstract class` constructor][1]. | ||
* | ||
* [1]: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-2.html#abstract-construct-signatures | ||
* | ||
* @template T - Class prototype | ||
* @template A - Constructor arguments | ||
*/ | ||
type AbstractConstructor<T, A extends unknown[] = any[]> = abstract new ( | ||
...args: A | ||
) => T | ||
|
||
export type { AbstractConstructor 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
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