Skip to content

Commit 1934bf1

Browse files
committed
Reuse types from @firebase/util.
1 parent 58f8148 commit 1934bf1

File tree

3 files changed

+3
-80
lines changed

3 files changed

+3
-80
lines changed

packages/app-types/index.d.ts

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -121,84 +121,6 @@ export interface VersionService {
121121
version: string;
122122
}
123123

124-
export type FirebaseSignInProvider =
125-
| 'custom'
126-
| 'email'
127-
| 'password'
128-
| 'phone'
129-
| 'anonymous'
130-
| 'google.com'
131-
| 'facebook.com'
132-
| 'github.com'
133-
| 'twitter.com'
134-
| 'microsoft.com'
135-
| 'apple.com';
136-
137-
export interface FirebaseIdToken {
138-
// Firebase Auth tokens contain snake_case claims following the JWT standard / convention.
139-
/* eslint-disable camelcase */
140-
141-
// Always set to https://securetoken.google.com/PROJECT_ID
142-
iss: string;
143-
144-
// Always set to PROJECT_ID
145-
aud: string;
146-
147-
// The user's unique id
148-
sub: string;
149-
150-
// The token issue time, in seconds since epoch
151-
iat: number;
152-
153-
// The token expiry time, normally 'iat' + 3600
154-
exp: number;
155-
156-
// The user's unique id, must be equal to 'sub'
157-
user_id: string;
158-
159-
// The time the user authenticated, normally 'iat'
160-
auth_time: number;
161-
162-
// The sign in provider, only set when the provider is 'anonymous'
163-
provider_id?: 'anonymous';
164-
165-
// The user's primary email
166-
email?: string;
167-
168-
// The user's email verification status
169-
email_verified?: boolean;
170-
171-
// The user's primary phone number
172-
phone_number?: string;
173-
174-
// The user's display name
175-
name?: string;
176-
177-
// The user's profile photo URL
178-
picture?: string;
179-
180-
// Information on all identities linked to this user
181-
firebase: {
182-
// The primary sign-in provider
183-
sign_in_provider: FirebaseSignInProvider;
184-
185-
// A map of providers to the user's list of unique identifiers from
186-
// each provider
187-
identities?: { [provider in FirebaseSignInProvider]?: string[] };
188-
};
189-
190-
// Custom claims set by the developer
191-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
192-
[claim: string]: any;
193-
194-
uid?: never; // Try to catch a common mistake of "uid" (should be "sub" instead).
195-
196-
/* eslint-enable camelcase */
197-
}
198-
199-
export type EmulatorMockTokenOptions = ({ user_id: string } | { sub: string }) &
200-
Partial<FirebaseIdToken>;
201-
202124
declare module '@firebase/component' {
203125
interface NameServiceMapping {
204126
'app': FirebaseApp;

packages/firestore-types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { EmulatorMockTokenOptions } from '@firebase/app-types';
18+
import { EmulatorMockTokenOptions } from '@firebase/util';
1919

2020
export type DocumentData = { [field: string]: any };
2121

packages/firestore-types/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"index.d.ts"
1313
],
1414
"peerDependencies": {
15-
"@firebase/app-types": "0.x"
15+
"@firebase/app-types": "0.x",
16+
"@firebase/util": "1.x"
1617
},
1718
"repository": {
1819
"directory": "packages/firestore-types",

0 commit comments

Comments
 (0)