|
15 | 15 | * limitations under the License.
|
16 | 16 | */
|
17 | 17 |
|
18 |
| -import { EmulatorMockTokenOptions } from '@firebase/util'; |
19 |
| - |
20 | 18 | /**
|
21 | 19 | * <code>firebase</code> is a global namespace from which all Firebase
|
22 | 20 | * services are accessed.
|
@@ -9986,6 +9984,81 @@ declare namespace firebase.firestore {
|
9986 | 9984 | name: string;
|
9987 | 9985 | stack?: string;
|
9988 | 9986 | }
|
| 9987 | + |
| 9988 | + type FirebaseSignInProvider = |
| 9989 | + | 'custom' |
| 9990 | + | 'email' |
| 9991 | + | 'password' |
| 9992 | + | 'phone' |
| 9993 | + | 'anonymous' |
| 9994 | + | 'google.com' |
| 9995 | + | 'facebook.com' |
| 9996 | + | 'github.com' |
| 9997 | + | 'twitter.com' |
| 9998 | + | 'microsoft.com' |
| 9999 | + | 'apple.com'; |
| 10000 | + |
| 10001 | + interface FirebaseIdToken { |
| 10002 | + // Always set to https://securetoken.google.com/PROJECT_ID |
| 10003 | + iss: string; |
| 10004 | + |
| 10005 | + // Always set to PROJECT_ID |
| 10006 | + aud: string; |
| 10007 | + |
| 10008 | + // The user's unique id |
| 10009 | + sub: string; |
| 10010 | + |
| 10011 | + // The token issue time, in seconds since epoch |
| 10012 | + iat: number; |
| 10013 | + |
| 10014 | + // The token expiry time, normally 'iat' + 3600 |
| 10015 | + exp: number; |
| 10016 | + |
| 10017 | + // The user's unique id, must be equal to 'sub' |
| 10018 | + user_id: string; |
| 10019 | + |
| 10020 | + // The time the user authenticated, normally 'iat' |
| 10021 | + auth_time: number; |
| 10022 | + |
| 10023 | + // The sign in provider, only set when the provider is 'anonymous' |
| 10024 | + provider_id?: 'anonymous'; |
| 10025 | + |
| 10026 | + // The user's primary email |
| 10027 | + email?: string; |
| 10028 | + |
| 10029 | + // The user's email verification status |
| 10030 | + email_verified?: boolean; |
| 10031 | + |
| 10032 | + // The user's primary phone number |
| 10033 | + phone_number?: string; |
| 10034 | + |
| 10035 | + // The user's display name |
| 10036 | + name?: string; |
| 10037 | + |
| 10038 | + // The user's profile photo URL |
| 10039 | + picture?: string; |
| 10040 | + |
| 10041 | + // Information on all identities linked to this user |
| 10042 | + firebase: { |
| 10043 | + // The primary sign-in provider |
| 10044 | + sign_in_provider: FirebaseSignInProvider; |
| 10045 | + |
| 10046 | + // A map of providers to the user's list of unique identifiers from |
| 10047 | + // each provider |
| 10048 | + identities?: { [provider in FirebaseSignInProvider]?: string[] }; |
| 10049 | + }; |
| 10050 | + |
| 10051 | + // Custom claims set by the developer |
| 10052 | + [claim: string]: unknown; |
| 10053 | + |
| 10054 | + uid?: never; // Try to catch a common mistake of "uid" (should be "sub" instead). |
| 10055 | + } |
| 10056 | + |
| 10057 | + export type EmulatorMockTokenOptions = ( |
| 10058 | + | { user_id: string } |
| 10059 | + | { sub: string } |
| 10060 | + ) & |
| 10061 | + Partial<FirebaseIdToken>; |
9989 | 10062 | }
|
9990 | 10063 |
|
9991 | 10064 | export default firebase;
|
|
0 commit comments