-
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.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/contracts/src/support/concerns/ConcernConstructor.ts
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,35 @@ | ||
import Concern from "./Concern"; | ||
import { PROPERTIES } from "./index"; | ||
|
||
/** | ||
* Concern Constructor | ||
* | ||
* @template T extends Concern | ||
* | ||
* @see Concern | ||
*/ | ||
export default interface ConcernConstructor<T extends Concern> | ||
{ | ||
/** | ||
* Creates a new concern instance | ||
* | ||
* @param {object} [owner] The owner class instance this concern is injected into. | ||
* Defaults to `this` concern instance if none given. | ||
* | ||
* @throws {Error} When concern is unable to preform initialisation, e.g. caused | ||
* by the owner or other circumstances. | ||
*/ | ||
new (owner?: object): T; | ||
|
||
/** | ||
* Returns list of property keys that this concern class offers | ||
* | ||
* **Note**: _Only properties and methods returned by this method can be aliased | ||
* into a target class._ | ||
* | ||
* @static | ||
* | ||
* @return {PropertyKey[]} | ||
*/ | ||
[PROPERTIES](): (keyof T)[]; | ||
} |