Skip to content

Commit ba7f084

Browse files
committed
PR feedback
1 parent 4195817 commit ba7f084

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

common/api-review/auth-exp.api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface ActionCodeInfo {
2020
multiFactorInfo?: MultiFactorInfo | null;
2121
previousEmail?: string | null;
2222
};
23-
operation: string;
23+
operation: typeof ActionCodeOperation[keyof typeof ActionCodeOperation];
2424
}
2525

2626
// @public
@@ -324,19 +324,19 @@ export function multiFactor(user: User): MultiFactorUser;
324324

325325
// @public
326326
export interface MultiFactorAssertion {
327-
readonly factorId: string;
327+
readonly factorId: typeof FactorId[keyof typeof FactorId];
328328
}
329329

330330
// @public
331331
export interface MultiFactorError extends AuthError {
332-
readonly operationType: string;
332+
readonly operationType: typeof OperationType[keyof typeof OperationType];
333333
}
334334

335335
// @public
336336
export interface MultiFactorInfo {
337337
readonly displayName?: string | null;
338338
readonly enrollmentTime: string;
339-
readonly factorId: string;
339+
readonly factorId: typeof FactorId[keyof typeof FactorId];
340340
readonly uid: string;
341341
}
342342

@@ -669,7 +669,7 @@ export interface User extends UserInfo {
669669

670670
// @public
671671
export interface UserCredential {
672-
operationType: string;
672+
operationType: typeof OperationType[keyof typeof OperationType];
673673
providerId: string | null;
674674
user: User;
675675
}

packages-exp/auth-exp/src/model/public_types.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ import {
2424
Unsubscribe
2525
} from '@firebase/util';
2626

27+
import {
28+
FactorId as FactorIdMap,
29+
OperationType as OperationTypeMap,
30+
ActionCodeOperation as ActionCodeOperationMap,
31+
} from './enum_maps';
32+
2733
export { CompleteFn, ErrorFn, NextFn, Unsubscribe };
2834
/**
2935
* Enumeration of supported providers.
@@ -431,7 +437,7 @@ export interface ActionCodeInfo {
431437
/**
432438
* The type of operation that generated the action code.
433439
*/
434-
operation: string;
440+
operation: typeof ActionCodeOperationMap[keyof typeof ActionCodeOperationMap];
435441
}
436442

437443
/**
@@ -603,7 +609,7 @@ export interface ConfirmationResult {
603609
*/
604610
export interface MultiFactorAssertion {
605611
/** The identifier of the second factor. */
606-
readonly factorId: string;
612+
readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
607613
}
608614

609615
/**
@@ -641,7 +647,7 @@ export interface MultiFactorError extends AuthError {
641647
/**
642648
* The type of operation (e.g., sign-in, link, or reauthenticate) during which the error was raised.
643649
*/
644-
readonly operationType: string;
650+
readonly operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
645651
}
646652

647653
/**
@@ -657,7 +663,7 @@ export interface MultiFactorInfo {
657663
/** The enrollment date of the second factor formatted as a UTC string. */
658664
readonly enrollmentTime: string;
659665
/** The identifier of the second factor. */
660-
readonly factorId: string;
666+
readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
661667
}
662668

663669
/**
@@ -1044,7 +1050,7 @@ export interface UserCredential {
10441050
/**
10451051
* The type of operation which was used to authenticate the user (such as sign-in or link).
10461052
*/
1047-
operationType: string;
1053+
operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
10481054
}
10491055

10501056
/**

0 commit comments

Comments
 (0)