File tree Expand file tree Collapse file tree 2 files changed +29
-51
lines changed
packages-exp/installations-compat/src Expand file tree Collapse file tree 2 files changed +29
-51
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 16
16
*/
17
17
18
18
import { firebase } from '@firebase/app-compat' ;
19
- import { registerInstallations } from './config' ;
20
19
import { name , version } from '../package.json' ;
21
20
import { _FirebaseNamespace } from '@firebase/app-types/private' ;
21
+ import { Component , ComponentType } from '@firebase/component' ;
22
+ import { FirebaseInstallations as FirebaseInstallationsCompat } from '@firebase/installations-types' ;
23
+ import { FirebaseApp } from '@firebase/app-types' ;
24
+ import { InstallationsCompat } from './installationsCompat' ;
25
+
26
+ declare module '@firebase/component' {
27
+ interface NameServiceMapping {
28
+ 'app-compat' : FirebaseApp ;
29
+ 'installations-compat' : FirebaseInstallationsCompat ;
30
+ }
31
+ }
32
+
33
+ function registerInstallations ( instance : _FirebaseNamespace ) : void {
34
+ instance . INTERNAL . registerComponent (
35
+ new Component (
36
+ 'installations-compat' ,
37
+ container => {
38
+ const app = container . getProvider ( 'app-compat' ) . getImmediate ( ) ! ;
39
+ const installations = container
40
+ . getProvider ( 'installations-exp' )
41
+ . getImmediate ( ) ! ;
42
+ return new InstallationsCompat ( app , installations ) ;
43
+ } ,
44
+ ComponentType . PUBLIC
45
+ )
46
+ ) ;
47
+
48
+ instance . registerVersion ( name , version ) ;
49
+ }
22
50
23
- firebase . registerVersion ( name , version ) ;
24
51
registerInstallations ( firebase as _FirebaseNamespace ) ;
You can’t perform that action at this time.
0 commit comments