minor fixes
This commit is contained in:
parent
ac2b4c4a67
commit
11b1702726
4 changed files with 8 additions and 59 deletions
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"extends": ["airbnb-base", "prettier"],
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"allowImportExportEverywhere": true
|
||||
},
|
||||
"plugins": [
|
||||
"prettier",
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"class-methods-use-this": [
|
||||
"error",
|
||||
{"exceptMethods": ["requestDidStart", "willSendRequest", "willSendResponse", "errorFromResponse"]}
|
||||
],
|
||||
"camelcase": 0,
|
||||
"no-undef": 0,
|
||||
"no-new": 0,
|
||||
"no-shadow": 0,
|
||||
"@typescript-eslint/no-shadow": ["error", { "allow": ["err"] }],
|
||||
"no-console": "off",
|
||||
"no-use-before-define": "warn",
|
||||
"no-constant-condition": "off",
|
||||
"import/no-unresolved": "off",
|
||||
"import/prefer-default-export": "warn",
|
||||
"import/extensions": "off",
|
||||
"class-methods-use-this": "off",
|
||||
"@typescript-eslint/array-type": [2, { "default": "array" }],
|
||||
"@typescript-eslint/consistent-type-definitions": [2, "interface"],
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-for-in-array": "error",
|
||||
"@typescript-eslint/no-inferrable-types": "error",
|
||||
"@typescript-eslint/no-use-before-define": "warn",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"no-underscore-dangle": "off",
|
||||
"prefer-destructuring": "off"
|
||||
},
|
||||
"settings": {
|
||||
"import/extensions": [".js", ".ts"],
|
||||
"import/parsers": {
|
||||
"@typescript-eslint/parser": [".ts", ".tsx"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ts-osc",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "Fully TypeScript-native OSC Client based on osc-min",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export class OSCClient {
|
|||
this.socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
|
||||
}
|
||||
|
||||
private sendPacket(packet: Buffer): void {
|
||||
public sendPacket(packet: Buffer): void {
|
||||
this.socket.send(packet, 0, packet.length, this.port, this.host);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export declare interface OSCServer {
|
|||
Emitted whenever an OSC message is received on inPort
|
||||
@event
|
||||
*/
|
||||
on(event: 'message', listener: (message: ReceivedOSCMessage<OSCType>) => void): this;
|
||||
on(event: 'message', listener: <T extends OSCType>(message: ReceivedOSCMessage<T>) => void): this;
|
||||
|
||||
/**
|
||||
Emitted when OSC client is listening on inPort
|
||||
|
|
@ -52,7 +52,11 @@ export class OSCServer extends EventEmitter {
|
|||
super();
|
||||
|
||||
this.socket = dgram.createSocket({ type: 'udp4', reuseAddr: true });
|
||||
this.socket.bind(port, bindAddress);
|
||||
this.socket.bind({
|
||||
port,
|
||||
address: bindAddress,
|
||||
exclusive: true,
|
||||
});
|
||||
|
||||
this.socket.on('listening', () => {
|
||||
this.emit('listening');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue