1 | import { IConstruct } from './construct-compat';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface IDependable {
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare class ConcreteDependable implements IDependable {
|
23 | private readonly _dependencyRoots;
|
24 | constructor();
|
25 | /**
|
26 | * Add a construct to the dependency roots
|
27 | */
|
28 | add(construct: IConstruct): void;
|
29 | }
|
30 | /**
|
31 | * Trait for IDependable
|
32 | *
|
33 | * Traits are interfaces that are privately implemented by objects. Instead of
|
34 | * showing up in the public interface of a class, they need to be queried
|
35 | * explicitly. This is used to implement certain framework features that are
|
36 | * not intended to be used by Construct consumers, and so should be hidden
|
37 | * from accidental use.
|
38 | *
|
39 | * @example
|
40 | *
|
41 | * // Usage
|
42 | * const roots = DependableTrait.get(construct).dependencyRoots;
|
43 | *
|
44 | * // Definition
|
45 | * class TraitImplementation implements DependableTrait {
|
46 | * public readonly dependencyRoots: IConstruct[];
|
47 | * constructor() {
|
48 | * this.dependencyRoots = [constructA, constructB, constructC];
|
49 | * }
|
50 | * }
|
51 | * DependableTrait.implement(construct, new TraitImplementation());
|
52 | *
|
53 | */
|
54 | export declare abstract class DependableTrait {
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 | static implement(instance: IDependable, trait: DependableTrait): void;
|
61 | |
62 |
|
63 |
|
64 | static get(instance: IDependable): DependableTrait;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | abstract readonly dependencyRoots: IConstruct[];
|
72 | }
|