UNPKG

cypress-controls-ext

Version:

Extension to embed controls to controls panel in cypress app

41 lines (40 loc) 1.14 kB
export declare type ModeSetting = { open?: boolean; run?: boolean; }; export declare type ListenerSetting = (selector: string, event: string, handler: (target: Event) => void) => void; export declare type FnVoid = () => void; export declare type SetupControlSettings = { /** * Whether to add control for mode * default: true for both */ mode?: ModeSetting; /** * Uniq ID to html element when several elements added */ id: string; /** * Selector which will be injected */ selectorToInject?: string; /** * Whether to inject at the begginging or at the end (will use prepend or append or insertAfter) */ inject?: 'start' | 'end' | 'insertAfter' | 'insertBefore'; /** * HTML for injected control */ control: () => string; /** * css for controls * @param parentId wrapper html id for injected control */ style?: (parentId: string) => string; /** * event listener * @example * */ addEventListener: (parentId: string, listener: ListenerSetting, cyStop: FnVoid, cyRestart: FnVoid) => void; };