Interface: OpenedWindow<Out, In, R>
Type Parameters
| Type Parameter |
|---|
Out extends MessageMap |
In extends MessageMap |
R |
Properties
closed
readonly closed: Promise<void>;
Resolves when the child window is gone (with or without a result).
ready
readonly ready: Promise<void>;
Resolves once the child completes the ready handshake.
result
readonly result: Promise<R>;
The child's finish() value. Rejects WindowClosedError / HandshakeTimeoutError.
window
readonly window: WindowLike | null;
The opened window, or null if the popup was blocked.
Methods
close()
close(): void;
Close the child window.
Returns
void
on()
on<K>(type, handler): () => void;
Type Parameters
| Type Parameter |
|---|
K extends string |
Parameters
| Parameter | Type |
|---|---|
type | K |
handler | (payload) => void |
Returns
() => void
post()
post<K>(type, payload): void;
Queued until the handshake completes — nothing is dropped while the child loads.
Type Parameters
| Type Parameter |
|---|
K extends string |
Parameters
| Parameter | Type |
|---|---|
type | K |
payload | Out[K] |
Returns
void