38 lines
713 B
TypeScript
38 lines
713 B
TypeScript
/**
|
|
* 浏览器提供商接口
|
|
* 所有Provider必须实现此接口
|
|
*/
|
|
|
|
import {
|
|
IBrowserCapabilities,
|
|
ILaunchOptions,
|
|
ILaunchResult,
|
|
IProviderMetadata
|
|
} from '../types';
|
|
|
|
export interface IBrowserProvider {
|
|
// 元数据
|
|
getName(): string;
|
|
getVersion(): string;
|
|
isFree(): boolean;
|
|
getCapabilities(): IBrowserCapabilities;
|
|
getMetadata(): IProviderMetadata;
|
|
|
|
// 生命周期
|
|
launch(options?: ILaunchOptions): Promise<ILaunchResult>;
|
|
close(): Promise<void>;
|
|
|
|
// 浏览器访问
|
|
getBrowser(): any;
|
|
getPage(): any;
|
|
|
|
// 数据管理
|
|
clearCache(): Promise<void>;
|
|
|
|
// Actions (Provider特定)
|
|
getActionFactory(): any;
|
|
|
|
// 配置验证
|
|
validateConfig(): Promise<boolean>;
|
|
}
|