import { EventEmitter } from 'node:events';
import type { Page, Browser } from 'puppeteer-core';
import TypedEmitter from 'typed-emitter';
import { BrowserManager } from './browser/manager';
import { ConvertType } from './converter';
import { File } from './file';
export declare namespace Preview {
    type PartialByKeys<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> & Partial<Pick<T, K>>;
    export type Events = {
        close: (window: any) => void;
        exit: () => void;
        launch: () => void;
        open: (window: any, location: string) => void;
        opening: (location: string) => void;
    };
    export interface Options {
        browserManager: BrowserManager;
        height: number;
        width: number;
    }
    export type ConstructorOptions = PartialByKeys<Options, 'height' | 'width'>;
    export interface Window extends EventEmitter {
        page: Page;
        close: () => Promise<void>;
        load: (uri: string) => Promise<void>;
    }
    export {};
}
declare const Preview_base: new () => TypedEmitter<Preview.Events>;
export declare class Preview extends Preview_base {
    readonly options: Preview.Options;
    private puppeteerInternal;
    constructor(opts: Preview.ConstructorOptions);
    get puppeteer(): Browser | undefined;
    open(location: string): Promise<Preview.Window>;
    exit(): Promise<void>;
    private get browserManager();
    private createWindowObject;
    private createWindow;
    private launch;
}
export declare function fileToURI(file: File, type: ConvertType): string;
export {};
