mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-08 06:30:04 +00:00
Remove duplicated nextFrame and ctrlSend methods from ClipboardHelper by delegating to KeyboardHelper instead. Amp-Thread-ID: https://ampcode.com/threads/T-019c15b9-efed-72eb-b092-1e92a11f44e3 Co-authored-by: Amp <amp@ampcode.com>
19 lines
497 B
TypeScript
19 lines
497 B
TypeScript
import type { Locator } from '@playwright/test'
|
|
|
|
import type { KeyboardHelper } from './KeyboardHelper'
|
|
|
|
export class ClipboardHelper {
|
|
constructor(
|
|
private readonly keyboard: KeyboardHelper,
|
|
private readonly canvas: Locator
|
|
) {}
|
|
|
|
async copy(locator?: Locator | null): Promise<void> {
|
|
await this.keyboard.ctrlSend('KeyC', locator ?? this.canvas)
|
|
}
|
|
|
|
async paste(locator?: Locator | null): Promise<void> {
|
|
await this.keyboard.ctrlSend('KeyV', locator ?? this.canvas)
|
|
}
|
|
}
|