UNPKG

2.45 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 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 */
17/**
18 * A utility class to parse email action URLs such as password reset, email verification,
19 * email link sign in, etc.
20 *
21 * @public
22 */
23export declare class ActionCodeURL {
24 /**
25 * The API key of the email action link.
26 */
27 readonly apiKey: string;
28 /**
29 * The action code of the email action link.
30 */
31 readonly code: string;
32 /**
33 * The continue URL of the email action link. Null if not provided.
34 */
35 readonly continueUrl: string | null;
36 /**
37 * The language code of the email action link. Null if not provided.
38 */
39 readonly languageCode: string | null;
40 /**
41 * The action performed by the email action link. It returns from one of the types from
42 * {@link ActionCodeInfo}
43 */
44 readonly operation: string;
45 /**
46 * The tenant ID of the email action link. Null if the email action is from the parent project.
47 */
48 readonly tenantId: string | null;
49 /**
50 * @param actionLink - The link from which to extract the URL.
51 * @returns The {@link ActionCodeURL} object, or null if the link is invalid.
52 *
53 * @internal
54 */
55 constructor(actionLink: string);
56 /**
57 * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
58 * otherwise returns null.
59 *
60 * @param link - The email action link string.
61 * @returns The {@link ActionCodeURL} object, or null if the link is invalid.
62 *
63 * @public
64 */
65 static parseLink(link: string): ActionCodeURL | null;
66}
67/**
68 * Parses the email action link string and returns an {@link ActionCodeURL} if
69 * the link is valid, otherwise returns null.
70 *
71 * @public
72 */
73export declare function parseActionCodeURL(link: string): ActionCodeURL | null;