framework222
Advanced tools
Comparing version 1.0.33 to 1.0.34
declare module "framework.client" { | ||
export module FW { | ||
class FrameworkClient { | ||
private static _instance; | ||
components: any; | ||
socket: any; | ||
constructor(); | ||
static getInstance(): FrameworkClient; | ||
} | ||
export class FrameworkClient { | ||
private static _instance; | ||
components: any; | ||
socket: any; | ||
constructor(); | ||
static getInstance(): FrameworkClient; | ||
} | ||
var g: FW.FrameworkClient; | ||
export default g; | ||
} | ||
declare module "component.client" { | ||
import * as React from 'react'; | ||
export module FW { | ||
class ComponentClient<P, S> extends React.Component<P, S> { | ||
constructor(props: any); | ||
emit(message: string, data: any, component?: string): void; | ||
} | ||
export class ComponentClient<P, S> extends React.Component<P, S> { | ||
constructor(props: any); | ||
emit(message: string, data: any, component?: string): void; | ||
} | ||
} |
@@ -14,39 +14,35 @@ var __extends = (this && this.__extends) || (function () { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var FW; | ||
(function (FW) { | ||
var FrameworkClient = (function () { | ||
function FrameworkClient() { | ||
if (FrameworkClient._instance) { | ||
throw new Error("The Global is a singleton class and cannot be created!"); | ||
} | ||
FrameworkClient._instance = this; | ||
this.components = {}; | ||
this.socket = io.connect(); | ||
var onevent = this.socket.onevent; | ||
this.socket.onevent = function (packet) { | ||
var args = packet.data || []; | ||
onevent.call(this, packet); | ||
packet.data = ["*"].concat(args); | ||
onevent.call(this, packet); | ||
}; | ||
this.socket.on("*", function (message, data) { | ||
var splittedMessage = message.split(':'); | ||
var component = splittedMessage[0]; | ||
var method = splittedMessage[1]; | ||
var componentInstance = this.components[component]; | ||
if (componentInstance != null) { | ||
componentInstance[method](data); | ||
} | ||
}.bind(this)); | ||
var FrameworkClient = (function () { | ||
function FrameworkClient() { | ||
if (FrameworkClient._instance) { | ||
throw new Error("The Global is a singleton class and cannot be created!"); | ||
} | ||
FrameworkClient.getInstance = function () { | ||
return FrameworkClient._instance; | ||
FrameworkClient._instance = this; | ||
this.components = {}; | ||
this.socket = io.connect(); | ||
var onevent = this.socket.onevent; | ||
this.socket.onevent = function (packet) { | ||
var args = packet.data || []; | ||
onevent.call(this, packet); | ||
packet.data = ["*"].concat(args); | ||
onevent.call(this, packet); | ||
}; | ||
FrameworkClient._instance = new FrameworkClient(); | ||
return FrameworkClient; | ||
}()); | ||
FW.FrameworkClient = FrameworkClient; | ||
})(FW = exports.FW || (exports.FW = {})); | ||
var g = FW.FrameworkClient.getInstance(); | ||
exports.default = g; | ||
this.socket.on("*", function (message, data) { | ||
var splittedMessage = message.split(':'); | ||
var component = splittedMessage[0]; | ||
var method = splittedMessage[1]; | ||
var componentInstance = this.components[component]; | ||
if (componentInstance != null) { | ||
componentInstance[method](data); | ||
} | ||
}.bind(this)); | ||
} | ||
FrameworkClient.getInstance = function () { | ||
return FrameworkClient._instance; | ||
}; | ||
FrameworkClient._instance = new FrameworkClient(); | ||
return FrameworkClient; | ||
}()); | ||
exports.FrameworkClient = FrameworkClient; | ||
var g = FrameworkClient.getInstance(); | ||
}); | ||
@@ -56,16 +52,13 @@ define("component.client", ["require", "exports", "framework.client", "react"], function (require, exports, framework_client_1, React) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var FW; | ||
(function (FW) { | ||
var ComponentClient = (function (_super) { | ||
__extends(ComponentClient, _super); | ||
function ComponentClient(props) { | ||
return _super.call(this, props) || this; | ||
} | ||
ComponentClient.prototype.emit = function (message, data, component) { | ||
framework_client_1.default.socket.emit(message, data); | ||
}; | ||
return ComponentClient; | ||
}(React.Component)); | ||
FW.ComponentClient = ComponentClient; | ||
})(FW = exports.FW || (exports.FW = {})); | ||
var ComponentClient = (function (_super) { | ||
__extends(ComponentClient, _super); | ||
function ComponentClient(props) { | ||
return _super.call(this, props) || this; | ||
} | ||
ComponentClient.prototype.emit = function (message, data, component) { | ||
framework_client_1.default.socket.emit(message, data); | ||
}; | ||
return ComponentClient; | ||
}(React.Component)); | ||
exports.ComponentClient = ComponentClient; | ||
}); |
export * from './server/framework.server'; | ||
export * from './server/component.server'; | ||
import * as a from './client/framework'; | ||
export * from a.client | ||
/// reference path='./client/framework'; | ||
import * as m from "framework.client"; | ||
import * as m2 from "component.client"; |
{ | ||
"name": "framework222", | ||
"version": "1.0.33", | ||
"version": "1.0.34", | ||
"description": "framework", | ||
@@ -5,0 +5,0 @@ "main": "dist/server/framework.server.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73309
518