UNPKG

1.13 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google Inc. All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8/**
9 * A unique object used for retrieving items from the {@link ReflectiveInjector}.
10 *
11 * Keys have:
12 * - a system-wide unique `id`.
13 * - a `token`.
14 *
15 * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows
16 * the
17 * injector to store created objects in a more efficient way.
18 *
19 * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when
20 * resolving
21 * providers.
22 * @experimental
23 */
24export declare class ReflectiveKey {
25 token: Object;
26 id: number;
27 /**
28 * Private
29 */
30 constructor(token: Object, id: number);
31 /**
32 * Returns a stringified token.
33 */
34 get displayName(): string;
35 /**
36 * Retrieves a `Key` for a token.
37 */
38 static get(token: Object): ReflectiveKey;
39 /**
40 * @returns the number of keys registered in the system.
41 */
42 static get numberOfKeys(): number;
43}