smartsocket/ts/smartsocket.helpers.ts
2016-08-12 03:22:36 +02:00

24 lines
851 B
TypeScript

import * as plugins from "./smartsocket.plugins";
// classes
import { Smartsocket } from "./smartsocket.classes.smartsocket";
import { SocketFunction, allSocketFunctions } from "./smartsocket.classes.socketfunction";
import { SocketConnection } from "./smartsocket.classes.socketconnection";
import { SocketRole, allSocketRoles } from "./smartsocket.classes.socketrole";
// SocketFunction helpers
export let getSocketFunctionByName = (functionNameArg:string) => {
return allSocketFunctions.find((socketFunctionArg) => { return socketFunctionArg.name === functionNameArg});
}
// SocketRole helpers
/**
* get corresponding SocketRequest instance by name
*/
export let getSocketRoleByName = (socketRoleNameArg: string): SocketRole => {
return allSocketRoles.find((socketRoleArg) => { return socketRoleArg.name === socketRoleNameArg })
};