Skip to content

Commit

Permalink
Add websocket library support
Browse files Browse the repository at this point in the history
  • Loading branch information
tajakobsen committed Sep 11, 2020
1 parent 52e7d9e commit 7d0e743
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "enonic-types",
"sideEffects": false,
"version": "0.1.0",
"version": "0.1.1",
"description": "TypeScript types for Enonic XP",
"typings": "index.d.ts",
"scripts": {
Expand Down
21 changes: 21 additions & 0 deletions src/websocket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export interface WebsocketLibrary {
/**
* Add an id to a socket group.
*/
addToGroup(group: string, id: string): void;

/**
* Remove an id from a socket group.
*/
removeFromGroup(group: string, id: string): void;

/**
* Send message directly to a socket id.
*/
send(id: string, message: string): void;

/**
* Send message to all sockets in group.
*/
sendToGroup(group: string, message: string): void;
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"lib": ["es6"]
"lib": ["es6"],
"removeComments": false
},
"include": ["./src/**/*"],
"exclude": [
Expand Down

0 comments on commit 7d0e743

Please sign in to comment.