2020-08-28 10:51:55 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2021-03-10 11:43:26 -08:00
|
|
|
import { CallMetadata } from '../../instrumentation';
|
2021-01-29 06:57:57 -08:00
|
|
|
|
2020-08-28 10:51:55 -07:00
|
|
|
export type ContextCreatedTraceEvent = {
|
2021-01-15 18:30:55 -08:00
|
|
|
timestamp: number,
|
2020-08-28 10:51:55 -07:00
|
|
|
type: 'context-created',
|
|
|
|
browserName: string,
|
|
|
|
contextId: string,
|
|
|
|
deviceScaleFactor: number,
|
|
|
|
isMobile: boolean,
|
|
|
|
viewportSize?: { width: number, height: number },
|
2021-01-28 19:50:57 +01:00
|
|
|
debugName?: string,
|
2020-08-28 10:51:55 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
export type ContextDestroyedTraceEvent = {
|
2021-01-15 18:30:55 -08:00
|
|
|
timestamp: number,
|
2020-08-28 10:51:55 -07:00
|
|
|
type: 'context-destroyed',
|
|
|
|
contextId: string,
|
|
|
|
};
|
|
|
|
|
2020-09-11 11:34:53 -07:00
|
|
|
export type PageCreatedTraceEvent = {
|
2021-01-15 18:30:55 -08:00
|
|
|
timestamp: number,
|
2020-09-11 11:34:53 -07:00
|
|
|
type: 'page-created',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type PageDestroyedTraceEvent = {
|
2021-01-15 18:30:55 -08:00
|
|
|
timestamp: number,
|
2020-09-11 11:34:53 -07:00
|
|
|
type: 'page-destroyed',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
2021-04-08 05:32:12 +08:00
|
|
|
export type ScreencastFrameTraceEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'page-screencast-frame',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
pageTimestamp: number,
|
2021-04-08 22:59:05 +08:00
|
|
|
sha1: string,
|
|
|
|
width: number,
|
|
|
|
height: number,
|
2021-04-08 05:32:12 +08:00
|
|
|
};
|
|
|
|
|
2020-09-10 21:42:09 -07:00
|
|
|
export type ActionTraceEvent = {
|
2021-01-15 18:30:55 -08:00
|
|
|
timestamp: number,
|
2021-04-23 09:28:18 -07:00
|
|
|
type: 'action' | 'event',
|
2020-08-28 10:51:55 -07:00
|
|
|
contextId: string,
|
2021-03-10 11:43:26 -08:00
|
|
|
metadata: CallMetadata,
|
2020-08-28 10:51:55 -07:00
|
|
|
};
|
2020-09-18 11:54:00 -07:00
|
|
|
|
2021-01-15 18:30:55 -08:00
|
|
|
export type DialogOpenedEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'dialog-opened',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
dialogType: string,
|
|
|
|
message?: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type DialogClosedEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'dialog-closed',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
dialogType: string,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type NavigationEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'navigation',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
url: string,
|
|
|
|
sameDocument: boolean,
|
|
|
|
};
|
|
|
|
|
|
|
|
export type LoadEvent = {
|
|
|
|
timestamp: number,
|
|
|
|
type: 'load',
|
|
|
|
contextId: string,
|
|
|
|
pageId: string,
|
|
|
|
};
|
|
|
|
|
2020-09-18 11:54:00 -07:00
|
|
|
export type TraceEvent =
|
|
|
|
ContextCreatedTraceEvent |
|
|
|
|
ContextDestroyedTraceEvent |
|
|
|
|
PageCreatedTraceEvent |
|
|
|
|
PageDestroyedTraceEvent |
|
2021-04-08 05:32:12 +08:00
|
|
|
ScreencastFrameTraceEvent |
|
2021-01-15 18:30:55 -08:00
|
|
|
ActionTraceEvent |
|
|
|
|
DialogOpenedEvent |
|
|
|
|
DialogClosedEvent |
|
|
|
|
NavigationEvent |
|
2021-03-08 19:49:57 -08:00
|
|
|
LoadEvent;
|