##// END OF EJS Templates
Added placeAt() method to BuildContext
Added placeAt() method to BuildContext

File last commit:

r14:9e546fe36fdd v1.0.0-rc7 default
r14:9e546fe36fdd v1.0.0-rc7 default
Show More
traits.ts
35 lines | 1013 B | video/mp2t | TypeScriptLexer
import _WidgetBase = require("dijit/_WidgetBase");
type _WidgetBaseConstructor = typeof _WidgetBase;
export type DojoNodePosition = "first" | "after" | "before" | "last" | "replace" | "only" | number;
export interface BuildContext {
getDomElement(): HTMLElement;
placeAt(refNode: string | Node, position?: DojoNodePosition): void;
}
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;
}