node-osc 11.2.3 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +19 -0
- package/.node-version +1 -0
- package/{agent.md → AGENTS.md} +11 -8
- package/README.md +4 -2
- package/dist/lib/Client.js +4 -41
- package/dist/lib/Server.js +65 -0
- package/dist/lib/internal/send.js +48 -0
- package/dist/test/test-promises.js +16 -0
- package/dist/test/test-server.js +61 -0
- package/docs/API.md +5 -5
- package/docs/GUIDE.md +5 -1
- package/docs/README.md +1 -1
- package/lib/Client.mjs +4 -41
- package/lib/Server.mjs +65 -0
- package/lib/internal/send.mjs +46 -0
- package/package.json +5 -5
- package/scripts/generate-docs.mjs +173 -167
- package/test/fixtures/types/test-cjs-types.ts +1 -0
- package/test/fixtures/types/test-esm-types.ts +1 -0
- package/test/fixtures/types/tsconfig-cjs.test.json +3 -3
- package/test/fixtures/types/tsconfig-esm.test.json +3 -2
- package/test/test-promises.mjs +16 -0
- package/test/test-server.mjs +61 -0
- package/tsconfig.json +8 -3
- package/types/Client.d.mts +0 -1
- package/types/Client.d.mts.map +1 -1
- package/types/Server.d.mts +28 -0
- package/types/Server.d.mts.map +1 -1
- package/types/internal/send.d.mts +3 -0
- package/types/internal/send.d.mts.map +1 -0
package/types/Server.d.mts
CHANGED
|
@@ -73,7 +73,35 @@ declare class Server extends EventEmitter<any> {
|
|
|
73
73
|
constructor(port: number, host?: string, cb?: Function);
|
|
74
74
|
port: number;
|
|
75
75
|
host: string;
|
|
76
|
+
_isListening: boolean;
|
|
77
|
+
_isClosed: boolean;
|
|
76
78
|
_sock: import("node:dgram").Socket;
|
|
79
|
+
/**
|
|
80
|
+
* Send an OSC message or bundle from the server's bound socket.
|
|
81
|
+
*
|
|
82
|
+
* This method can be used with either a callback or as a Promise.
|
|
83
|
+
*
|
|
84
|
+
* @param {import('./Message.mjs').default|import('./Bundle.mjs').default|Array|string} message - The message, bundle, address, or array to send.
|
|
85
|
+
* @param {number} port - The remote port to send to.
|
|
86
|
+
* @param {string} host - The remote host to send to.
|
|
87
|
+
* @param {Function} [cb] - Optional callback function called when send completes.
|
|
88
|
+
* @returns {Promise<void>|undefined} Returns a Promise if no callback is provided.
|
|
89
|
+
*
|
|
90
|
+
* @throws {Error} If the server socket is not yet listening.
|
|
91
|
+
* @throws {TypeError} If the message format is invalid.
|
|
92
|
+
* @throws {ReferenceError} If attempting to send on a closed socket.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* // Send an address-only message
|
|
96
|
+
* await server.send('/ping', 9000, '127.0.0.1');
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // Send an array message
|
|
100
|
+
* server.send(['/ack', 1], 9000, '192.168.1.42', (err) => {
|
|
101
|
+
* if (err) console.error(err);
|
|
102
|
+
* });
|
|
103
|
+
*/
|
|
104
|
+
send(message: import("./Message.mjs").default | import("./Bundle.mjs").default | any[] | string, port: number, host: string, cb?: Function): Promise<void> | undefined;
|
|
77
105
|
/**
|
|
78
106
|
* Close the server socket.
|
|
79
107
|
*
|
package/types/Server.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Server.d.mts","sourceRoot":"","sources":["../lib/Server.mjs"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Server.d.mts","sourceRoot":"","sources":["../lib/Server.mjs"],"names":[],"mappings":";AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,kBApBW,MAAM,SACN,MAAM,iBAyEhB;IA9CC,aAAgB;IAChB,aAAgB;IAChB,sBAAyB;IACzB,mBAAsB;IACtB,mCAGE;IAwCJ;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cApBW,OAAO,eAAe,EAAE,OAAO,GAAC,OAAO,cAAc,EAAE,OAAO,WAAO,MAAM,QAC3E,MAAM,QACN,MAAM,kBAEJ,OAAO,CAAC,IAAI,CAAC,GAAC,SAAS,CAyCnC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,sBAZa,OAAO,CAAC,IAAI,CAAC,GAAC,SAAS,CAuBnC;CACF;6BAxN4B,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.mts","sourceRoot":"","sources":["../../lib/internal/send.mjs"],"names":[],"mappings":";AAcA,4GA6BC"}
|