We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
used in typescript:
import WebSocketAsPromised from 'websocket-as-promised'; const wsp = new WebSocketAsPromised(this.options.address, { createWebSocket: url => new WebSocket(url), extractMessageData: event => event, // <- this is important packMessage: data => JSON.stringify(data), unpackMessage: data => { if (Helper.isJSONStr(<string>data)) { return JSON.parse(<string>data); } else { return data; } }, attachRequestId: (data, requestId) => Object.assign({ id: requestId }, data), // attach requestId to message as `id` field extractRequestId: data => data && data.id, }); return wsp.open().then(() => { this.service = wsp; return wsp; });
run build tsc throw errors:
node_modules/websocket-as-promised/types/index.d.ts:9:9 - error TS2304: Cannot find name 'WebSocket'. 9 ws: WebSocket; ~~~~~~~~~ node_modules/websocket-as-promised/types/index.d.ts:21:25 - error TS2304: Cannot find name 'Event'. 21 open: () => Promise<Event>; ~~~~~ node_modules/websocket-as-promised/types/index.d.ts:26:26 - error TS2304: Cannot find name 'CloseEvent'. 26 close: () => Promise<CloseEvent>; ~~~~~~~~~~ node_modules/websocket-as-promised/types/options.d.ts:5:40 - error TS2304: Cannot find name 'WebSocket'. 5 createWebSocket?: (url: string) => WebSocket; ~~~~~~~~~
The text was updated successfully, but these errors were encountered:
No branches or pull requests
used in typescript:
run build tsc
throw errors:
The text was updated successfully, but these errors were encountered: