File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ import {
27
27
} from '@firebase/component' ;
28
28
import { ERROR_FACTORY , AnalyticsError } from './src/errors' ;
29
29
30
+ import { version } from './package.json' ;
31
+
30
32
declare global {
31
33
interface Window {
32
34
[ key : string ] : unknown ;
@@ -89,12 +91,4 @@ declare module '@firebase/app-types' {
89
91
interface FirebaseApp {
90
92
analytics ( ) : FirebaseAnalytics ;
91
93
}
92
- }
93
-
94
- declare module '@firebase/component' {
95
- interface ComponentContainer {
96
- getProvider ( name : typeof ANALYTICS_TYPE ) : Provider < FirebaseAnalytics > ;
97
- }
98
-
99
- interface Provider < T > { }
100
- }
94
+ }
Original file line number Diff line number Diff line change @@ -102,8 +102,19 @@ export interface FirebaseNamespace {
102
102
SDK_VERSION : string ;
103
103
}
104
104
105
+ export interface PlatformLoggerService {
106
+ getPlatformInfoString ( ) : string ;
107
+ }
108
+
109
+ export interface VersionService {
110
+ library : string ;
111
+ version : string ;
112
+ }
113
+
105
114
declare module '@firebase/component' {
106
115
interface NameServiceMapping {
107
116
'app' : FirebaseApp ;
117
+ 'app-version' : VersionService ;
118
+ 'platform-logger' : PlatformLoggerService ;
108
119
}
109
120
}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export class FirebaseAppImpl implements FirebaseApp {
67
67
this . _addComponent (
68
68
new Component (
69
69
'platform-logger' ,
70
- container => new PlatformLoggerService ( container ) ,
70
+ ( container : ComponentContainer ) => new PlatformLoggerService ( container ) ,
71
71
ComponentType . PRIVATE
72
72
)
73
73
) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ import { FirebaseAppLiteImpl } from './lite/firebaseAppLite';
34
34
import { DEFAULT_ENTRY_NAME } from './constants' ;
35
35
import { version } from '../../firebase/package.json' ;
36
36
import { logger } from './logger' ;
37
- import { Component , ComponentType } from '@firebase/component' ;
37
+ import { Component , ComponentType , Name } from '@firebase/component' ;
38
38
import { VersionService } from './version-service' ;
39
39
40
40
/**
@@ -243,7 +243,7 @@ function registerVersionComponent(
243
243
) : FirebaseServiceNamespace < FirebaseService > | null {
244
244
return registerComponent (
245
245
new Component (
246
- `${ library } -version` ,
246
+ `${ library } -version` as Name ,
247
247
( ) => {
248
248
return new VersionService ( library , version ) ;
249
249
} ,
You can’t perform that action at this time.
0 commit comments