1+ import { allowMethods } from "./util"
2+
13export {
24 capability ,
35 context ,
@@ -14,7 +16,6 @@ export {
1416
1517import {
1618 capability ,
17- methods ,
1819 Context ,
1920 EventOfType ,
2021 EventType ,
@@ -29,8 +30,6 @@ import {
2930import * as draft from "./draft"
3031import { FullError } from "./errors"
3132
32- const { send, receive} = methods
33-
3433/**
3534 * A type representing the messages that are returned inside promises by
3635 * {@link Readable.receive}().
@@ -976,7 +975,7 @@ export class Pair extends Socket {
976975}
977976
978977export interface Pair extends Writable , Readable { }
979- Object . assign ( Pair . prototype , { send, receive} )
978+ allowMethods ( Pair . prototype , [ " send" , " receive" ] )
980979
981980/**
982981 * A {@link Publisher} socket is used to distribute data to {@link Subscriber}s.
@@ -1028,7 +1027,7 @@ export class Publisher extends Socket {
10281027
10291028// eslint-disable-next-line @typescript-eslint/no-empty-interface
10301029export interface Publisher extends Writable { }
1031- Object . assign ( Publisher . prototype , { send} )
1030+ allowMethods ( Publisher . prototype , [ " send" ] )
10321031
10331032/**
10341033 * A {@link Subscriber} socket is used to subscribe to data distributed by a
@@ -1128,7 +1127,7 @@ export class Subscriber extends Socket {
11281127
11291128// eslint-disable-next-line @typescript-eslint/no-empty-interface
11301129export interface Subscriber extends Readable { }
1131- Object . assign ( Subscriber . prototype , { receive} )
1130+ allowMethods ( Subscriber . prototype , [ " receive" ] )
11321131
11331132/**
11341133 * A {@link Request} socket acts as a client to send requests to and receive
@@ -1198,7 +1197,7 @@ export class Request extends Socket {
11981197}
11991198
12001199export interface Request extends Readable , Writable { }
1201- Object . assign ( Request . prototype , { send, receive} )
1200+ allowMethods ( Request . prototype , [ " send" , " receive" ] )
12021201
12031202/**
12041203 * A {@link Reply} socket can act as a server which receives requests from and
@@ -1223,7 +1222,7 @@ export class Reply extends Socket {
12231222}
12241223
12251224export interface Reply extends Readable , Writable { }
1226- Object . assign ( Reply . prototype , { send, receive} )
1225+ allowMethods ( Reply . prototype , [ " send" , " receive" ] )
12271226
12281227/**
12291228 * A {@link Dealer} socket can be used to extend request/reply sockets. Each
@@ -1280,7 +1279,7 @@ export class Dealer extends Socket {
12801279}
12811280
12821281export interface Dealer extends Readable , Writable { }
1283- Object . assign ( Dealer . prototype , { send, receive} )
1282+ allowMethods ( Dealer . prototype , [ " send" , " receive" ] )
12841283
12851284/**
12861285 * A {@link Router} can be used to extend request/reply sockets. When receiving
@@ -1380,7 +1379,7 @@ interface RouterConnectOptions {
13801379}
13811380
13821381export interface Router extends Readable , Writable { }
1383- Object . assign ( Router . prototype , { send, receive} )
1382+ allowMethods ( Router . prototype , [ " send" , " receive" ] )
13841383
13851384/**
13861385 * A {@link Pull} socket is used by a pipeline node to receive messages from
@@ -1405,7 +1404,7 @@ export interface Pull extends Readable {
14051404 conflate : boolean
14061405}
14071406
1408- Object . assign ( Pull . prototype , { receive} )
1407+ allowMethods ( Pull . prototype , [ " receive" ] )
14091408
14101409/**
14111410 * A {@link Push} socket is used by a pipeline node to send messages to
@@ -1436,7 +1435,7 @@ export interface Push extends Writable {
14361435 conflate : boolean
14371436}
14381437
1439- Object . assign ( Push . prototype , { send} )
1438+ allowMethods ( Push . prototype , [ " send" ] )
14401439
14411440/**
14421441 * Same as {@link Publisher}, except that you can receive subscriptions from the
@@ -1516,7 +1515,7 @@ export class XPublisher extends Socket {
15161515}
15171516
15181517export interface XPublisher extends Readable , Writable { }
1519- Object . assign ( XPublisher . prototype , { send, receive} )
1518+ allowMethods ( XPublisher . prototype , [ " send" , " receive" ] )
15201519
15211520/**
15221521 * Same as {@link Subscriber}, except that you subscribe by sending subscription
@@ -1532,7 +1531,7 @@ export class XSubscriber extends Socket {
15321531}
15331532
15341533export interface XSubscriber extends Readable , Writable { }
1535- Object . assign ( XSubscriber . prototype , { send, receive} )
1534+ allowMethods ( XSubscriber . prototype , [ " send" , " receive" ] )
15361535
15371536/**
15381537 * A {@link Stream} is used to send and receive TCP data from a non-ØMQ peer
@@ -1590,7 +1589,7 @@ interface StreamConnectOptions {
15901589export interface Stream
15911590 extends Readable < [ Message , Message ] > ,
15921591 Writable < [ MessageLike , MessageLike ] > { }
1593- Object . assign ( Stream . prototype , { send, receive} )
1592+ allowMethods ( Stream . prototype , [ " send" , " receive" ] )
15941593
15951594/* Meta functionality to define new socket/context options. */
15961595const enum Type {
0 commit comments