Skip to content

Commit 7b59d53

Browse files
committed
Migrate auth to component
1 parent 359fba9 commit 7b59d53

File tree

6 files changed

+645
-587
lines changed

6 files changed

+645
-587
lines changed

packages/auth-interop-types/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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.**
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
declare module '@firebase/component' {
30+
interface ComponentContainer {
31+
getProvider(name: 'auth-interop'): Provider<FirebaseAuthInternal>;
32+
}
33+
34+
interface Provider<T> {
35+
36+
}
37+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../config/tsconfig.base.json",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
6+
"exclude": [
7+
"dist/**/*"
8+
]
9+
}

0 commit comments

Comments
 (0)