##// END OF EJS Templates
Добавлена метка v1.0.0-rc1 для набора изменений 1e22cac2aaf4
Добавлена метка v1.0.0-rc1 для набора изменений 1e22cac2aaf4

File last commit:

r2:1e22cac2aaf4 v1.0.0-rc1 default
r3:0b28c6ab359f default
Show More
_WidgetTests.ts
41 lines | 863 B | video/mp2t | TypeScriptLexer
import * as _WidgetBase from "dijit/_WidgetBase";
import { watch } from "./traits";
interface ScheduleWidgetAttrs {
data: string[];
}
interface ScheduleWidgetEvents {
"scheduled": Event & {
detail: {
startDate: Date,
endDate: Date
}
};
}
declare class ScheduleWidget extends _WidgetBase<ScheduleWidgetAttrs, ScheduleWidgetEvents> {
data: string[];
}
const w = new ScheduleWidget({title: "Year schedule", data: ["a", "b"] });
w.get("data");
w.watch((p, o, n) => [p,o,n]);
w.watch("data", (p, o, n) => [p,o,n]);
watch(w, "title", v => String(v) );
watch(w, "data", v => String(v) );
w.emit("scheduled", { detail: { startDate: new Date(), endDate: new Date()} });
w.emit("click", {} );
w.emit("click", {} );
w.emit("some-extra-event", {});
w.on("click", e => e);
w.on("some-extra-event", e => e);