@aedart/contracts
Version:
The Ion contracts package. Contains types, interfaces and unique identifiers
84 lines (81 loc) • 1.94 kB
JavaScript
/**
* @aedart/contracts
*
* BSD-3-Clause, Copyright (c) 2023-present Alin Eugen Deac <aedart@gmail.com>.
*/
/**
* Support Concerns identifier
*
* @type {Symbol}
*/
const SUPPORT_CONCERNS = Symbol('@aedart/contracts/support/concerns');
/**
* Symbol used by a [concern class]{@link ConcernConstructor} to indicate what properties
* and methods can be aliased into a target class.
*
* **Note**: _Symbol MUST be used to as name for a "static" method in the desired Concern class._
*
* **Example**:
* ```ts
* class MyConcern implements Concern
* {
* static [PROVIDES](): PropertyKey[]
* {
* // ...not shown...
* }
*
* // ...remaining not shown...
* }
* ```
*
* @see ConcernConstructor
*
* @type {symbol}
*/
const PROVIDES = Symbol('concern_provides');
/**
* Symbol that can be used by a [concern class]{@link ConcernConstructor} to perform
* pre-registration logic
*
* @see RegistrationAware
* @see ConcernConstructor
*
* @type {symbol}
*/
const BEFORE = Symbol('concern_before_registration');
/**
* Symbol that can be used by a [concern class]{@link ConcernConstructor} to perform
* post-registration logic.
*
* @see RegistrationAware
* @see ConcernConstructor
*
* @type {symbol}
*/
const AFTER = Symbol('concern_after_registration');
/**
* Symbol used to define a list of the concern classes to be used by a target class.
*
* @see {UsesConcerns}
*
* @type {Symbol}
*/
const CONCERN_CLASSES = Symbol('concern_classes');
/**
* Symbol used to list the aliases applied in a target class
*
* @see {UsesConcerns}
*
* @type {Symbol}
*/
const ALIASES = Symbol('aliases');
/**
* Symbol used to define a "concerns container" property inside a target class' prototype
*
* @see {Owner}
* @see {Container}
*
* @type {Symbol}
*/
const CONCERNS = Symbol('concerns');
export { AFTER, ALIASES, BEFORE, CONCERNS, CONCERN_CLASSES, PROVIDES, SUPPORT_CONCERNS };