/**
 * 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 EventEmitter from 'events';
import { BrowserContext } from './browserContext';
import { Page } from './page';
import type { Language } from './codegen/types';
import type { CallMetadata, InstrumentationListener, SdkObject } from './instrumentation';
import type { AriaTemplateNode } from '@isomorphic/ariaSnapshot';
import type { Progress } from './progress';
import type * as channels from '@protocol/channels';
import type * as actions from '@recorder/actions';
import type { CallLog, ElementInfo, Mode, Source } from '@recorder/recorderTypes';
type RecorderParams = channels.BrowserContextEnableRecorderParams & {
    hideToolbar?: boolean;
};
export declare const RecorderEvent: {
    readonly PausedStateChanged: "pausedStateChanged";
    readonly ModeChanged: "modeChanged";
    readonly ElementPicked: "elementPicked";
    readonly CallLogsUpdated: "callLogsUpdated";
    readonly UserSourcesChanged: "userSourcesChanged";
    readonly ActionAdded: "actionAdded";
    readonly SignalAdded: "signalAdded";
    readonly PageNavigated: "pageNavigated";
    readonly ContextClosed: "contextClosed";
};
export type RecorderEventMap = {
    [RecorderEvent.PausedStateChanged]: [paused: boolean];
    [RecorderEvent.ModeChanged]: [mode: Mode];
    [RecorderEvent.ElementPicked]: [elementInfo: ElementInfo, userGesture?: boolean];
    [RecorderEvent.CallLogsUpdated]: [callLogs: CallLog[]];
    [RecorderEvent.UserSourcesChanged]: [sources: Source[], pausedSourceId?: string];
    [RecorderEvent.ActionAdded]: [action: actions.ActionInContext];
    [RecorderEvent.SignalAdded]: [signal: actions.SignalInContext];
    [RecorderEvent.PageNavigated]: [url: string];
    [RecorderEvent.ContextClosed]: [];
};
export declare class Recorder extends EventEmitter<RecorderEventMap> implements InstrumentationListener {
    readonly handleSIGINT: boolean | undefined;
    private _context;
    private _params;
    private _mode;
    private _highlightedElement;
    private _overlayState;
    private _currentCallsMetadata;
    private _userSources;
    private _debugger;
    private _omitCallTracking;
    private _currentLanguage;
    private _recorderMode;
    private _signalProcessor;
    private _pageAliases;
    private _lastPopupOrdinal;
    private _lastDialogOrdinal;
    private _lastDownloadOrdinal;
    private _listeners;
    private _enabled;
    private _callLogs;
    private _pickLocatorPage;
    static forContext(context: BrowserContext, params: RecorderParams): Promise<Recorder>;
    static existingForContext(context: BrowserContext): Promise<Recorder | undefined>;
    private static _create;
    constructor(context: BrowserContext, params: RecorderParams);
    private _install;
    private _pausedStateChanged;
    mode(): Mode;
    setMode(mode: Mode): Promise<void>;
    pickLocator(progress: Progress, page: Page): Promise<string>;
    url(): string | undefined;
    setHighlightedSelector(selector: string): Promise<void>;
    setHighlightedAriaTemplate(ariaTemplate: AriaTemplateNode): Promise<void>;
    step(): void;
    setLanguage(language: Language): Promise<void>;
    resume(): void;
    pause(): void;
    paused(): boolean;
    close(): void;
    hideHighlightedSelector(): Promise<void>;
    pausedSourceId(): any;
    userSources(): Source[];
    callLog(): CallLog[];
    private _scopeHighlightedSelectorToFrame;
    private _refreshOverlay;
    onBeforeCall(sdkObject: SdkObject, metadata: CallMetadata): Promise<void>;
    onAfterCall(sdkObject: SdkObject, metadata: CallMetadata): Promise<void>;
    private _updateUserSources;
    onCallLog(sdkObject: SdkObject, metadata: CallMetadata, logName: string, message: string): Promise<void>;
    private _updateCallLog;
    private _isRecording;
    private _readSource;
    private _setEnabled;
    private _onPage;
    private _filePrimaryURLChanged;
    clear(): void;
    private _describeMainFrame;
    private _describeFrame;
    private _testIdAttributeName;
    private _createActionInContext;
    private _performAction;
    private _recordAction;
    private _onFrameNavigated;
    private _onPopup;
    private _onDownload;
    private _onDialog;
}
export {};
//# sourceMappingURL=recorder.d.ts.map