diff --git a/test/playwright/TestUtils.ts b/test/playwright/TestUtils.ts index 357a5dd3..c18426c9 100644 --- a/test/playwright/TestUtils.ts +++ b/test/playwright/TestUtils.ts @@ -39,8 +39,7 @@ type EnsureAsync = T extends PromiseLike ? T : Promise; type EnsureAsyncProperties = { [Key in keyof T]: EnsureAsync }; - -type PromisifyMethods = { +type EnsureAsyncMethods = { [K in keyof T]: T[K] extends (...args: infer Args) => infer Return ? (...args: Args) => Promise : T[K]; @@ -54,7 +53,7 @@ type PromisifyMethods = { type PlaywrightApiProxy = ( // Interfaces that the proxy implements as async EnsureAsyncProperties> & - PromisifyMethods> & + EnsureAsyncMethods> & // Interfaces that the proxy implements as is (exclude async/custom) Omit ); @@ -66,7 +65,26 @@ interface ITerminalProxyCustomMethods { type TerminalProxyAsyncPropOverrides = 'cols' | 'rows' | 'modes'; type TerminalProxyAsyncMethodOverrides = 'hasSelection' | 'getSelection' | 'getSelectionPosition' | 'registerMarker'; -type TerminalProxyCustomOverrides = 'buffer'; +type TerminalProxyCustomOverrides = 'buffer' | ( + // TODO: Review and implement below if needed + 'element' | + 'textarea' | + 'markers' | + 'unicode' | + 'parser' | + 'options' | + 'onWriteParsed' | + 'open' | + 'attachCustomKeyEventHandler' | + 'registerLinkProvider' | + 'registerCharacterJoiner' | + 'deregisterCharacterJoiner' | + 'registerDecoration' | + 'selectLines' | + 'refresh' | + 'clearTextureAtlas' | + 'loadAddon' +); export class TerminalProxy implements ITerminalProxyCustomMethods, PlaywrightApiProxy { constructor(private readonly _page: Page) { } @@ -213,7 +231,7 @@ export class TerminalProxy implements ITerminalProxyCustomMethods, PlaywrightApi } } -class TerminalBufferNamespaceProxy implements PlaywrightApiProxy { +class TerminalBufferNamespaceProxy implements PlaywrightApiProxy { private _onBufferChange = new EventEmitter(); public readonly onBufferChange = this._onBufferChange.event;