docs(python): fix WebSocket types (#22155)

Fixes https://github.com/microsoft/playwright-python/issues/1841
This commit is contained in:
Max Schmitt 2023-04-03 22:21:33 +02:00 committed by GitHub
parent df6888a251
commit 590013e27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -16,6 +16,11 @@ Fired when the websocket closes.
Fired when the websocket receives a frame.
## event: WebSocket.frameReceived
* since: v1.9
* langs: python
- argument: <[string]|[Buffer]> frame payload
## event: WebSocket.frameReceived
* since: v1.9
* langs: csharp, java
@ -28,6 +33,11 @@ Fired when the websocket receives a frame.
Fired when the websocket sends a frame.
## event: WebSocket.frameSent
* since: v1.9
* langs: python
- argument: <[string]|[Buffer]> frame payload
## event: WebSocket.frameSent
* since: v1.9
* langs: csharp, java
@ -35,7 +45,7 @@ Fired when the websocket sends a frame.
## event: WebSocket.socketError
* since: v1.9
- argument: <[String]>
- argument: <[string]>
Fired when the websocket has an error.

View File

@ -18721,7 +18721,7 @@ export interface WebSocket {
/**
* Fired when the websocket has an error.
*/
on(event: 'socketerror', listener: (string: String) => void): this;
on(event: 'socketerror', listener: (string: string) => void): this;
/**
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
@ -18751,7 +18751,7 @@ export interface WebSocket {
/**
* Adds an event listener that will be automatically removed after it is triggered once. See `addListener` for more information about this event.
*/
once(event: 'socketerror', listener: (string: String) => void): this;
once(event: 'socketerror', listener: (string: string) => void): this;
/**
* Fired when the websocket closes.
@ -18781,7 +18781,7 @@ export interface WebSocket {
/**
* Fired when the websocket has an error.
*/
addListener(event: 'socketerror', listener: (string: String) => void): this;
addListener(event: 'socketerror', listener: (string: string) => void): this;
/**
* Removes an event listener added by `on` or `addListener`.
@ -18811,7 +18811,7 @@ export interface WebSocket {
/**
* Removes an event listener added by `on` or `addListener`.
*/
removeListener(event: 'socketerror', listener: (string: String) => void): this;
removeListener(event: 'socketerror', listener: (string: string) => void): this;
/**
* Removes an event listener added by `on` or `addListener`.
@ -18841,7 +18841,7 @@ export interface WebSocket {
/**
* Removes an event listener added by `on` or `addListener`.
*/
off(event: 'socketerror', listener: (string: String) => void): this;
off(event: 'socketerror', listener: (string: string) => void): this;
/**
* Fired when the websocket closes.
@ -18871,7 +18871,7 @@ export interface WebSocket {
/**
* Fired when the websocket has an error.
*/
prependListener(event: 'socketerror', listener: (string: String) => void): this;
prependListener(event: 'socketerror', listener: (string: string) => void): this;
/**
* Indicates that the web socket has been closed.
@ -18931,7 +18931,7 @@ export interface WebSocket {
/**
* Fired when the websocket has an error.
*/
waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: String) => boolean | Promise<boolean>, timeout?: number } | ((string: String) => boolean | Promise<boolean>)): Promise<String>;
waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise<boolean>, timeout?: number } | ((string: string) => boolean | Promise<boolean>)): Promise<string>;
}