@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.
- package/dist/esm/index.d.ts +20 -20
- package/dist/esm/index.esm2017.js +397 -397
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/component.d.ts +43 -43
- package/dist/esm/src/component_container.d.ts +47 -47
- package/dist/esm/src/component_container.test.d.ts +24 -24
- package/dist/esm/src/constants.d.ts +17 -17
- package/dist/esm/src/provider.d.ts +79 -79
- package/dist/esm/src/provider.test.d.ts +23 -23
- package/dist/esm/src/types.d.ts +62 -62
- package/dist/esm/test/setup.d.ts +17 -17
- package/dist/esm/test/util.d.ts +5 -5
- package/dist/index.cjs.js +397 -397
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/src/component.d.ts +43 -43
- package/dist/src/component_container.d.ts +47 -47
- package/dist/src/component_container.test.d.ts +24 -24
- package/dist/src/constants.d.ts +17 -17
- package/dist/src/provider.d.ts +79 -79
- package/dist/src/provider.test.d.ts +23 -23
- package/dist/src/types.d.ts +62 -62
- package/dist/test/setup.d.ts +17 -17
- package/dist/test/util.d.ts +5 -5
- package/package.json +3 -3
|
@@ -1,23 +1,23 @@
|
|
|
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 '../test/setup';
|
|
18
|
-
declare module './types' {
|
|
19
|
-
interface NameServiceMapping {
|
|
20
|
-
test: {};
|
|
21
|
-
badtest: {};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
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 '../test/setup';
|
|
18
|
+
declare module './types' {
|
|
19
|
+
interface NameServiceMapping {
|
|
20
|
+
test: {};
|
|
21
|
+
badtest: {};
|
|
22
|
+
}
|
|
23
|
+
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
50
|
-
export
|
|
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
|
|
61
|
-
export
|
|
62
|
-
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
|
+
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;
|
package/dist/test/setup.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/test/util.d.ts
CHANGED
|
@@ -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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/component",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "Firebase Component Platform",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"trusted-type-check": "tsec -p tsconfig.json --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@firebase/util": "1.10.
|
|
34
|
+
"@firebase/util": "1.10.2",
|
|
35
35
|
"tslib": "^2.1.0"
|
|
36
36
|
},
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"rollup": "2.79.1",
|
|
40
40
|
"rollup-plugin-typescript2": "0.31.2",
|
|
41
|
-
"typescript": "
|
|
41
|
+
"typescript": "5.5.4"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"directory": "packages/component",
|