##// END OF EJS Templates
Working on dojo typings
cin -
r15:8ef85ad13241 default
parent child
Show More
@@ -32,7 +32,12 typescript {
32
32
33 configureTsMain {
33 configureTsMain {
34 compilerOptions {
34 compilerOptions {
35 types = ["requirejs", "dojo-typings"]
35 baseUrl = "$projectDir/src"
36 paths = [
37 "dojo/*" : [ "typings/dojo/*" ],
38 "dijit/*" : [ "typings/dijit/*" ]
39 ]
40 types = ["requirejs", "$projectDir/src/typings/dojo/index" /*, "dojo-typings"*/]
36 }
41 }
37 }
42 }
38
43
@@ -1145,9 +1145,9
1145 "dev": true
1145 "dev": true
1146 },
1146 },
1147 "typescript": {
1147 "typescript": {
1148 "version": "3.7.5",
1148 "version": "3.8.3",
1149 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
1149 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz",
1150 "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
1150 "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==",
1151 "dev": true
1151 "dev": true
1152 },
1152 },
1153 "uri-js": {
1153 "uri-js": {
@@ -21,7 +21,7
21 "devDependencies": {
21 "devDependencies": {
22 "@types/requirejs": "2.1.31",
22 "@types/requirejs": "2.1.31",
23 "dojo": "1.16.0",
23 "dojo": "1.16.0",
24 "typescript": "~3.7.5",
24 "typescript": "~3.8.3",
25 "eslint": "6.8.0",
25 "eslint": "6.8.0",
26 "tslint": "6.0.0",
26 "tslint": "6.0.0",
27 "@implab/core-amd": "^1.3.2",
27 "@implab/core-amd": "^1.3.2",
@@ -1,9 +1,10
1 import declare = require("dojo/_base/declare");
1 import declare = require("dojo/_base/declare");
2 import { each } from "@implab/core-amd/safe";
2 import { each } from "@implab/core-amd/safe";
3 import { Constructor } from "@implab/core-amd/interfaces";
3 import { Constructor } from "@implab/core-amd/interfaces";
4 // import { DeclareConstructor } from "dojo/_base/declare";
5
4
6 type DeclareConstructor<T> = dojo._base.DeclareConstructor<T>;
5 // declare const declare: any;
6
7 type DeclareConstructor<T> = declare.DeclareConstructor<T>;
7
8
8 export interface AbstractConstructor<T = {}> {
9 export interface AbstractConstructor<T = {}> {
9 prototype: T;
10 prototype: T;
@@ -3,8 +3,9 import _WidgetBase = require("dijit/_Wid
3 import _AttachMixin = require("dijit/_AttachMixin");
3 import _AttachMixin = require("dijit/_AttachMixin");
4 import { BuildContext, isNode } from "./traits";
4 import { BuildContext, isNode } from "./traits";
5 import registry = require("dijit/registry");
5 import registry = require("dijit/registry");
6 // import { Handle } from "dojo/interfaces";
6 import { Handle } from "dojo/interfaces";
7 type Handle = dojo.Handle;
7
8 // type Handle = dojo.Handle;
8
9
9 @djclass
10 @djclass
10 export abstract class DjxWidgetBase extends djbase(_WidgetBase, _AttachMixin) {
11 export abstract class DjxWidgetBase extends djbase(_WidgetBase, _AttachMixin) {
@@ -1,13 +1,18
1 {
1 {
2 "extends": "../tsconfig",
2 "extends": "../tsconfig",
3 "compilerOptions": {
3 "compilerOptions": {
4 "baseUrl": "../",
4 "rootDir": "ts",
5 "rootDir": "ts",
5 "rootDirs": [
6 "rootDirs": [
6 "ts",
7 "ts",
7 "typings"
8 "typings"
8 ],
9 ],
10 "paths" : {
11 "dojo/*" : [ "typings/dojo/*" ],
12 "dijit/*" : [ "typings/dijit/*" ]
13 },
9 "types": [
14 "types": [
10 "requirejs", "dojo-typings", "./typings/index"
15 "requirejs", "./typings/index", "../typings/dojo/index"
11 ]
16 ]
12 }
17 }
13 } No newline at end of file
18 }
@@ -11,7 +11,7 test("simple", (ok, fail, log) => {
11 }, 100);
11 }, 100);
12 });
12 });
13
13
14 test("simple", async log => {
14 test("simple", async (log, fail) => {
15 await delay(0);
15 await delay(0);
16
16
17 assert.ok(true); // everything is fine
17 assert.ok(true); // everything is fine
@@ -1,6 +1,6
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import { Handle } from "dojo/interfaces";
1 import { Handle } from "dojo/interfaces";
3 import _WidgetBase = require("./_WidgetBase");
2 import _WidgetBase = require("./_WidgetBase");
3 import declare = require("dojo/_base/declare");
4
4
5 declare module "./_WidgetBase" {
5 declare module "./_WidgetBase" {
6 interface _WidgetBase {
6 interface _WidgetBase {
@@ -81,7 +81,7 interface _AttachMixin {
81 destroyRendering(preserveDom?: boolean): void;
81 destroyRendering(preserveDom?: boolean): void;
82 }
82 }
83
83
84 interface _AttachMixinConstructor extends DeclareConstructor<_AttachMixin> { }
84 interface _AttachMixinConstructor extends declare.DeclareConstructor<_AttachMixin> { }
85
85
86 declare const _AttachMixin: _AttachMixinConstructor;
86 declare const _AttachMixin: _AttachMixinConstructor;
87 export = _AttachMixin;
87 export = _AttachMixin;
@@ -2,7 +2,6 import Stateful = require("dojo/Stateful
2 import Destroyable = require("./Destroyable");
2 import Destroyable = require("./Destroyable");
3 import { ExtensionEvent } from "dojo/on";
3 import { ExtensionEvent } from "dojo/on";
4 import { NodeFragmentOrString, Handle, NodeOrString, WatchHandle } from "dojo/interfaces";
4 import { NodeFragmentOrString, Handle, NodeOrString, WatchHandle } from "dojo/interfaces";
5 import { DeclareConstructor } from "dojo/_base/declare";
6
5
7 declare namespace _WidgetBase {
6 declare namespace _WidgetBase {
8 interface _WidgetBase extends Stateful, Destroyable {
7 interface _WidgetBase extends Stateful, Destroyable {
@@ -231,7 +230,7 declare namespace _WidgetBase {
231 }
230 }
232
231
233 interface _WidgetBaseConstructor<W = _WidgetBase> extends DeclareConstructor<W> {
232 interface _WidgetBaseConstructor<W = _WidgetBase> extends DeclareConstructor<W> {
234 new(params: Object, srcNodeRef: NodeOrString): W;
233 new(params: Object, srcNodeRef?: NodeOrString): W;
235 }
234 }
236
235
237 }
236 }
@@ -1,6 +1,6
1 /* dojo/_base/Color */
1 /* dojo/_base/Color */
2
2
3 declare namespace dojoColor {
3 declare namespace Color {
4 type ColorValue = [number, number, number];
4 type ColorValue = [number, number, number];
5 type ColorValueAlpha = [number, number, number, number];
5 type ColorValueAlpha = [number, number, number, number];
6
6
@@ -264,6 +264,6 declare namespace dojoColor {
264
264
265 }
265 }
266
266
267 type dojoColor = dojoColor.Color;
267 type Color = Color.Color;
268 declare const dojoColor: dojoColor.ColorConstructor;
268 declare const Color: Color.ColorConstructor;
269 export = dojoColor;
269 export = Color;
@@ -1,5 +1,6
1 import DojoPromise = require("../promise/Promise");
1 import DojoPromise = require("../promise/Promise");
2 import { PromiseCallback, PromiseErrback, PromiseProgback } from "../promise/Promise";
2 import { PromiseCallback, PromiseErrback, PromiseProgback } from "../promise/Promise";
3 import declare = require("./declare");
3
4
4 /* dojo/_base/Deferred */
5 /* dojo/_base/Deferred */
5
6
@@ -1,55 +1,51
1 import { GenericConstructor } from "../interfaces";
1 import { GenericConstructor } from "../interfaces";
2
2
3 /* dojo/_base/array */
3 /* dojo/_base/array */
4 interface DojoArray {
4
5 /**
5 /**
6 * Determines whether or not every item in arr satisfies the condition implemented by callback.
6 * Determines whether or not every item in arr satisfies the condition implemented by callback.
7 * @param {T[] | string} arr the array to iterate on. If a string, operates on individual characters.
7 * @param {T[] | string} arr the array to iterate on. If a string, operates on individual characters.
8 * @param {Function | string} callback a function is invoked with three arguments: item, index, and
8 * @param {Function | string} callback a function is invoked with three arguments: item, index, and
9 * array and returns true if the condition is met.
9 * array and returns true if the condition is met.
10 * @param {object} thisObj may be used to scope the call to callback
10 * @param {object} thisObj may be used to scope the call to callback
11 */
11 */
12 every<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
12 export function every<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
13
13
14 /**
14 /**
15 * Determines whether or not any item in arr satisfies the condition implemented by callback.
15 * Determines whether or not any item in arr satisfies the condition implemented by callback.
16 */
16 */
17 some<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
17 export function some<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
18
18
19 /**
19 /**
20 * locates the last index of the provided value in the passed array. If the value is not found, -1
20 * locates the last index of the provided value in the passed array. If the value is not found, -1
21 * is returned.
21 * is returned.
22 * @param {boolean} findLast Makes indexOf() work like lastIndexOf(). Used internally; not meant
22 * @param {boolean} findLast Makes indexOf() work like lastIndexOf(). Used internally; not meant
23 * for external usage.
23 * for external usage.
24 */
24 */
25 indexOf<T>(arr: T[], value: T, fromIndex?: number, findLast?: boolean): number;
25 export function indexOf<T>(arr: T[], value: T, fromIndex?: number, findLast?: boolean): number;
26
26
27 /**
27 /**
28 * locates the first index of the provided value in the passed array. If the value is not found,
28 * locates the first index of the provided value in the passed array. If the value is not found,
29 * -1 is returned.
29 * -1 is returned.
30 */
30 */
31 lastIndexOf<T>(arr: T[], value: T, fromIndex?: number): number;
31 export function lastIndexOf<T>(arr: T[], value: T, fromIndex?: number): number;
32
32
33 /**
33 /**
34 * locates the last index of the provided value in the passed array. If the value is not found,
34 * locates the last index of the provided value in the passed array. If the value is not found,
35 * -1 is returned.
35 * -1 is returned.
36 */
36 */
37 forEach<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => void), thisObj?: Object): void;
37 export function forEach<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => void), thisObj?: Object): void;
38
38
39 /**
39 /**
40 * for every item in arr, callback is invoked. Return values are ignored. If you want to break
40 * for every item in arr, callback is invoked. Return values are ignored. If you want to break
41 * out of the loop, consider using array.every() or array.some().
41 * out of the loop, consider using array.every() or array.some().
42 */
42 */
43 map<T, U>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => U), thisObj?: Object, Ctr?: GenericConstructor<U[]>): U[];
43 export function map<T, U>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => U), thisObj?: Object, Ctr?: GenericConstructor<U[]>): U[];
44
44
45 /**
45 /**
46 * Returns a new Array with those items from arr that match the condition implemented by
46 * Returns a new Array with those items from arr that match the condition implemented by
47 * callback.
47 * callback.
48 */
48 */
49 filter<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): T[];
49 export function filter<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): T[];
50
50
51 clearCache(): void;
51 export function clearCache(): void;
52 }
53
54 declare const dojoArray: DojoArray;
55 export = dojoArray;
@@ -10,4 +10,4 import"../query";
10 import "./xhr";
10 import "./xhr";
11 import "./fx";
11 import "./fx";
12
12
13 export = dojo; No newline at end of file
13 export = dojo;
@@ -1,151 +1,154
1 import { ColorValue, ColorValueAlpha } from "./Color";
1 import { ColorValue, ColorValueAlpha } from "./Color";
2 import { HasCache } from "../has";
2 import { HasCache } from "../has";
3 interface Config {
3
4 /** Defaults to `false`. If set to `true`, ensures that Dojo provides
4 declare namespace config {
5 * extended debugging feedback via Firebug. If Firebug is not available
5 interface Config {
6 * on your platform, setting `isDebug` to `true` will force Dojo to
6 /** Defaults to `false`. If set to `true`, ensures that Dojo provides
7 * pull in (and display) the version of Firebug Lite which is
7 * extended debugging feedback via Firebug. If Firebug is not available
8 * integrated into the Dojo distribution, thereby always providing a
8 * on your platform, setting `isDebug` to `true` will force Dojo to
9 * debugging/logging console when `isDebug` is enabled. Note that
9 * pull in (and display) the version of Firebug Lite which is
10 * Firebug's `console.*` methods are ALWAYS defined by Dojo. If
10 * integrated into the Dojo distribution, thereby always providing a
11 * `isDebug` is false and you are on a platform without Firebug, these
11 * debugging/logging console when `isDebug` is enabled. Note that
12 * methods will be defined as no-ops.
12 * Firebug's `console.*` methods are ALWAYS defined by Dojo. If
13 */
13 * `isDebug` is false and you are on a platform without Firebug, these
14 isDebug: boolean;
14 * methods will be defined as no-ops.
15 */
16 isDebug: boolean;
15
17
16 /**
18 /**
17 * The locale to assume for loading localized resources in this page,
19 * The locale to assume for loading localized resources in this page,
18 * specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
20 * specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
19 * Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
21 * Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
20 * See the documentation for `dojo.i18n` and `dojo.requireLocalization`
22 * See the documentation for `dojo.i18n` and `dojo.requireLocalization`
21 * for details on loading localized resources. If no locale is specified,
23 * for details on loading localized resources. If no locale is specified,
22 * Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
24 * Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
23 * or `navigator.language` properties.
25 * or `navigator.language` properties.
24 */
26 */
25 locale: string;
27 locale: string;
26
28
27 /**
29 /**
28 * No default value. Specifies additional locales whose
30 * No default value. Specifies additional locales whose
29 * resources should also be loaded alongside the default locale when
31 * resources should also be loaded alongside the default locale when
30 * calls to `dojo.requireLocalization()` are processed.
32 * calls to `dojo.requireLocalization()` are processed.
31 */
33 */
32 extraLocale: string[];
34 extraLocale: string[];
33
35
34 /**
36 /**
35 * The directory in which `dojo.js` is located. Under normal
37 * The directory in which `dojo.js` is located. Under normal
36 * conditions, Dojo auto-detects the correct location from which it
38 * conditions, Dojo auto-detects the correct location from which it
37 * was loaded. You may need to manually configure `baseUrl` in cases
39 * was loaded. You may need to manually configure `baseUrl` in cases
38 * where you have renamed `dojo.js` or in which `<base>` tags confuse
40 * where you have renamed `dojo.js` or in which `<base>` tags confuse
39 * some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
41 * some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
40 * either the value of `djConfig.baseUrl` if one is provided or the
42 * either the value of `djConfig.baseUrl` if one is provided or the
41 * auto-detected root if not. Other modules are located relative to
43 * auto-detected root if not. Other modules are located relative to
42 * this path. The path should end in a slash.
44 * this path. The path should end in a slash.
43 */
45 */
44 baseUrl: string;
46 baseUrl: string;
45
47
46 /**
48 /**
47 * A map of module names to paths relative to `dojo.baseUrl`. The
49 * A map of module names to paths relative to `dojo.baseUrl`. The
48 * key/value pairs correspond directly to the arguments which
50 * key/value pairs correspond directly to the arguments which
49 * `dojo.registerModulePath` accepts. Specifying
51 * `dojo.registerModulePath` accepts. Specifying
50 * `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
52 * `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
51 * of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
53 * of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
52 * modules may be configured via `djConfig.modulePaths`.
54 * modules may be configured via `djConfig.modulePaths`.
53 */
55 */
54 modulePaths: { [mid: string]: string };
56 modulePaths: { [mid: string]: string };
55
57
56 /**
58 /**
57 * Adds a callback via dojo/ready. Useful when Dojo is added after
59 * Adds a callback via dojo/ready. Useful when Dojo is added after
58 * the page loads and djConfig.afterOnLoad is true. Supports the same
60 * the page loads and djConfig.afterOnLoad is true. Supports the same
59 * arguments as dojo/ready. When using a function reference, use
61 * arguments as dojo/ready. When using a function reference, use
60 * `djConfig.addOnLoad = function(){};`. For object with function name use
62 * `djConfig.addOnLoad = function(){};`. For object with function name use
61 * `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
63 * `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
62 * function reference use
64 * function reference use
63 * `djConfig.addOnLoad = [myObject, function(){}];`
65 * `djConfig.addOnLoad = [myObject, function(){}];`
64 */
66 */
65 addOnLoad: () => void | [any, string];
67 addOnLoad: () => void | [any, string];
66
68
67 /**
69 /**
68 * Run the parser after the page is loaded
70 * Run the parser after the page is loaded
69 */
71 */
70 parseOnLoad: boolean;
72 parseOnLoad: boolean;
71
73
72 /**
74 /**
73 * An array of module names to be loaded immediately after dojo.js has been included
75 * An array of module names to be loaded immediately after dojo.js has been included
74 * in a page.
76 * in a page.
75 */
77 */
76 require: string[];
78 require: string[];
77
79
78 /**
80 /**
79 * Default duration, in milliseconds, for wipe and fade animations within dijits.
81 * Default duration, in milliseconds, for wipe and fade animations within dijits.
80 * Assigned to dijit.defaultDuration.
82 * Assigned to dijit.defaultDuration.
81 */
83 */
82 defaultDuration: number;
84 defaultDuration: number;
83
85
84 /**
86 /**
85 * Used by some modules to configure an empty iframe. Used by dojo/io/iframe and
87 * Used by some modules to configure an empty iframe. Used by dojo/io/iframe and
86 * dojo/back, and dijit/popup support in IE where an iframe is needed to make sure native
88 * dojo/back, and dijit/popup support in IE where an iframe is needed to make sure native
87 * controls do not bleed through the popups. Normally this configuration variable
89 * controls do not bleed through the popups. Normally this configuration variable
88 * does not need to be set, except when using cross-domain/CDN Dojo builds.
90 * does not need to be set, except when using cross-domain/CDN Dojo builds.
89 * Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
91 * Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
90 * to the path on your domain your copy of blank.html.
92 * to the path on your domain your copy of blank.html.
91 */
93 */
92 dojoBlankHtmlUrl: string;
94 dojoBlankHtmlUrl: string;
93
95
94 /**
96 /**
95 * Set this to true to enable publishing of topics for the different phases of
97 * Set this to true to enable publishing of topics for the different phases of
96 * IO operations. Publishing is done via dojo/topic.publish(). See dojo/main.__IoPublish for a list
98 * IO operations. Publishing is done via dojo/topic.publish(). See dojo/main.__IoPublish for a list
97 * of topics that are published.
99 * of topics that are published.
98 */
100 */
99 ioPublish: boolean;
101 ioPublish: boolean;
100
102
101 /**
103 /**
102 * If set to a value that evaluates to true such as a string or array and
104 * If set to a value that evaluates to true such as a string or array and
103 * isDebug is true and Firebug is not available or running, then it bypasses
105 * isDebug is true and Firebug is not available or running, then it bypasses
104 * the creation of Firebug Lite allowing you to define your own console object.
106 * the creation of Firebug Lite allowing you to define your own console object.
105 */
107 */
106 useCustomLogger: any;
108 useCustomLogger: any;
107
109
108 /**
110 /**
109 * Array containing the r, g, b components used as transparent color in dojo.Color;
111 * Array containing the r, g, b components used as transparent color in dojo.Color;
110 * if undefined, ColorValue (white) will be used.
112 * if undefined, ColorValue (white) will be used.
111 */
113 */
112 transparentColor: ColorValue | ColorValueAlpha;
114 transparentColor: ColorValue | ColorValueAlpha;
113
115
114 /**
116 /**
115 * Defines dependencies to be used before the loader has been loaded.
117 * Defines dependencies to be used before the loader has been loaded.
116 * When provided, they cause the loader to execute require(deps, callback)
118 * When provided, they cause the loader to execute require(deps, callback)
117 * once it has finished loading. Should be used with callback.
119 * once it has finished loading. Should be used with callback.
118 */
120 */
119 deps: () => string[] | string[];
121 deps: () => string[] | string[];
120
122
121 /**
123 /**
122 * Defines the cached has API variables
124 * Defines the cached has API variables
123 */
125 */
124 hasCache: HasCache;
126 hasCache: HasCache;
125
127
126 /**
128 /**
127 * Defines a callback to be used when dependencies are defined before
129 * Defines a callback to be used when dependencies are defined before
128 * the loader has been loaded. When provided, they cause the loader to
130 * the loader has been loaded. When provided, they cause the loader to
129 * execute require(deps, callback) once it has finished loading.
131 * execute require(deps, callback) once it has finished loading.
130 */
132 */
131 callback: (...args: any[]) => void;
133 callback: (...args: any[]) => void;
132
134
133 /**
135 /**
134 * Whether deferred instrumentation should be loaded or included
136 * Whether deferred instrumentation should be loaded or included
135 * in builds.
137 * in builds.
136 */
138 */
137 deferredInstrumentation: boolean;
139 deferredInstrumentation: boolean;
138
140
139 /**
141 /**
140 * Whether the deferred instrumentation should be used.
142 * Whether the deferred instrumentation should be used.
141 *
143 *
142 * * `"report-rejections"`: report each rejection as it occurs.
144 * * `"report-rejections"`: report each rejection as it occurs.
143 * * `true` or `1` or `"report-unhandled-rejections"`: wait 1 second
145 * * `true` or `1` or `"report-unhandled-rejections"`: wait 1 second
144 * in an attempt to detect unhandled rejections.
146 * in an attempt to detect unhandled rejections.
145 */
147 */
146 useDeferredInstrumentation: string | boolean | number;
148 useDeferredInstrumentation: string | boolean | number;
149 }
150
147 }
151 }
148
152
149 type dojoConfig = Config;
153 declare const config: config.Config;
150 declare const dojoConfig: Config;
154 export = config;
151 export = dojoConfig; No newline at end of file
@@ -1,49 +1,47
1 import { Handle } from "../interfaces";
1 import { Handle } from "../interfaces";
2
2
3 interface Connect {
3 /**
4 /**
4 * TODO: Type this better
5 * TODO: Type this better
5 */
6 */
6 export function _keypress(object: any, listener: EventListener): Handle;
7 _keypress(object: any, listener: EventListener): Handle;
8
7
9 /**
8 /**
10 * `dojo.connect` is a deprecated event handling and delegation method in
9 * `dojo.connect` is a deprecated event handling and delegation method in
11 * Dojo. It allows one function to "listen in" on the execution of
10 * Dojo. It allows one function to "listen in" on the execution of
12 * any other, triggering the second whenever the first is called. Many
11 * any other, triggering the second whenever the first is called. Many
13 * listeners may be attached to a function, and source functions may
12 * listeners may be attached to a function, and source functions may
14 * be either regular function calls or DOM events.
13 * be either regular function calls or DOM events.
15 */
14 */
16 connect(obj: any, event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
15 export function connect(obj: any, event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
17 connect(event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
16 export function connect(event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
18
17
19 /**
18 /**
20 * Remove a link created by dojo.connect.
19 * Remove a link created by dojo.connect.
21 */
20 */
22 disconnect(handle: Handle): void;
21 export function disconnect(handle: Handle): void;
23
22
24 /**
23 /**
25 * Attach a listener to a named topic. The listener function is invoked whenever the
24 * Attach a listener to a named topic. The listener function is invoked whenever the
26 * named topic is published (see: dojo.publish).
25 * named topic is published (see: dojo.publish).
27 * Returns a handle which is needed to unsubscribe this listener.
26 * Returns a handle which is needed to unsubscribe this listener.
28 */
27 */
29 subscribe(topic: string, context: any, method: EventListener): Handle;
28 export function subscribe(topic: string, context: any, method: EventListener): Handle;
30
29
31 /**
30 /**
32 * Invoke all listener method subscribed to topic.
31 * Invoke all listener method subscribed to topic.
33 */
32 */
34 publish(topic: string, args: any[]): boolean;
33 export function publish(topic: string, args: any[]): boolean;
35
34
36 /**
35 /**
37 * Ensure that every time obj.event() is called, a message is published
36 * Ensure that every time obj.event() is called, a message is published
38 * on the topic. Returns a handle which can be passed to
37 * on the topic. Returns a handle which can be passed to
39 * dojo.disconnect() to disable subsequent automatic publication on
38 * dojo.disconnect() to disable subsequent automatic publication on
40 * the topic.
39 * the topic.
41 */
40 */
42 connectPublisher(topic: string, obj: any, method: string): Handle;
41 export function connectPublisher(topic: string, obj: any, method: string): Handle;
43 connectPublisher(topic: string, method: EventListener): Handle;
42 export function connectPublisher(topic: string, method: EventListener): Handle;
44
43
45 /**
44 /**
46 * Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
45 * Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
47 */
46 */
48 isCopyKey(e: Event): boolean;
47 export function isCopyKey(e: Event): boolean;
49 } No newline at end of file
@@ -1,10 +1,11
1 declare namespace declare {
1 declare module "./kernel" {
2 /* dojo/_base/declare */
2 interface Dojo {
3 declare: declare.Declare;
4 safeMixin: typeof declare.safeMixin;
5 }
6 }
3
7
4 /**
8 declare namespace declare {
5 * dojo/_base/declare() returns a constructor `C`. `new C()` returns an Object with the following
6 * methods, in addition to the methods and properties specified via the arguments passed to declare().
7 */
8 interface DeclareCreatedObject {
9 interface DeclareCreatedObject {
9 declaredClass: string;
10 declaredClass: string;
10
11
@@ -99,9 +100,6 declare namespace declare {
99 createSubclass<U>(mixins: any, props: U): DeclareConstructor<T & U>;
100 createSubclass<U>(mixins: any, props: U): DeclareConstructor<T & U>;
100 }
101 }
101
102
102 /**
103 * Create a feature-rich constructor from compact notation.
104 */
105 interface Declare {
103 interface Declare {
106 <A, B, C, D>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>]): DeclareConstructor<A & B & C & D>;
104 <A, B, C, D>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>]): DeclareConstructor<A & B & C & D>;
107 <A, B, C>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>]): DeclareConstructor<A & B & C>;
105 <A, B, C>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>]): DeclareConstructor<A & B & C>;
@@ -1,22 +1,21
1 /* dojo/_base/event */
1 /* dojo/_base/event */
2
2
3 /**
3 /**
4 * @module
4 * This module defines dojo DOM event API. Usually you should use dojo/on, and evt.stopPropagation() +
5 * This module defines dojo DOM event API. Usually you should use dojo/on, and evt.stopPropagation() +
5 * evt.preventDefault(), rather than this module.
6 * evt.preventDefault(), rather than this module.
6 */
7 */
7 interface EventModule {
8
8 /**
9 * normalizes properties on the event object including event
10 * bubbling methods, keystroke normalization, and x/y positions
11 */
12 fix(evt: Event, sender: Element): Event;
13
9
14 /**
10 /**
15 * prevents propagation and clobbers the default action of the
11 * normalizes properties on the event object including event
16 * passed event
12 * bubbling methods, keystroke normalization, and x/y positions
17 */
13 */
18 stop(evt: Event): void;
14 export declare function fix(evt: Event, sender: Element): Event;
19 }
20
15
21 declare const dojoEvent: EventModule;
16 /**
22 export = dojoEvent;
17 * prevents propagation and clobbers the default action of the
18 * passed event
19 */
20 export declare function stop(evt: Event): void;
21
@@ -1,218 +1,215
1 import Evented = require("../Evented");
1 import Evented = require("../Evented");
2
2
3 declare namespace fx {
3 /* dojo/_base/fx */
4 /* dojo/_base/fx */
4
5 export interface _Line {
6 /**
7 * Returns the point on the line
8 * @param {number} n a floating point number greater than 0 and less than 1
9 */
10 getValue(n: number): number;
11 }
12
13 /**
14 * Object used to generate values from a start value to an end value
15 */
16 export interface LineConstructor {
17 new(start: number, end: number): _Line;
18
19 prototype: _Line;
20 }
21
22 export interface EasingFunction {
23 (n?: number): number;
24 }
25
26 export interface Animation extends Evented {
27 /**
28 * The time in milliseconds the animation will take to run
29 */
30 duration: number;
31
32 /**
33 * A two element array of start and end values, or a `_Line` instance to be
34 * used in the Animation.
35 */
36 curve: _Line | [number, number];
37
38 /**
39 * A Function to adjust the acceleration (or deceleration) of the progress
40 * across a _Line
41 */
42 easing?: EasingFunction;
43
44 /**
45 * The number of times to loop the animation
46 */
47 repeat: number;
5
48
6 interface Line {
49 /**
7 /**
50 * the time in milliseconds to wait before advancing to next frame
8 * Returns the point on the line
51 * (used as a fps timer: 1000/rate = fps)
9 * @param {number} n a floating point number greater than 0 and less than 1
52 */
10 */
53 rate: number;
11 getValue(n: number): number;
54
12 }
55 /**
56 * The time in milliseconds to wait before starting animation after it
57 * has been .play()'ed
58 */
59 delay?: number;
60
61 /**
62 * Synthetic event fired before a Animation begins playing (synchronous)
63 */
64 beforeBegin?: Event;
65
66 /**
67 * Synthetic event fired as a Animation begins playing (useful?)
68 */
69 onBegin?: Event;
70
71 /**
72 * Synthetic event fired at each interval of the Animation
73 */
74 onAnimate?: Event;
75
76 /**
77 * Synthetic event fired after the final frame of the Animation
78 */
79 onEnd?: Event;
80
81 /**
82 * Synthetic event fired any time the Animation is play()'ed
83 */
84 onPlay?: Event;
85
86 /**
87 * Synthetic event fired when the Animation is paused
88 */
89 onPause?: Event;
90
91 /**
92 * Synthetic event fires when the Animation is stopped
93 */
94 onStop?: Event;
95
96 _percent: number;
97 _startRepeatCount: number;
98 _getStep(): number;
99
100 /**
101 * Convenience function. Fire event "evt" and pass it the
102 * arguments specified in "args".
103 */
104 _fire(evt: Event, args?: any[]): this;
13
105
14 /**
106 /**
15 * Object used to generate values from a start value to an end value
107 * Start the animation.
16 */
108 */
17 interface LineConstructor {
109 play(delay?: number, gotoStart?: boolean): this;
18 new(start: number, end: number): Line;
19 }
20
21 interface EasingFunction {
22 (n?: number): number;
23 }
24
25 interface Animation extends Evented {
26 /**
27 * The time in milliseconds the animation will take to run
28 */
29 duration: number;
30
31 /**
32 * A two element array of start and end values, or a `_Line` instance to be
33 * used in the Animation.
34 */
35 curve: Line | [number, number];
36
37 /**
38 * A Function to adjust the acceleration (or deceleration) of the progress
39 * across a _Line
40 */
41 easing?: EasingFunction;
42
110
43 /**
111 _play(gotoStart?: boolean): this;
44 * The number of times to loop the animation
45 */
46 repeat: number;
47
48 /**
49 * the time in milliseconds to wait before advancing to next frame
50 * (used as a fps timer: 1000/rate = fps)
51 */
52 rate: number;
53
112
54 /**
113 /**
55 * The time in milliseconds to wait before starting animation after it
114 * Pauses a running animation.
56 * has been .play()'ed
115 */
57 */
116 pause(): this;
58 delay?: number;
59
60 /**
61 * Synthetic event fired before a Animation begins playing (synchronous)
62 */
63 beforeBegin?: Event;
64
65 /**
66 * Synthetic event fired as a Animation begins playing (useful?)
67 */
68 onBegin?: Event;
69
70 /**
71 * Synthetic event fired at each interval of the Animation
72 */
73 onAnimate?: Event;
74
117
75 /**
118 /**
76 * Synthetic event fired after the final frame of the Animation
119 * Sets the progress of the animation.
77 */
120 */
78 onEnd?: Event;
121 gotoPercent(precent: number, andPlay?: boolean): this;
79
80 /**
81 * Synthetic event fired any time the Animation is play()'ed
82 */
83 onPlay?: Event;
84
85 /**
86 * Synthetic event fired when the Animation is paused
87 */
88 onPause?: Event;
89
90 /**
91 * Synthetic event fires when the Animation is stopped
92 */
93 onStop?: Event;
94
95 _precent: number;
96 _startRepeatCount: number;
97 _getStep(): number;
98
99 /**
100 * Convenience function. Fire event "evt" and pass it the
101 * arguments specified in "args".
102 */
103 _fire(evt: Event, args?: any[]): this;
104
122
105 /**
123 /**
106 * Start the animation.
124 * Stops a running animation.
107 */
125 */
108 play(delay?: number, gotoStart?: boolean): this;
126 stop(gotoEnd?: boolean): Animation;
109
110 _play(gotoStart?: boolean): this;
111
112 /**
113 * Pauses a running animation.
114 */
115 pause(): this;
116
117 /**
118 * Sets the progress of the animation.
119 */
120 gotoPercent(precent: number, andPlay?: boolean): this;
121
127
122 /**
128 /**
123 * Stops a running animation.
129 * cleanup the animation
124 */
130 */
125 stop(gotoEnd?: boolean): Animation;
131 destroy(): void;
126
127 /**
128 * cleanup the animation
129 */
130 destroy(): void;
131
132 /**
133 * Returns a string token representation of the status of
134 * the animation, one of: "paused", "playing", "stopped"
135 */
136 status(): string;
137
138 _cycle(): Animation;
139 _clearTimer(): void;
140 _startTimer(): void;
141 _stopTimer(): void;
142 }
143
132
144 /**
133 /**
145 * A generic animation class that fires callbacks into its handlers
134 * Returns a string token representation of the status of
146 * object at various states.
135 * the animation, one of: "paused", "playing", "stopped"
147 */
136 */
148 interface AnimationConstructor {
137 status(): string;
149 new(args: any): Animation;
150 prototype: Animation;
151 }
152
138
153 interface AnimationCallback {
139 _cycle(): Animation;
154 (node: HTMLElement): void;
140 _clearTimer(): void;
155 }
141 _startTimer(): void;
156
142 _stopTimer(): void;
157 interface FadeArguments {
143 }
158 node: HTMLElement | string;
159 duration?: number;
160 easing?: EasingFunction;
161
144
162 start?: Function;
145 /**
163 end?: Function;
146 * A generic animation class that fires callbacks into its handlers
164 }
147 * object at various states.
148 */
149 export interface AnimationConstructor {
150 new(args: any): Animation;
151 prototype: Animation;
152 }
165
153
166 interface AnimationArgumentsProperties {
154 export interface AnimationCallback {
167 [name: string]: any;
155 (node: HTMLElement): void;
168 }
156 }
169
157
170 interface AnimationArguments extends FadeArguments {
158 export interface FadeArguments {
171 properties?: AnimationArgumentsProperties;
159 node: HTMLElement | string;
172 onEnd?: AnimationCallback;
160 duration?: number;
173 }
161 easing?: EasingFunction;
174
162
175 interface Fx {
163 start?: Function;
176 _Line: LineConstructor;
164 end?: Function;
165 }
177
166
178 Animation: AnimationConstructor;
167 export interface AnimationArgumentsProperties {
179
168 [name: string]: any;
180 _fade(args: any): Animation;
169 }
181
170
182 /**
171 export interface AnimationArguments extends FadeArguments {
183 * Returns an animation that will fade node defined in 'args' from
172 properties?: AnimationArgumentsProperties;
184 * its current opacity to fully opaque.
173 onEnd?: AnimationCallback;
185 */
174 }
186 fadeIn(args: FadeArguments): Animation;
175
176
177 export const _Line: LineConstructor;
187
178
188 /**
179 export const Animation: AnimationConstructor;
189 * Returns an animation that will fade node defined in 'args'
180
190 * from its current opacity to fully transparent.
181 export function _fade(args: any): Animation;
191 */
192 fadeOut(args: FadeArguments): Animation;
193
182
194 _defaultEasing(n?: number): number;
183 /**
184 * Returns an animation that will fade node defined in 'args' from
185 * its current opacity to fully opaque.
186 */
187 export function fadeIn(args: FadeArguments): Animation;
195
188
196 /**
189 /**
197 * Returns an animation that will transition the properties of
190 * Returns an animation that will fade node defined in 'args'
198 * node defined in `args` depending how they are defined in
191 * from its current opacity to fully transparent.
199 * `args.properties`
192 */
200 */
193 export function fadeOut(args: FadeArguments): Animation;
201 animateProperty(args: AnimationArguments): Animation;
194
195 export function _defaultEasing(n?: number): number;
202
196
203 /**
197 /**
204 * A simpler interface to `animateProperty()`, also returns
198 * Returns an animation that will transition the properties of
205 * an instance of `Animation` but begins the animation
199 * node defined in `args` depending how they are defined in
206 * immediately, unlike nearly every other Dojo animation API.
200 * `args.properties`
207 */
201 */
208 anim(
202 export function animateProperty(args: AnimationArguments): Animation;
209 node: HTMLElement | string,
203
210 properties: { [name: string]: any },
204 /**
211 duration?: number,
205 * A simpler interface to `animateProperty()`, also returns
212 easing?: Function,
206 * an instance of `Animation` but begins the animation
213 onEnd?: AnimationCallback,
207 * immediately, unlike nearly every other Dojo animation API.
214 delay?: number): Animation;
208 */
215 }
209 export function anim(
216 }
210 node: HTMLElement | string,
217 declare const fx: fx.Fx;
211 properties: { [name: string]: any },
218 export = fx;
212 duration?: number,
213 easing?: Function,
214 onEnd?: AnimationCallback,
215 delay?: number): Animation;
@@ -1,5 +1,5
1 /* dojo/_base/kernel */
1 /* dojo/_base/kernel */
2 import Config = require('./config');
2 import { Config } from './config';
3
3
4 declare namespace dojo {
4 declare namespace dojo {
5 interface Dijit {
5 interface Dijit {
@@ -12,8 +12,7 declare namespace dojo {
12 interface Dojo {
12 interface Dojo {
13 config: Config;
13 config: Config;
14 global: any;
14 global: any;
15
15
16 // TODO: dojot, dojox
17 dijit: Dijit;
16 dijit: Dijit;
18 dojox: Dojox;
17 dojox: Dojox;
19
18
General Comments 0
You need to be logged in to leave comments. Login now