mirror of
https://github.com/esiur/esiur-js.git
synced 2025-06-27 15:23:11 +00:00
Generator
This commit is contained in:
@ -10,6 +10,8 @@ import DC from "../../src/Data/DC.js";
|
||||
import IResource from "../../src/Resource/IResource.js";
|
||||
import TransmissionType, { TransmissionTypeIdentifier } from "../../src/Data/TransmissionType.js";
|
||||
import TypedMap from "../../src/Data/TypedMap.js";
|
||||
import { Arg, Evt, Func, Prop, TemplateDescriber } from "../../src/Resource/Template/TemplateDescriber.js";
|
||||
import { Int32 } from "../../src/Data/ExtendedTypes.js";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
@ -36,7 +38,7 @@ var server;
|
||||
class MyChat extends IResource {
|
||||
|
||||
// void (string, string)->void
|
||||
static get template() {
|
||||
static get templateOld() {
|
||||
return {
|
||||
namespace: "Chat",
|
||||
properties: [["title", String], ["messages", Array], ["users", Array]],
|
||||
@ -45,6 +47,14 @@ class MyChat extends IResource {
|
||||
};
|
||||
}
|
||||
|
||||
static get template() {
|
||||
return new TemplateDescriber("Chat",[
|
||||
new Prop("title", String), new Prop("messages", Array), new Prop("users", Array),
|
||||
new Func("send", null, [new Arg("msg", String, true)]),
|
||||
new Evt("message", Map), new Evt("voice", Int32, true), new Evt("login"), new Evt("logout")]
|
||||
);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.messages = [new TypedMap({usr: "Admin", msg: "Welcome to Esiur", date: new Date()})];
|
||||
|
Reference in New Issue
Block a user