UNPKG

870 BTypeScriptView Raw
1/** @module refer */
2/**
3 * Interface for components that require explicit clearing of references to dependent components.
4 *
5 * @see [[IReferences]]
6 * @see [[IReferenceable]]
7 *
8 * ### Example ###
9 *
10 * export class MyController implements IReferenceable, IUnreferenceable {
11 * public _persistence: IMyPersistence;
12 * ...
13 * public setReferences(references: IReferences): void {
14 * this._persistence = references.getOneRequired<IMyPersistence>(
15 * new Descriptor("mygroup", "persistence", "*", "*", "1.0")
16 * );
17 * }
18 *
19 * public unsetReferences(): void {
20 * this._persistence = null;
21 * }
22 * ...
23 * }
24 */
25export interface IUnreferenceable {
26 /**
27 * Unsets (clears) previously set references to dependent components.
28 */
29 unsetReferences(): void;
30}