@@ -32,12 +32,12 typescript { | |||
|
32 | 32 | |
|
33 | 33 | configureTsMain { |
|
34 | 34 | compilerOptions { |
|
35 | baseUrl = "$projectDir/src" | |
|
35 | /*baseUrl = "$projectDir/src" | |
|
36 | 36 | paths = [ |
|
37 | 37 | "dojo/*" : [ "typings/dojo/*" ], |
|
38 | 38 | "dijit/*" : [ "typings/dijit/*" ] |
|
39 |
|
|
|
40 |
types = ["requirejs", |
|
|
39 | ]*/ | |
|
40 | types = ["requirejs", "dojo-typings"] | |
|
41 | 41 | } |
|
42 | 42 | } |
|
43 | 43 |
@@ -3,7 +3,7 import { isPlainObject, isNode, isBuildC | |||
|
3 | 3 | |
|
4 | 4 | import dom = require("dojo/dom-construct"); |
|
5 | 5 | |
|
6 | export abstract class BuildContextBase implements BuildContext { | |
|
6 | export abstract class BuildContextBase<TNode extends Node> implements BuildContext<TNode> { | |
|
7 | 7 | _attrs = {}; |
|
8 | 8 | |
|
9 | 9 | _children = new Array(); |
@@ -43,7 +43,7 export abstract class BuildContextBase i | |||
|
43 | 43 | } |
|
44 | 44 | } |
|
45 | 45 | |
|
46 | abstract _getDomNode(): Node; | |
|
46 | abstract _getDomNode(): TNode; | |
|
47 | 47 | |
|
48 | 48 | ensureCreated() { |
|
49 | 49 | if (!this._created) { |
@@ -3,7 +3,6 import _WidgetBase = require("dijit/_Wid | |||
|
3 | 3 | import _AttachMixin = require("dijit/_AttachMixin"); |
|
4 | 4 | import { BuildContext, isNode } from "./traits"; |
|
5 | 5 | import registry = require("dijit/registry"); |
|
6 | import { Handle } from "dojo/interfaces"; | |
|
7 | 6 | |
|
8 | 7 | // type Handle = dojo.Handle; |
|
9 | 8 | |
@@ -15,13 +14,13 export abstract class DjxWidgetBase exte | |||
|
15 | 14 | super.buildRendering(); |
|
16 | 15 | } |
|
17 | 16 | |
|
18 | abstract render(): BuildContext; | |
|
17 | abstract render(): BuildContext<HTMLElement>; | |
|
19 | 18 | |
|
20 | 19 | _processTemplateNode<T extends (Element | Node | _WidgetBase)>( |
|
21 | 20 | baseNode: T, |
|
22 | 21 | getAttrFunc: (baseNode: T, attr: string) => string, |
|
23 | 22 | // tslint:disable-next-line: ban-types |
|
24 | attachFunc: (node: T, type: string, func?: Function) => Handle | |
|
23 | attachFunc: (node: T, type: string, func?: Function) => dojo.Handle | |
|
25 | 24 | ): boolean { |
|
26 | 25 | if (isNode(baseNode)) { |
|
27 | 26 | const w = registry.byNode(baseNode); |
@@ -3,7 +3,7 import attr = require("dojo/dom-attr"); | |||
|
3 | 3 | import { argumentNotEmptyString } from "@implab/core-amd/safe"; |
|
4 | 4 | import { BuildContextBase } from "./BuildContextBase"; |
|
5 | 5 | |
|
6 | export class HtmlElementContext extends BuildContextBase { | |
|
6 | export class HtmlElementContext extends BuildContextBase<HTMLElement> { | |
|
7 | 7 | elementType: string; |
|
8 | 8 | |
|
9 | 9 | _element: HTMLElement | undefined; |
@@ -17,7 +17,7 export interface _Widget { | |||
|
17 | 17 | |
|
18 | 18 | export type _WidgetCtor = new (attrs: any, srcNode?: string | Node) => _Widget; |
|
19 | 19 | |
|
20 | export class WidgetContext extends BuildContextBase { | |
|
20 | export class WidgetContext extends BuildContextBase<Node> { | |
|
21 | 21 | widgetClass: _WidgetCtor; |
|
22 | 22 | |
|
23 | 23 | _instance: _Widget | undefined; |
@@ -4,8 +4,8 type _WidgetBaseConstructor = typeof _Wi | |||
|
4 | 4 | |
|
5 | 5 | export type DojoNodePosition = "first" | "after" | "before" | "last" | "replace" | "only" | number; |
|
6 | 6 | |
|
7 | export interface BuildContext { | |
|
8 | getDomNode(): Node; | |
|
7 | export interface BuildContext<TNode extends Node = Node> { | |
|
8 | getDomNode(): TNode; | |
|
9 | 9 | |
|
10 | 10 | placeAt(refNode: string | Node, position?: DojoNodePosition): void; |
|
11 | 11 | } |
@@ -1,18 +1,13 | |||
|
1 | 1 | { |
|
2 | 2 | "extends": "../tsconfig", |
|
3 | 3 | "compilerOptions": { |
|
4 | "baseUrl": "../", | |
|
5 | 4 | "rootDir": "ts", |
|
6 | 5 | "rootDirs": [ |
|
7 | 6 | "ts", |
|
8 | 7 | "typings" |
|
9 | 8 | ], |
|
10 | "paths" : { | |
|
11 | "dojo/*" : [ "typings/dojo/*" ], | |
|
12 | "dijit/*" : [ "typings/dijit/*" ] | |
|
13 | }, | |
|
14 | 9 | "types": [ |
|
15 |
"requirejs", "./typings/index", " |
|
|
10 | "requirejs", "./typings/index", "dojo-typings" | |
|
16 | 11 | ] |
|
17 | 12 | } |
|
18 | 13 | } No newline at end of file |
@@ -1,7 +1,6 | |||
|
1 | 1 | import { Handle } from "dojo/interfaces"; |
|
2 | 2 | import _WidgetBase = require("./_WidgetBase"); |
|
3 |
import d |
|
|
4 | import dojo = require("dojo/_base/html"); | |
|
3 | import dojo = require("dojo/_base/kernel"); | |
|
5 | 4 | |
|
6 | 5 | declare module "./_WidgetBase" { |
|
7 | 6 | interface _WidgetBase { |
@@ -2,6 +2,7 import Stateful = require("dojo/Stateful | |||
|
2 | 2 | import Destroyable = require("./Destroyable"); |
|
3 | 3 | import { ExtensionEvent } from "dojo/on"; |
|
4 | 4 | import { NodeFragmentOrString, Handle, NodeOrString, WatchHandle } from "dojo/interfaces"; |
|
5 | import dojo = require("dojo/_base/kernel"); | |
|
5 | 6 | |
|
6 | 7 | declare namespace _WidgetBase { |
|
7 | 8 | interface _WidgetBase extends Stateful, Destroyable { |
@@ -229,7 +230,7 declare namespace _WidgetBase { | |||
|
229 | 230 | defer(fcn: Function, delay?: number): Handle; |
|
230 | 231 | } |
|
231 | 232 | |
|
232 | interface _WidgetBaseConstructor<W = _WidgetBase> extends DeclareConstructor<W> { | |
|
233 | interface _WidgetBaseConstructor<W = _WidgetBase> extends dojo._base.DeclareConstructor<W> { | |
|
233 | 234 | new(params: Object, srcNodeRef?: NodeOrString): W; |
|
234 | 235 | } |
|
235 | 236 |
General Comments 0
You need to be logged in to leave comments.
Login now