diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -32,12 +32,12 @@ typescript { configureTsMain { compilerOptions { - baseUrl = "$projectDir/src" + /*baseUrl = "$projectDir/src" paths = [ "dojo/*" : [ "typings/dojo/*" ], "dijit/*" : [ "typings/dijit/*" ] - ] - types = ["requirejs", "$projectDir/src/typings/dojo/index" /*, "dojo-typings"*/] + ]*/ + types = ["requirejs", "dojo-typings"] } } diff --git a/src/main/ts/tsx/BuildContextBase.ts b/src/main/ts/tsx/BuildContextBase.ts --- a/src/main/ts/tsx/BuildContextBase.ts +++ b/src/main/ts/tsx/BuildContextBase.ts @@ -3,7 +3,7 @@ import { isPlainObject, isNode, isBuildC import dom = require("dojo/dom-construct"); -export abstract class BuildContextBase implements BuildContext { +export abstract class BuildContextBase implements BuildContext { _attrs = {}; _children = new Array(); @@ -43,7 +43,7 @@ export abstract class BuildContextBase i } } - abstract _getDomNode(): Node; + abstract _getDomNode(): TNode; ensureCreated() { if (!this._created) { diff --git a/src/main/ts/tsx/DjxWidgetBase.ts b/src/main/ts/tsx/DjxWidgetBase.ts --- a/src/main/ts/tsx/DjxWidgetBase.ts +++ b/src/main/ts/tsx/DjxWidgetBase.ts @@ -3,7 +3,6 @@ import _WidgetBase = require("dijit/_Wid import _AttachMixin = require("dijit/_AttachMixin"); import { BuildContext, isNode } from "./traits"; import registry = require("dijit/registry"); -import { Handle } from "dojo/interfaces"; // type Handle = dojo.Handle; @@ -15,13 +14,13 @@ export abstract class DjxWidgetBase exte super.buildRendering(); } - abstract render(): BuildContext; + abstract render(): BuildContext; _processTemplateNode( baseNode: T, getAttrFunc: (baseNode: T, attr: string) => string, // tslint:disable-next-line: ban-types - attachFunc: (node: T, type: string, func?: Function) => Handle + attachFunc: (node: T, type: string, func?: Function) => dojo.Handle ): boolean { if (isNode(baseNode)) { const w = registry.byNode(baseNode); diff --git a/src/main/ts/tsx/HtmlElementContext.ts b/src/main/ts/tsx/HtmlElementContext.ts --- a/src/main/ts/tsx/HtmlElementContext.ts +++ b/src/main/ts/tsx/HtmlElementContext.ts @@ -3,7 +3,7 @@ import attr = require("dojo/dom-attr"); import { argumentNotEmptyString } from "@implab/core-amd/safe"; import { BuildContextBase } from "./BuildContextBase"; -export class HtmlElementContext extends BuildContextBase { +export class HtmlElementContext extends BuildContextBase { elementType: string; _element: HTMLElement | undefined; diff --git a/src/main/ts/tsx/WidgetContext.ts b/src/main/ts/tsx/WidgetContext.ts --- a/src/main/ts/tsx/WidgetContext.ts +++ b/src/main/ts/tsx/WidgetContext.ts @@ -17,7 +17,7 @@ export interface _Widget { export type _WidgetCtor = new (attrs: any, srcNode?: string | Node) => _Widget; -export class WidgetContext extends BuildContextBase { +export class WidgetContext extends BuildContextBase { widgetClass: _WidgetCtor; _instance: _Widget | undefined; diff --git a/src/main/ts/tsx/traits.ts b/src/main/ts/tsx/traits.ts --- a/src/main/ts/tsx/traits.ts +++ b/src/main/ts/tsx/traits.ts @@ -4,8 +4,8 @@ type _WidgetBaseConstructor = typeof _Wi export type DojoNodePosition = "first" | "after" | "before" | "last" | "replace" | "only" | number; -export interface BuildContext { - getDomNode(): Node; +export interface BuildContext { + getDomNode(): TNode; placeAt(refNode: string | Node, position?: DojoNodePosition): void; } diff --git a/src/main/tsconfig.json b/src/main/tsconfig.json --- a/src/main/tsconfig.json +++ b/src/main/tsconfig.json @@ -1,18 +1,13 @@ { "extends": "../tsconfig", "compilerOptions": { - "baseUrl": "../", "rootDir": "ts", "rootDirs": [ "ts", "typings" ], - "paths" : { - "dojo/*" : [ "typings/dojo/*" ], - "dijit/*" : [ "typings/dijit/*" ] - }, "types": [ - "requirejs", "./typings/index", "../typings/dojo/index" + "requirejs", "./typings/index", "dojo-typings" ] } } \ No newline at end of file diff --git a/src/typings/dijit/_AttachMixin.d.ts b/src/typings/dijit/_AttachMixin.d.ts --- a/src/typings/dijit/_AttachMixin.d.ts +++ b/src/typings/dijit/_AttachMixin.d.ts @@ -1,7 +1,6 @@ import { Handle } from "dojo/interfaces"; import _WidgetBase = require("./_WidgetBase"); -import declare = require("dojo/_base/declare"); -import dojo = require("dojo/_base/html"); +import dojo = require("dojo/_base/kernel"); declare module "./_WidgetBase" { interface _WidgetBase { diff --git a/src/typings/dijit/_WidgetBase.d.ts b/src/typings/dijit/_WidgetBase.d.ts --- a/src/typings/dijit/_WidgetBase.d.ts +++ b/src/typings/dijit/_WidgetBase.d.ts @@ -2,6 +2,7 @@ import Stateful = require("dojo/Stateful import Destroyable = require("./Destroyable"); import { ExtensionEvent } from "dojo/on"; import { NodeFragmentOrString, Handle, NodeOrString, WatchHandle } from "dojo/interfaces"; +import dojo = require("dojo/_base/kernel"); declare namespace _WidgetBase { interface _WidgetBase extends Stateful, Destroyable { @@ -229,7 +230,7 @@ declare namespace _WidgetBase { defer(fcn: Function, delay?: number): Handle; } - interface _WidgetBaseConstructor extends DeclareConstructor { + interface _WidgetBaseConstructor extends dojo._base.DeclareConstructor { new(params: Object, srcNodeRef?: NodeOrString): W; }