##// END OF EJS Templates
switched back to dojo-typings module...
switched back to dojo-typings module added skipLibCheck compiler option due to typings sickness prepare for release

File last commit:

r4:fc9f82c082ef v1.0.0-rc2 default
r4:fc9f82c082ef v1.0.0-rc2 default
Show More
traits.ts
32 lines | 840 B | video/mp2t | TypeScriptLexer
import _WidgetBase = require("dijit/_WidgetBase");
type _WidgetBaseConstructor = typeof _WidgetBase;
export interface BuildContext {
getDomElement(): HTMLElement;
}
export function isNode(el: any): el is HTMLElement {
return el && el.nodeName && el.nodeType;
}
export function isWidget(v: any): v is _WidgetBase {
return v && "domNode" in v;
}
export function isBuildContext(v: any): v is BuildContext {
return typeof v === "object" && typeof v.getDomElement === "function";
}
export function isPlainObject(v: object) {
if (typeof v !== "object")
return false;
const vp = Object.getPrototypeOf(v);
return !vp || vp === Object.prototype;
}
export function isWidgetConstructor(v: any): v is _WidgetBaseConstructor {
return typeof v === "function" && v.prototype && "domNode" in v.prototype;
}