UNPKG

2.17 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 */
17import { ErrorFactory } from '@firebase/util';
18export declare const enum ErrorCode {
19 TRACE_STARTED_BEFORE = "trace started",
20 TRACE_STOPPED_BEFORE = "trace stopped",
21 NONPOSITIVE_TRACE_START_TIME = "nonpositive trace startTime",
22 NONPOSITIVE_TRACE_DURATION = "nonpositive trace duration",
23 NO_WINDOW = "no window",
24 NO_APP_ID = "no app id",
25 NO_PROJECT_ID = "no project id",
26 NO_API_KEY = "no api key",
27 INVALID_CC_LOG = "invalid cc log",
28 FB_NOT_DEFAULT = "FB not default",
29 RC_NOT_OK = "RC response not ok",
30 INVALID_ATTRIBUTE_NAME = "invalid attribute name",
31 INVALID_ATTRIBUTE_VALUE = "invalid attribute value",
32 INVALID_CUSTOM_METRIC_NAME = "invalid custom metric name",
33 INVALID_STRING_MERGER_PARAMETER = "invalid String merger input",
34 ALREADY_INITIALIZED = "already initialized"
35}
36interface ErrorParams {
37 [ErrorCode.TRACE_STARTED_BEFORE]: {
38 traceName: string;
39 };
40 [ErrorCode.TRACE_STOPPED_BEFORE]: {
41 traceName: string;
42 };
43 [ErrorCode.NONPOSITIVE_TRACE_START_TIME]: {
44 traceName: string;
45 };
46 [ErrorCode.NONPOSITIVE_TRACE_DURATION]: {
47 traceName: string;
48 };
49 [ErrorCode.INVALID_ATTRIBUTE_NAME]: {
50 attributeName: string;
51 };
52 [ErrorCode.INVALID_ATTRIBUTE_VALUE]: {
53 attributeValue: string;
54 };
55 [ErrorCode.INVALID_CUSTOM_METRIC_NAME]: {
56 customMetricName: string;
57 };
58}
59export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
60export {};