2020-08-28 19:51:55 +02: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 20:43:26 +01:00
|
|
|
import { CallMetadata } from '../../instrumentation';
|
2021-04-24 05:39:09 +02:00
|
|
|
import { FrameSnapshot, ResourceSnapshot } from '../../snapshot/snapshotTypes';
|
2021-05-14 07:36:34 +02:00
|
|
|
import { BrowserContextOptions } from '../../types';
|
2021-01-29 15:57:57 +01:00
|
|
|
|
2020-08-28 19:51:55 +02:00
|
|
|
export type ContextCreatedTraceEvent = {
|
2021-07-02 23:33:38 +02:00
|
|
|
version: number,
|
2021-05-14 07:36:34 +02:00
|
|
|
type: 'context-options',
|
2020-08-28 19:51:55 +02:00
|
|
|
browserName: string,
|
2021-05-14 07:36:34 +02:00
|
|
|
options: BrowserContextOptions
|
2020-09-11 20:34:53 +02:00
|
|
|
};
|
|
|
|
|
|
2021-04-07 23:32:12 +02:00
|
|
|
export type ScreencastFrameTraceEvent = {
|
2021-04-25 05:39:48 +02:00
|
|
|
type: 'screencast-frame',
|
2021-04-07 23:32:12 +02:00
|
|
|
pageId: string,
|
2021-04-08 16:59:05 +02:00
|
|
|
sha1: string,
|
|
|
|
|
width: number,
|
|
|
|
|
height: number,
|
2021-05-14 07:36:34 +02:00
|
|
|
timestamp: number,
|
2021-04-07 23:32:12 +02:00
|
|
|
};
|
|
|
|
|
|
2020-09-11 06:42:09 +02:00
|
|
|
export type ActionTraceEvent = {
|
2021-04-23 18:28:18 +02:00
|
|
|
type: 'action' | 'event',
|
2021-06-30 00:28:15 +02:00
|
|
|
hasSnapshot: boolean,
|
2021-03-10 20:43:26 +01:00
|
|
|
metadata: CallMetadata,
|
2020-08-28 19:51:55 +02:00
|
|
|
};
|
2020-09-18 20:54:00 +02:00
|
|
|
|
2021-04-24 05:39:09 +02:00
|
|
|
export type ResourceSnapshotTraceEvent = {
|
|
|
|
|
type: 'resource-snapshot',
|
|
|
|
|
snapshot: ResourceSnapshot,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type FrameSnapshotTraceEvent = {
|
|
|
|
|
type: 'frame-snapshot',
|
|
|
|
|
snapshot: FrameSnapshot,
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-18 20:54:00 +02:00
|
|
|
export type TraceEvent =
|
|
|
|
|
ContextCreatedTraceEvent |
|
2021-04-07 23:32:12 +02:00
|
|
|
ScreencastFrameTraceEvent |
|
2021-01-16 03:30:55 +01:00
|
|
|
ActionTraceEvent |
|
2021-04-24 05:39:09 +02:00
|
|
|
ResourceSnapshotTraceEvent |
|
2021-05-14 05:41:32 +02:00
|
|
|
FrameSnapshotTraceEvent;
|