/**
 * 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.
 */
import type { Language } from '../locatorGenerators';
import type { ResourceSnapshot } from '@trace/snapshot';
import type * as trace from '@trace/trace';
import type { ActionTraceEvent } from '@trace/trace';
import type { ActionEntry, ContextEntry, PageEntry } from './entries';
import type { StackFrame } from '@protocol/channels';
import type { ActionGroup } from '../protocolFormatter';
export type SourceLocation = {
    file: string;
    line: number;
    column: number;
    source?: SourceModel;
};
export type SourceModel = {
    errors: {
        line: number;
        message: string;
    }[];
    content: string | undefined;
};
export type ResourceEntry = ResourceSnapshot & {
    id: string;
};
export type ActionTraceEventInContext = ActionEntry & {
    context: ContextEntry;
};
export type ActionTreeItem = {
    id: string;
    children: ActionTreeItem[];
    parent: ActionTreeItem | undefined;
    action: ActionTraceEventInContext;
};
export type ErrorDescription = {
    action?: ActionTraceEventInContext;
    stack?: StackFrame[];
    message: string;
};
export type Attachment = trace.AfterActionTraceEventAttachment & {
    callId: string;
};
export declare class TraceModel {
    readonly startTime: number;
    readonly endTime: number;
    readonly browserName: string;
    readonly channel?: string;
    readonly platform?: string;
    readonly playwrightVersion?: string;
    readonly wallTime?: number;
    readonly title?: string;
    readonly options: trace.BrowserContextEventOptions;
    readonly pages: PageEntry[];
    readonly actions: ActionTraceEventInContext[];
    readonly attachments: Attachment[];
    readonly visibleAttachments: Attachment[];
    readonly events: (trace.EventTraceEvent | trace.ConsoleMessageTraceEvent)[];
    readonly stdio: trace.StdioTraceEvent[];
    readonly errors: trace.ErrorTraceEvent[];
    readonly errorDescriptors: ErrorDescription[];
    readonly hasSource: boolean;
    readonly hasStepData: boolean;
    readonly sdkLanguage: Language | undefined;
    readonly testIdAttributeName: string | undefined;
    readonly sources: Map<string, SourceModel>;
    resources: ResourceEntry[];
    readonly actionCounters: Map<string, number>;
    readonly traceUri: string;
    readonly testTimeout?: number;
    constructor(traceUri: string, contexts: ContextEntry[]);
    createRelativeUrl(path: string): string;
    failedAction(): any;
    filteredActions(actionsFilter: ActionGroup[]): any[];
    renderActionTree(filter?: ActionGroup[]): string[];
    private _errorDescriptorsFromActions;
    private _errorDescriptorsFromTestRunner;
}
export declare function buildActionTree(actions: ActionTraceEventInContext[]): {
    rootItem: ActionTreeItem;
    itemMap: Map<string, ActionTreeItem>;
};
export declare function context(action: ActionTraceEvent | trace.EventTraceEvent | ResourceSnapshot): ContextEntry;
export declare function previousActionByEndTime(action: ActionTraceEvent): ActionTraceEvent;
export declare function nextActionByStartTime(action: ActionTraceEvent): ActionTraceEvent;
export declare function stats(action: ActionTraceEvent): {
    errors: number;
    warnings: number;
};
export declare function eventsForAction(action: ActionTraceEvent): (trace.EventTraceEvent | trace.ConsoleMessageTraceEvent)[];
//# sourceMappingURL=traceModel.d.ts.map