1
0
mirror of https://github.com/musix-org/musix-oss synced 2026-05-05 13:16:34 +00:00
This commit is contained in:
MatteZ02
2019-10-10 16:43:04 +03:00
parent 6f6ac8a6fa
commit 50b9bed483
9432 changed files with 1988816 additions and 167 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+29
View File
@@ -0,0 +1,29 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseNamespace } from '@firebase/app-types';
import { FirebasePerformance } from '@firebase/performance-types';
export declare function registerPerformance(instance: FirebaseNamespace): void;
declare module '@firebase/app-types' {
interface FirebaseNamespace {
performance?: {
(app?: FirebaseApp): FirebasePerformance;
};
}
interface FirebaseApp {
performance?(): FirebasePerformance;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+32
View File
@@ -0,0 +1,32 @@
/**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare const SDK_VERSION: string;
/** The prefix for start User Timing marks used for creating Traces. */
export declare const TRACE_START_MARK_PREFIX = "FB-PERF-TRACE-START";
/** The prefix for stop User Timing marks used for creating Traces. */
export declare const TRACE_STOP_MARK_PREFIX = "FB-PERF-TRACE-STOP";
/** The prefix for User Timing measure used for creating Traces. */
export declare const TRACE_MEASURE_PREFIX = "FB-PERF-TRACE-MEASURE";
/** The prefix for out of the box page load Trace name. */
export declare const OOB_TRACE_PAGE_LOAD_PREFIX = "_wt_";
export declare const FIRST_PAINT_COUNTER_NAME = "_fp";
export declare const FIRST_CONTENTFUL_PAINT_COUNTER_NAME = "_fcp";
export declare const FIRST_INPUT_DELAY_COUNTER_NAME = "_fid";
export declare const CONFIG_LOCAL_STORAGE_KEY = "@firebase/performance/config";
export declare const CONFIG_EXPIRY_LOCAL_STORAGE_KEY = "@firebase/performance/configexpire";
export declare const SERVICE = "performance";
export declare const SERVICE_NAME = "Performance";
+26
View File
@@ -0,0 +1,26 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Trace } from '../resources/trace';
import { FirebaseApp } from '@firebase/app-types';
import { FirebasePerformance } from '@firebase/performance-types';
export declare class PerformanceController implements FirebasePerformance {
readonly app: FirebaseApp;
constructor(app: FirebaseApp);
trace(name: string): Trace;
instrumentationEnabled: boolean;
dataCollectionEnabled: boolean;
}
@@ -0,0 +1,41 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare const enum HttpMethod {
HTTP_METHOD_UNKNOWN = 0,
GET = 1,
PUT = 2,
POST = 3,
DELETE = 4,
HEAD = 5,
PATCH = 6,
OPTIONS = 7,
TRACE = 8,
CONNECT = 9
}
export interface NetworkRequest {
url: string;
httpMethod?: HttpMethod;
requestPayloadBytes?: number;
responsePayloadBytes?: number;
httpResponseCode?: number;
responseContentType?: string;
startTimeUs?: number;
timeToRequestCompletedUs?: number;
timeToResponseInitiatedUs?: number;
timeToResponseCompletedUs?: number;
}
export declare function createNetworkRequestEntry(entry: PerformanceEntry): void;
+115
View File
@@ -0,0 +1,115 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PerformanceTrace } from '@firebase/performance-types';
export declare class Trace implements PerformanceTrace {
readonly name: string;
readonly isAuto: boolean;
private state;
startTimeUs: number;
durationUs: number;
private customAttributes;
counters: {
[counterName: string]: number;
};
private api;
private randomId;
private traceStartMark;
private traceStopMark;
private traceMeasure;
/**
* @param name The name of the trace.
* @param isAuto If the trace is auto-instrumented.
* @param traceMeasureName The name of the measure marker in user timing specification. This field
* is only set when the trace is built for logging when the user directly uses the user timing
* api (performance.mark and performance.measure).
*/
constructor(name: string, isAuto?: boolean, traceMeasureName?: string);
/**
* Starts a trace. The measurement of the duration starts at this point.
*/
start(): void;
/**
* Stops the trace. The measurement of the duration of the trace stops at this point and trace
* is logged.
*/
stop(): void;
/**
* Records a trace with predetermined values. If this method is used a trace is created and logged
* directly. No need to use start and stop methods.
* @param startTime Trace start time since epoch in millisec
* @param duration The duraction of the trace in millisec
* @param options An object which can optionally hold maps of custom metrics and custom attributes
*/
record(startTime: number, duration: number, options?: {
metrics?: {
[key: string]: number;
};
attributes?: {
[key: string]: string;
};
}): void;
/**
* Increments a custom metric by a certain number or 1 if number not specified. Will create a new
* custom metric if one with the given name does not exist.
* @param counter Name of the custom metric
* @param num Increment by value
*/
incrementMetric(counter: string, num?: number): void;
/**
* Sets a custom metric to a specified value. Will create a new custom metric if one with the
* given name does not exist.
* @param counter Name of the custom metric
* @param num Set custom metric to this value
*/
putMetric(counter: string, num: number): void;
/**
* Returns the value of the custom metric by that name. If a custom metric with that name does
* not exist will return zero.
* @param counter
*/
getMetric(counter: string): number;
/**
* Sets a custom attribute of a trace to a certain value.
* @param attr
* @param value
*/
putAttribute(attr: string, value: string): void;
/**
* Retrieves the value a custom attribute of a trace is set to.
* @param attr
*/
getAttribute(attr: string): string | undefined;
removeAttribute(attr: string): void;
getAttributes(): {
[key: string]: string;
};
private setStartTime;
private setDuration;
/**
* Calculates and assigns the duration and start time of the trace using the measure performance
* entry.
*/
private calculateTraceMetrics;
/**
* @param navigationTimings A single element array which contains the navigationTIming object of
* the page load
* @param paintTimings A array which contains paintTiming object of the page load
* @param firstInputDelay First input delay in millisec
*/
static createOobTrace(navigationTimings: PerformanceNavigationTiming[], paintTimings: PerformanceEntry[], firstInputDelay?: number): void;
static createUserTimingTrace(measureName: string): void;
}
+49
View File
@@ -0,0 +1,49 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare global {
interface Window {
PerformanceObserver: typeof PerformanceObserver;
perfMetrics?: {
onFirstInputDelay: Function;
};
}
}
export declare type EntryType = 'mark' | 'measure' | 'paint' | 'resource' | 'frame' | 'navigation';
/**
* This class holds a reference to various browser related objects injected by set methods.
*/
export declare class Api {
private performance;
/** PreformanceObserver constructor function. */
private PerformanceObserver;
private windowLocation;
onFirstInputDelay?: Function;
localStorage: Storage;
document: Document;
navigator: Navigator;
constructor(window?: Window);
getUrl(): string;
mark(name: string): void;
measure(measureName: string, mark1: string, mark2: string): void;
getEntriesByType(type: EntryType): PerformanceEntry[];
getEntriesByName(name: string): PerformanceEntry[];
getTimeOrigin(): number;
requiredApisAvailable(): boolean;
setupObserver(entryType: EntryType, callback: (entry: PerformanceEntry) => void): void;
static getInstance(): Api;
}
export declare function setupApi(window: Window): void;
+19
View File
@@ -0,0 +1,19 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { LogHandler } from '@firebase/logger';
/** Log handler for cc service to send the performance logs to the server. */
export declare function ccHandler(serializer: (...args: any[]) => string): LogHandler;
+21
View File
@@ -0,0 +1,21 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '@firebase/installations';
export declare function getIidPromise(): Promise<string>;
export declare function getIid(): string | undefined;
export declare function getAuthTokenPromise(): Promise<string>;
export declare function getAuthenticationToken(): string | undefined;
@@ -0,0 +1,18 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare function getInitializationPromise(): Promise<void>;
export declare function isPerfInitialized(): boolean;
@@ -0,0 +1 @@
export declare function setupOobResources(): void;
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NetworkRequest } from '../resources/network_request';
import { Trace } from '../resources/trace';
export declare function logTrace(trace: Trace): void;
export declare function logNetworkRequest(networkRequest: NetworkRequest): void;
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export declare function getConfig(iid: string): Promise<void>;
@@ -0,0 +1,34 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { FirebaseApp } from '@firebase/app-types';
export declare class SettingsService {
instrumentationEnabled: boolean;
dataCollectionEnabled: boolean;
loggingEnabled: boolean;
tracesSamplingRate: number;
networkRequestsSamplingRate: number;
logEndPointUrl: string;
logSource: number;
logTraceAfterSampling: boolean;
logNetworkAfterSampling: boolean;
configTimeToLive: number;
firebaseAppInstance: FirebaseApp;
getAppId(): string;
getProjectId(): string;
getApiKey(): string;
static getInstance(): SettingsService;
}
@@ -0,0 +1,42 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
declare const enum ServiceWorkerStatus {
UNKNOWN = 0,
UNSUPPORTED = 1,
CONTROLLED = 2,
UNCONTROLLED = 3
}
export declare enum VisibilityState {
UNKNOWN = 0,
VISIBLE = 1,
HIDDEN = 2,
PRERENDER = 3,
UNLOADED = 4
}
declare const enum EffectiveConnectionType {
UNKNOWN = 0,
CONNECTION_SLOW_2G = 1,
CONNECTION_2G = 2,
CONNECTION_3G = 3,
CONNECTION_4G = 4
}
export declare function getServiceWorkerStatus(): ServiceWorkerStatus;
export declare function getVisibilityState(): VisibilityState;
export declare function getEffectiveConnectionType(): EffectiveConnectionType;
export declare function isValidCustomAttributeName(name: string): boolean;
export declare function isValidCustomAttributeValue(value: string): boolean;
export {};
+18
View File
@@ -0,0 +1,18 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Logger } from '@firebase/logger';
export declare const consoleLogger: Logger;
+50
View File
@@ -0,0 +1,50 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ErrorFactory } from '@firebase/util';
export declare const enum ErrorCode {
TRACE_STARTED_BEFORE = "trace started",
TRACE_STOPPED_BEFORE = "trace stopped",
NO_WINDOW = "no window",
NO_APP_ID = "no app id",
NO_PROJECT_ID = "no project id",
NO_API_KEY = "no api key",
INVALID_CC_LOG = "invalid cc log",
FB_NOT_DEFAULT = "FB not default",
RC_NOT_OK = "RC response not ok",
INVALID_ATTRIBUTE_NAME = "invalid attribute name",
INVALID_ATTRIBUTE_VALUE = "invalid attribute value",
INVALID_CUSTOM_METRIC_NAME = "invalide custom metric name"
}
interface ErrorParams {
[ErrorCode.TRACE_STARTED_BEFORE]: {
traceName: string;
};
[ErrorCode.TRACE_STOPPED_BEFORE]: {
traceName: string;
};
[ErrorCode.INVALID_ATTRIBUTE_NAME]: {
attributeName: string;
};
[ErrorCode.INVALID_ATTRIBUTE_VALUE]: {
attributeValue: string;
};
[ErrorCode.INVALID_CUSTOM_METRIC_NAME]: {
customMetricName: string;
};
}
export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
export {};
+21
View File
@@ -0,0 +1,21 @@
/**
* @license
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Returns true if the metric is custom and does not start with reserved prefix, or if
* the metric is one of out of the box page load trace metrics.
*/
export declare function isValidMetricName(name: string, traceName?: string): boolean;