@firebase/component 0.6.10 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +1,62 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { ComponentContainer } from './component_container';
18
- export declare const enum InstantiationMode {
19
- LAZY = "LAZY",
20
- EAGER = "EAGER",
21
- EXPLICIT = "EXPLICIT"
22
- }
23
- /**
24
- * PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched
25
- * onto `firebase` namespace. Assume the component name is `test`, customers will be able
26
- * to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance.
27
- *
28
- * PRIVATE: A private component provides a set of private APIs that are used internally by other
29
- * Firebase SDKs. No service namespace is created in `firebase` namespace and customers have no way to get them.
30
- */
31
- export declare const enum ComponentType {
32
- PUBLIC = "PUBLIC",
33
- PRIVATE = "PRIVATE",
34
- VERSION = "VERSION"
35
- }
36
- export interface InstanceFactoryOptions {
37
- instanceIdentifier?: string;
38
- options?: {};
39
- }
40
- export declare type InitializeOptions = InstanceFactoryOptions;
41
- /**
42
- * Factory to create an instance of type T, given a ComponentContainer.
43
- * ComponentContainer is the IOC container that provides {@link Provider}
44
- * for dependencies.
45
- *
46
- * NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies.
47
- * It is useful for lazily loaded dependencies and optional dependencies.
48
- */
49
- export declare type InstanceFactory<T extends Name> = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T];
50
- export declare type onInstanceCreatedCallback<T extends Name> = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void;
51
- export interface Dictionary {
52
- [key: string]: unknown;
53
- }
54
- /**
55
- * This interface will be extended by Firebase SDKs to provide service name and service type mapping.
56
- * It is used as a generic constraint to ensure type safety.
57
- */
58
- export interface NameServiceMapping {
59
- }
60
- export declare type Name = keyof NameServiceMapping;
61
- export declare type Service = NameServiceMapping[Name];
62
- export declare type OnInitCallBack<T extends Name> = (instance: NameServiceMapping[T], identifier: string) => void;
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ComponentContainer } from './component_container';
18
+ export declare const enum InstantiationMode {
19
+ LAZY = "LAZY",// Currently most components are LAZY in JS SDK
20
+ EAGER = "EAGER",// EAGER components are initialized immediately upon registration
21
+ EXPLICIT = "EXPLICIT"
22
+ }
23
+ /**
24
+ * PUBLIC: A public component provides a set of public APIs to customers. A service namespace will be patched
25
+ * onto `firebase` namespace. Assume the component name is `test`, customers will be able
26
+ * to get the service by calling `firebase.test()` or `app.test()` where `app` is a `FirebaseApp` instance.
27
+ *
28
+ * PRIVATE: A private component provides a set of private APIs that are used internally by other
29
+ * Firebase SDKs. No service namespace is created in `firebase` namespace and customers have no way to get them.
30
+ */
31
+ export declare const enum ComponentType {
32
+ PUBLIC = "PUBLIC",
33
+ PRIVATE = "PRIVATE",
34
+ VERSION = "VERSION"
35
+ }
36
+ export interface InstanceFactoryOptions {
37
+ instanceIdentifier?: string;
38
+ options?: {};
39
+ }
40
+ export type InitializeOptions = InstanceFactoryOptions;
41
+ /**
42
+ * Factory to create an instance of type T, given a ComponentContainer.
43
+ * ComponentContainer is the IOC container that provides {@link Provider}
44
+ * for dependencies.
45
+ *
46
+ * NOTE: The container only provides {@link Provider} rather than the actual instances of dependencies.
47
+ * It is useful for lazily loaded dependencies and optional dependencies.
48
+ */
49
+ export type InstanceFactory<T extends Name> = (container: ComponentContainer, options: InstanceFactoryOptions) => NameServiceMapping[T];
50
+ export type onInstanceCreatedCallback<T extends Name> = (container: ComponentContainer, instanceIdentifier: string, instance: NameServiceMapping[T]) => void;
51
+ export interface Dictionary {
52
+ [key: string]: unknown;
53
+ }
54
+ /**
55
+ * This interface will be extended by Firebase SDKs to provide service name and service type mapping.
56
+ * It is used as a generic constraint to ensure type safety.
57
+ */
58
+ export interface NameServiceMapping {
59
+ }
60
+ export type Name = keyof NameServiceMapping;
61
+ export type Service = NameServiceMapping[Name];
62
+ export type OnInitCallBack<T extends Name> = (instance: NameServiceMapping[T], identifier: string) => void;
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -1,5 +1,5 @@
1
- import { FirebaseApp } from '@firebase/app-types';
2
- import { InstanceFactory, InstantiationMode, Name } from '../src/types';
3
- import { Component } from '../src/component';
4
- export declare function getFakeApp(appName?: string): FirebaseApp;
5
- export declare function getFakeComponent<T extends Name>(name: T, factory: InstanceFactory<T>, multipleInstance?: boolean, instantiationMode?: InstantiationMode): Component<T>;
1
+ import { FirebaseApp } from '@firebase/app-types';
2
+ import { InstanceFactory, InstantiationMode, Name } from '../src/types';
3
+ import { Component } from '../src/component';
4
+ export declare function getFakeApp(appName?: string): FirebaseApp;
5
+ export declare function getFakeComponent<T extends Name>(name: T, factory: InstanceFactory<T>, multipleInstance?: boolean, instantiationMode?: InstantiationMode): Component<T>;