identifier.d.ts 1.7 KB

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