mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
Remove doc strings from cli/js TS files (#4329)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
This commit is contained in:
parent
3ac642c183
commit
e435c2be15
87 changed files with 0 additions and 2025 deletions
|
@ -19,36 +19,23 @@ export interface UDPAddr {
|
|||
port: number;
|
||||
}
|
||||
|
||||
/** A socket is a generic transport listener for message-oriented protocols */
|
||||
export interface UDPConn extends AsyncIterable<[Uint8Array, Addr]> {
|
||||
/** Waits for and resolves to the next message to the `Socket`. */
|
||||
receive(p?: Uint8Array): Promise<[Uint8Array, Addr]>;
|
||||
|
||||
/** Sends a message to the target. */
|
||||
send(p: Uint8Array, addr: UDPAddr): Promise<void>;
|
||||
|
||||
/** Close closes the socket. Any pending message promises will be rejected
|
||||
* with errors.
|
||||
*/
|
||||
close(): void;
|
||||
|
||||
/** Return the address of the `Socket`. */
|
||||
addr: Addr;
|
||||
|
||||
[Symbol.asyncIterator](): AsyncIterator<[Uint8Array, Addr]>;
|
||||
}
|
||||
|
||||
/** A Listener is a generic transport listener for stream-oriented protocols. */
|
||||
export interface Listener extends AsyncIterable<Conn> {
|
||||
/** Waits for and resolves to the next connection to the `Listener`. */
|
||||
accept(): Promise<Conn>;
|
||||
|
||||
/** Close closes the listener. Any pending accept promises will be rejected
|
||||
* with errors.
|
||||
*/
|
||||
close(): void;
|
||||
|
||||
/** Return the address of the `Listener`. */
|
||||
addr: Addr;
|
||||
|
||||
[Symbol.asyncIterator](): AsyncIterator<Conn>;
|
||||
|
@ -73,16 +60,10 @@ export class ConnImpl implements Conn {
|
|||
close(this.rid);
|
||||
}
|
||||
|
||||
/** closeRead shuts down (shutdown(2)) the reading side of the TCP connection.
|
||||
* Most callers should just use close().
|
||||
*/
|
||||
closeRead(): void {
|
||||
netOps.shutdown(this.rid, netOps.ShutdownMode.Read);
|
||||
}
|
||||
|
||||
/** closeWrite shuts down (shutdown(2)) the writing side of the TCP
|
||||
* connection. Most callers should just use close().
|
||||
*/
|
||||
closeWrite(): void {
|
||||
netOps.shutdown(this.rid, netOps.ShutdownMode.Write);
|
||||
}
|
||||
|
@ -162,19 +143,10 @@ export class UDPConnImpl implements UDPConn {
|
|||
}
|
||||
|
||||
export interface Conn extends Reader, Writer, Closer {
|
||||
/** The local address of the connection. */
|
||||
localAddr: Addr;
|
||||
/** The remote address of the connection. */
|
||||
remoteAddr: Addr;
|
||||
/** The resource ID of the connection. */
|
||||
rid: number;
|
||||
/** Shuts down (`shutdown(2)`) the reading side of the TCP connection. Most
|
||||
* callers should just use `close()`.
|
||||
*/
|
||||
closeRead(): void;
|
||||
/** Shuts down (`shutdown(2)`) the writing side of the TCP connection. Most
|
||||
* callers should just use `close()`.
|
||||
*/
|
||||
closeWrite(): void;
|
||||
}
|
||||
|
||||
|
@ -184,23 +156,6 @@ export interface ListenOptions {
|
|||
transport?: Transport;
|
||||
}
|
||||
|
||||
/** Listen announces on the local transport address.
|
||||
*
|
||||
* @param options
|
||||
* @param options.port The port to connect to. (Required.)
|
||||
* @param options.hostname A literal IP address or host name that can be
|
||||
* resolved to an IP address. If not specified, defaults to 0.0.0.0
|
||||
* @param options.transport Must be "tcp" or "udp". Defaults to "tcp". Later we plan to add "tcp4",
|
||||
* "tcp6", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and
|
||||
* "unixpacket".
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* listen({ port: 80 })
|
||||
* listen({ hostname: "192.0.2.1", port: 80 })
|
||||
* listen({ hostname: "[2001:db8::1]", port: 80 });
|
||||
* listen({ hostname: "golang.org", port: 80, transport: "tcp" })
|
||||
*/
|
||||
export function listen(
|
||||
options: ListenOptions & { transport?: "tcp" }
|
||||
): Listener;
|
||||
|
@ -225,23 +180,6 @@ export interface ConnectOptions {
|
|||
transport?: Transport;
|
||||
}
|
||||
|
||||
/** Connects to the address on the named transport.
|
||||
*
|
||||
* @param options
|
||||
* @param options.port The port to connect to. (Required.)
|
||||
* @param options.hostname A literal IP address or host name that can be
|
||||
* resolved to an IP address. If not specified, defaults to 127.0.0.1
|
||||
* @param options.transport Must be "tcp" or "udp". Defaults to "tcp". Later we plan to add "tcp4",
|
||||
* "tcp6", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and
|
||||
* "unixpacket".
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* connect({ port: 80 })
|
||||
* connect({ hostname: "192.0.2.1", port: 80 })
|
||||
* connect({ hostname: "[2001:db8::1]", port: 80 });
|
||||
* connect({ hostname: "golang.org", port: 80, transport: "tcp" })
|
||||
*/
|
||||
export async function connect({
|
||||
port,
|
||||
hostname = "127.0.0.1",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue