UNPKG

1.76 kBTypeScriptView Raw
1/*! firebase-admin v10.0.0 */
2/*!
3 * Copyright 2020 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 * Used for looking up an account by uid.
19 *
20 * See {@link BaseAuth.getUsers}.
21 */
22export interface UidIdentifier {
23 uid: string;
24}
25/**
26 * Used for looking up an account by email.
27 *
28 * See {@link BaseAuth.getUsers}.
29 */
30export interface EmailIdentifier {
31 email: string;
32}
33/**
34 * Used for looking up an account by phone number.
35 *
36 * See {@link BaseAuth.getUsers}.
37 */
38export interface PhoneIdentifier {
39 phoneNumber: string;
40}
41/**
42 * Used for looking up an account by federated provider.
43 *
44 * See {@link BaseAuth.getUsers}.
45 */
46export interface ProviderIdentifier {
47 providerId: string;
48 providerUid: string;
49}
50/**
51 * Identifies a user to be looked up.
52 */
53export declare type UserIdentifier = UidIdentifier | EmailIdentifier | PhoneIdentifier | ProviderIdentifier;
54export declare function isUidIdentifier(id: UserIdentifier): id is UidIdentifier;
55export declare function isEmailIdentifier(id: UserIdentifier): id is EmailIdentifier;
56export declare function isPhoneIdentifier(id: UserIdentifier): id is PhoneIdentifier;
57export declare function isProviderIdentifier(id: ProviderIdentifier): id is ProviderIdentifier;