UNPKG

1.61 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2021 Google LLC
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 */
17export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
18interface FirebaseIdToken {
19 iss: string;
20 aud: string;
21 sub: string;
22 iat: number;
23 exp: number;
24 user_id: string;
25 auth_time: number;
26 provider_id?: 'anonymous';
27 email?: string;
28 email_verified?: boolean;
29 phone_number?: string;
30 name?: string;
31 picture?: string;
32 firebase: {
33 sign_in_provider: FirebaseSignInProvider;
34 identities?: {
35 [provider in FirebaseSignInProvider]?: string[];
36 };
37 };
38 [claim: string]: unknown;
39 uid?: never;
40}
41export declare type EmulatorMockTokenOptions = ({
42 user_id: string;
43} | {
44 sub: string;
45}) & Partial<FirebaseIdToken>;
46export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
47export {};