This commit is contained in:
2019-09-21 02:58:42 +02:00
11 changed files with 54 additions and 39 deletions
+1 -9
View File
@@ -6,16 +6,8 @@ import bsock = require('bsock');
import * as T from './Types';
import * as U from './Utils';
import * as I from './Interfaces';
import * as R from './Responses';
export {
T as Types,
U as Utils,
I as Interfaces,
R as Responses
}
export class Server{
export class RPCServer{
private ws = http.createServer()
private io = bsock.createServer()
private visibility:T.Visibility
+2 -11
View File
@@ -3,27 +3,18 @@
import bsock = require('bsock');
import * as T from './Types';
import * as U from './Utils';
import * as I from './Interfaces';
import * as R from './Responses';
export {
T as Types,
U as Utils,
I as Interfaces,
R as Responses
}
//fix args with defaults like "force = true" -> "force"
function stripAfterEquals(str:string){
return str.split("=")[0]
}
export class Client implements I.Socket{
export class RPCSocket implements I.Socket{
private socket: I.Socket
constructor(public port:number, private server: string, private tls: boolean = false){
Object.defineProperty(this, 'socket', {value: undefined, writable: true})
}
public hook(name: T.Name, args: T.Arg){
-1
View File
@@ -1,7 +1,6 @@
export type Outcome = "Success" | "Error"
/* Responses */
export class Response{
constructor(
public message?:string
+10 -5
View File
@@ -1,9 +1,9 @@
const path = require('path');
const frontendConf = {
module.exports = {
mode: 'production',
target: "web",
entry: path.resolve(__dirname, '..', 'js', 'src', 'Frontend.js'),
entry: path.resolve(__dirname, 'Frontend.ts'),
output: {
path: path.resolve(__dirname, '..', 'js', 'rpclibrary.browser.js'),
filename: "Frontend.js",
@@ -12,9 +12,14 @@ const frontendConf = {
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{ test: /\.ts?$/, loader: "ts-loader" }
]
},
optimization: {
minimize: false,
},
}
module.exports = [frontendConf]
externals: {
}
}