1 | import { RegistrationOptions } from './registry';
|
2 | import { Factory } from './factory';
|
3 |
|
4 |
|
5 | export const OWNER = '__owner__';
|
6 |
|
7 | export function getOwner(object: object): Owner {
|
8 | return object[OWNER];
|
9 | }
|
10 |
|
11 | export function setOwner(object: object, owner: Owner): void {
|
12 | object[OWNER] = owner;
|
13 | }
|
14 |
|
15 | export interface Owner {
|
16 | identify(specifier: string, referrer?: string): string;
|
17 |
|
18 | factoryFor(specifier: string, referrer?: string): Factory<any>;
|
19 |
|
20 | lookup(specifier: string, referrer?: string): any;
|
21 | }
|