File tree Expand file tree Collapse file tree 5 files changed +77
-19
lines changed Expand file tree Collapse file tree 5 files changed +77
-19
lines changed Original file line number Diff line number Diff line change
1
+ # @firebase/auth-interop-types
2
+
3
+ ** This package is not intended for direct usage, and should only be used via the officially supported [ firebase] ( https://www.npmjs.com/package/firebase ) package.**
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google Inc.
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
+
18
+ export interface FirebaseAuthTokenData {
19
+ accessToken : string ;
20
+ }
21
+
22
+ export interface FirebaseAuthInternal {
23
+ getToken ( refreshToken ?: boolean ) : Promise < FirebaseAuthTokenData | null > ;
24
+ getUid ( ) : string | null ;
25
+ addAuthTokenListener ( fn : ( token : string | null ) => void ) : void ;
26
+ removeAuthTokenListener ( fn : ( token : string | null ) => void ) : void ;
27
+ }
28
+
29
+ export type FirebaseAuthInternalName = 'auth-internal' ;
30
+
31
+ declare module '@firebase/component' {
32
+ interface NameServiceMapping {
33
+ 'auth-internal' : FirebaseAuthInternal ;
34
+ }
35
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @firebase/auth-interop-types" ,
3
+ "version" : " 0.1.0" ,
4
+ "description" : " @firebase/auth interop Types" ,
5
+ "author" :
" Firebase <[email protected] > (https://firebase.google.com/)" ,
6
+ "license" : " Apache-2.0" ,
7
+ "scripts" : {
8
+ "test" : " tsc"
9
+ },
10
+ "files" : [
11
+ " index.d.ts"
12
+ ],
13
+ "peerDependencies" : {
14
+ "@firebase/app-types" : " 0.x" ,
15
+ "@firebase/util" : " 0.x"
16
+ },
17
+ "repository" : {
18
+ "directory" : " packages/auth-types" ,
19
+ "type" : " git" ,
20
+ "url" : " https://github.com/firebase/firebase-js-sdk.git"
21
+ },
22
+ "bugs" : {
23
+ "url" : " https://github.com/firebase/firebase-js-sdk/issues"
24
+ },
25
+ "devDependencies" : {
26
+ "typescript" : " 3.6.4"
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../../config/tsconfig.base.json" ,
3
+ "compilerOptions" : {
4
+ "noEmit" : true
5
+ },
6
+ "exclude" : [
7
+ " dist/**/*"
8
+ ]
9
+ }
Original file line number Diff line number Diff line change @@ -618,27 +618,10 @@ fireauth.exportlib.exportFunction(
618
618
619
619
( function ( ) {
620
620
if ( typeof firebase === 'undefined' || ! firebase . INTERNAL ||
621
- ! firebase . INTERNAL . registerService ) {
621
+ ! firebase . INTERNAL . registerComponent ) {
622
622
throw new Error ( 'Cannot find the firebase namespace; be sure to include ' +
623
623
'firebase-app.js before this library.' ) ;
624
624
} else {
625
- /** @type {!firebase.ServiceFactory } */
626
- var factory = function ( app , extendApp ) {
627
- var auth = new fireauth . Auth ( app ) ;
628
- extendApp ( {
629
- 'INTERNAL' : {
630
- // Extend app.INTERNAL.getUid.
631
- 'getUid' : goog . bind ( auth . getUid , auth ) ,
632
- 'getToken' : goog . bind ( auth . getIdTokenInternal , auth ) ,
633
- 'addAuthTokenListener' :
634
- goog . bind ( auth . addAuthTokenListenerInternal , auth ) ,
635
- 'removeAuthTokenListener' :
636
- goog . bind ( auth . removeAuthTokenListenerInternal , auth )
637
- }
638
- } ) ;
639
- return auth ;
640
- } ;
641
-
642
625
var namespace = {
643
626
// Exports firebase.auth.ActionCodeInfo.Operation.
644
627
'ActionCodeInfo' : {
@@ -728,4 +711,4 @@ fireauth.exportlib.exportFunction(
728
711
'User' : fireauth . AuthUser
729
712
} ) ;
730
713
}
731
- } ) ( ) ;
714
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments