ElectronClientRequest.once method
ElectronClientRequest › once
Unofficial
Registers a one-time listener for the given request event.Signature:
once(event: "abort", listener: (...args: unknown[]) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "abort" | The event name. |
| listener | (...args: unknown[]) => void | The event handler. |
Returns: this — This ClientRequest instance.
Unofficial
Signature:
once(event: "close", listener: (...args: unknown[]) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "close" | |
| listener | (...args: unknown[]) => void |
Returns: this
Unofficial
Signature:
once(event: "error", listener: (error: Error) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "error" | |
| listener | (error: Error) => void |
Returns: this
Unofficial
Signature:
once(event: "finish", listener: (...args: unknown[]) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "finish" | |
| listener | (...args: unknown[]) => void |
Returns: this
Unofficial
Signature:
once(event: "login", listener: (authInfo: ElectronAuthInfo, callback: (username?: string | undefined, password?: string | undefined) => void) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "login" | |
| listener | (authInfo: ElectronAuthInfo, callback: (username?: string | undefined, password?: string | undefined) => void) => void |
Returns: this
Unofficial
Signature:
once(event: "redirect", listener: (statusCode: number, method: string, redirectUrl: string, responseHeaders: Record<string, string[]>) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "redirect" | |
| listener | (statusCode: number, method: string, redirectUrl: string, responseHeaders: Record<string, string[]>) => void |
Returns: this
Unofficial
Signature:
once(event: "response", listener: (response: ElectronIncomingMessage) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "response" | |
| listener | (response: ElectronIncomingMessage) => void |
Returns: this