Skip to content

Commit a098990

Browse files
📝 Add docstrings to test-whole
Docstrings generation was requested by @snipsnipsnip. * #49 (comment) The following files were modified: * `src/thunderbird/util/promisified_message_port.ts`
1 parent 12b0c81 commit a098990

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/thunderbird/util/promisified_message_port.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import type { IMessagePort } from "src/ghosttext-runner"
22
import { PromisifyingQueue } from "src/util/promisifying_queue"
33

44
/**
5-
* Create a pair of PromisifiedMessagePort from a MessageChannel.
6-
* @template TRequest The type of messages which port1 can sends, and port2 expects to receive
7-
* @template TResponse The type of messages which port1 expects to receive, and port2 can send
5+
* Creates a pair of promisified message ports from a MessageChannel.
6+
*
7+
* @template TRequest The type of messages the first returned port can send and the second expects to receive
8+
* @template TResponse The type of messages the first returned port expects to receive and the second can send
9+
* @returns A tuple `[IMessagePort<TRequest, TResponse>, IMessagePort<TResponse, TRequest>]` where the first element is a promisified port for sending `TRequest` and receiving `TResponse`, and the second element is a promisified port for sending `TResponse` and receiving `TRequest`
810
*/
911
export function promisifyMessageChannel<TRequest extends object | string, TResponse extends object | string>({
1012
port1,
@@ -77,4 +79,4 @@ export class PromisifiedMessagePort<TRequest extends object | string, TResponse
7779
this.port.close()
7880
this.q.notifyClosed(Error("MessagePort already closed"))
7981
}
80-
}
82+
}

0 commit comments

Comments
 (0)