add dojo type definitions

This commit is contained in:
Mike Van Sickle
2014-07-01 12:36:00 -04:00
parent b40258ccaa
commit 73e5f8d5f2
65 changed files with 513175 additions and 0 deletions
+294
View File
@@ -0,0 +1,294 @@
# Dojo Definitions Usage Notes
## Overview
Anyone that has used Dojo for any length of time has probably discovered three things:
* Dojo is very powerful
* Dojo can be challenging to learn
* Dojo doesn't always play well with other
Having said that, there are ways that Dojo can be coerced out of its shell to work with other JavaScript technologies. This README is intended to describe some techniques for getting the full power of Dojo to work in an environment where almost everything can take advantage of TypeScript.
*Disclaimer*: Dojo is VERY big framework and, as such the type definitions are generated by a [tool](https://github.com/vansimke/DojoTypeDescriptionGenerator) from dojo's [API](dojotoolkit.org/api) docs. The generated files were then hand-polished to eliminate any import errors and clean up some obvious errors. This is all to say that the generated type definitions are not flawless and are not guaranteed to reflect the actual implementations.
## Basic Usage
A normal dojo module might look something like this:
```js
define(['dojo/request', 'dojo/request/xhr'],
function (request, xhr) {
...
}
);
```
When using the TypeScript, you can write the following:
```ts
define(['dojo/request', 'dojo/request/xhr'],
function (request: dojo.request,
xhr: dojo.request.xhr) {
...
}
);
```
Inside of the define variable, both `request` and `xhr` will work as the functions that come from Dojo, only they are strongly typed.
## Advanced Usage
Dojo and TypeScript both use different and conflicting class semantics. This causes some issues when trying to create custom class modules that are strongly typed in other modules. The following technique is presented as **A** solution to the problem, but not necessarily the best one. Other ideas a welcomed!
Using pure JavaScript, a class that has a base class and mixins can be defined in Dojo as follows:
```js
define(['dojo/_base/declare', 'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dojo/request'],
function(dojoDeclare, _WidgetBase, _TemplatedMixin, request) {
var Foo = dojoDeclare([_WidgetBase, _TemplatedMixin], {
templateString: '<div>Hello TypeScript</div',
message: '',
sayMessage: function() {
alert(this.message);
},
getServerInfo: function() {
request.get('http://dojoAndTypeScriptTogetherAtLast.html', function(data) {
console.log(data);
});
}
});
return Foo;
}
);
```
The goal is to be able to describe the `Foo` class in a way that TypeScript can recognize, but also works with Dojo. This requires some hacks that will be introduced and explained as the problems are discovered.
The first challenge that we run into is how to define the class. We will define that using standard TypeScript semantics as follows:
```ts
module App {
export class Foo extends dijit._WidgetBase implements dijit._TemplatedMixin {
constructor(public templateString= "<div>Hello TypeScript</div>",
public message= "") {
super();
}
sayMessage() {
alert(this.message);
}
getServerInfo() {
request.get("http://dojoAndTypeScriptTogetherAtLast.html", (data: string) => {
console.log(data);
});
}
}
}
```
This class is identical to the standard Dojo method, except that it is declared inside of a TypeScript module and it is declared using TypeScript instead of Dojo's `declare` method. Two problems arise however:
1. `Foo` has an error because it doesn't honor the interface declared by dijit._TemplatedMixin
2. `request` is undefined
The first problem can be solved by adding the missing properties and methods, but this will only serve to clutter the code base over time. Instead, we are creating another base class that hides this requirement like so:
```ts
module App {
export class Foo extends WidgetBaseWithTemplatedMixin {
constructor(public templateString= "<div>Hello TypeScript</div>",
public message= "") {
super();
}
sayMessage() {
alert(this.message);
}
getServerInfo() {
request.get("http://dojoAndTypeScriptTogetherAtLast.html", (data: string) => {
console.log(data);
});
}
}
export class WidgetBaseWithTemplatedMixin extends dijit._WidgetBase implements dijit._TemplatedMixin {
"attachScope": Object;
"searchContainerNode": boolean;
"templatePath": string;
"templateString": string;
buildRendering(): {}
destroyRendering(): {}
getCachedTemplate(templateString: String, alwaysUseString: boolean, doc: HTMLDocument): {}
}
}
```
Now the base class meets TypeScript's requirements so it is happy. This class could easily be moved out to a general add-in file so that it can be created and forgotten since it is only here to make TypeScript happy.
The second problem that we had as that `request` is undefined. This is going to take a bit more trickery as shown below:
```ts
module App {
export class Foo extends WidgetBaseWithTemplatedMixin {
constructor(public templateString= "<div>Hello TypeScript</div>",
public message= "") {
super();
}
public request: dojo.request;
sayMessage() {
alert(this.message);
}
getServerInfo() {
this.request.get("http://dojoAndTypeScriptTogetherAtLast.html").then((data: string) => {
console.log(data);
});
}
}
export class WidgetBaseWithTemplatedMixin extends dijit._WidgetBase implements dijit._TemplatedMixin {
public static getPrototype(deps: Object) {
if (deps) {
for (var i in deps) {
this.prototype[i] = deps[i];
}
return this.prototype;
}
}
"attachScope": Object;
"searchContainerNode": boolean;
"templatePath": string;
"templateString": string;
buildRendering(): {}
destroyRendering(): {}
getCachedTemplate(templateString: String, alwaysUseString: boolean, doc: HTMLDocument): {}
}
}
define(['dojo/_base/declare', 'dijit/_WidgetBase', 'dijit/_TemplatedMixin', 'dojo/request'],
function (dojoDeclare, _WidgetBase, _TemplatedMixin, request) {
var deps = {
request: request
};
var Foo = dojoDeclare([_WidgetBase, _TemplatedMixin], App.Foo.getPrototype(deps));
return Foo;
}
);
```
Yes, I know - pretty crazy right. But, we're getting close...
In the Dojo module, we are building an object that contains references to each of the dependencies. We are then passing that object into the static method `getPrototype` that we have added to the base class. This method takes an object literal and mixes it into the class's prototype. In this way, the module dependencies are made available to the TypeScript class via its prototype. The last thing we need to do is change the `getServerInfo()`'s call to `request` to be a `this.request` call since it is calling through its prototype instead of the ambient object that is used in Dojo.
Okay, great. TypeScript is happy. Everything should be working right? Wrong.
We have two more problems that are not apparent until the code is actually executed. They are both related to our usage of the `extends` keyword that we used to show that our `Foo` class extends from `dijit._WidgetBase`.
The first problem is that, as stated previously, TypeScript has its own implementation of a class system in JavaScript. When one class extends another, TypeScript injects the following snippet into the module:
```js
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
```
This method is called in a closure that wraps the class definition and mixes the parent's prototype and owned properties into the child class. However, this won't work in our case, because our base class is `dijit._WidgetBase` which doesn't actually exist in the global namespace (where TypeScript expects it). This is because we are still using Dojo's class system (via `declare`). This is an important, and confusing, point. Our class is actually being constructed by Dojo using declare. However, we are working with the class as if it was created in the way the TypeScript expects. In short, this means that we don't actually need the `__extends` function to work, but something needs to be there so that the constructor function doesn't die. The solve is actually relatively easy: In the main HTML page, add this function before the tag that includes `dojo.js`:
```js
var __extends = function (d, b) {
if (d && b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() {
this.constructor = d;
}
__.prototype = b.prototype;
d.prototype = new __();
}
};
```
All this does is check to see if `d` and `b` are defined before running. Since TypeScript won't override __extends, it will allow us to override the default implementation.
Okay, only one more thing to deal with: the call to super. This issue is also related to TypeScript's method for handling inheritance. After calling `__extends`, the generated constructor function will call the parent's constructor function. Once again, we are hit by the fact that our base class (`dijit._WidgetBase`) doesn't actually exist where TypeScript is expecting it. The only way around this is to give TypeScript something to call. This simplest thing to do is to add a no-op function for TypeScript to call. In short add this:
```js
var dijit = dijit || {};
dijit._WidgetBase = function() {}
```
Into the page after Dojo bootstraps, but before our module loads. The simplest way to do this is to create a little module that does this and added it to the array of modules loaded in the `define()` call of the module.
Okay, so things look pretty messy right now. There are several hacks and tricks that we have to play in order to allow TypeScript and Dojo to work together. The nice thing about most of this is that it can all be shoved into a single helper module and never thought of again. Here is an example of what that module would look like:
```ts
"use strict";
define([], function () { });
var __extends = function (d, b) {
if (d && b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() {
this.constructor = d;
}
__.prototype = b.prototype;
d.prototype = new __();
}
};
window['dojo'] = {};
window['dijit'] = {
_WidgetBase: function () {
}
};
module Base {
function getPrototype(type: Function, deps: Object): Object {
if (deps) {
for (var i in deps) {
type.prototype[i] = deps[i];
}
return this.prototype;
}
}
export class WidgetBaseWithTemplatedMixin extends dijit._WidgetBase implements dijit._TemplatedMixin {
public static getPrototype(deps: Object): Object {
return getPrototype(this, deps);
}
"attachScope": Object;
"searchContainerNode": boolean;
"templatePath": string;
"templateString": string;
buildRendering() { }
destroyRendering() { }
getCachedTemplate(templateString: String, alwaysUseString: boolean, doc: HTMLDocument) { }
}
}
```
This module can then be added to whenever we have another base class / mix-in combination (e.g. dijit/_WidgetBase, dijit/_TemplatedMixin, and dijit/_WidgetsInTemplateMixin). When done this way, the only regularly visible changes that we have to do is to compose the hash of dependencies and call the `getPrototype` as the last argument to `declare`.
+104749
View File
File diff suppressed because one or more lines are too long
+1904
View File
File diff suppressed because it is too large Load Diff
+27173
View File
File diff suppressed because one or more lines are too long
+1153
View File
File diff suppressed because it is too large Load Diff
+78
View File
@@ -0,0 +1,78 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/analytics.html
*
* Deprecated. Should require dojox/analytics modules directly rather than trying to access them through
* this module.
*
*/
interface analytics {
}
module analytics {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/analytics/Urchin.html
*
* A Google-analytics helper, for post-onLoad inclusion of the tracker, and
* dynamic tracking during long-lived page cycles.
* A small class object will allows for lazy-loading the Google Analytics API
* at any point during a page lifecycle. Most commonly, Google-Analytics is loaded
* via a synchronous script tag in the body, which causes dojo.addOnLoad to
* stall until the external API has been completely loaded. The Urchin helper
* will load the API on the fly, and provide a convenient API to use, wrapping
* Analytics for Ajaxy or single page applications.
*
* The class can be instantiated two ways: Programatically, by passing an
* acct: parameter, or via Markup / dojoType and defining a djConfig
* parameter urchin:
*
* IMPORTANT:
* This module will not work simultaneously with the core dojox.analytics
* package. If you need the ability to run Google Analytics AND your own local
* analytics system, you MUST include dojox.analytics._base BEFORE dojox.analytics.Urchin
*
* @param args
*/
class Urchin {
constructor(args: any);
/**
* your GA urchin tracker account number. Overrides djConfig.urchin
*
*/
"acct": string;
/**
* Stub function to fire when urchin is complete
* This function is executed when the tracker variable is
* complete and initialized. The initial trackPageView (with
* no arguments) is called here as well, so remeber to call
* manually if overloading this method.
*
*/
GAonLoad(): void;
/**
* A public API attached to this widget instance, allowing you
* Ajax-like notification of updates.
*
* @param url A location to tell the tracker to track, eg: "/my-ajaxy-endpoint"
*/
trackPageView(url: String): void;
}
module plugins {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/analytics/plugins/consoleMessages.html
*
*
*/
interface consoleMessages {
}
}
}
}
+2384
View File
File diff suppressed because it is too large Load Diff
+7227
View File
File diff suppressed because it is too large Load Diff
+5658
View File
File diff suppressed because it is too large Load Diff
+11255
View File
File diff suppressed because it is too large Load Diff
+20924
View File
File diff suppressed because it is too large Load Diff
+13132
View File
File diff suppressed because it is too large Load Diff
+161
View File
@@ -0,0 +1,161 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections.html
*
* Deprecated. Should require dojox/collections modules directly rather than trying to access them through
* this module.
*
*/
interface collections {
}
module collections {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/_base.html
*
*
*/
interface _base {
/**
*
*/
Set: Object;
/**
* Returns a new object of type dojox.collections.ArrayList
*
* @param arr Optional
*/
ArrayList(arr: any[]): void;
/**
*
* @param data
*/
BinaryTree(data: any): void;
/**
* Returns an object of type dojox.collections.Dictionary
*
* @param dictionary Optional
*/
Dictionary(dictionary: dojox.collections.Dictionary): void;
/**
* return an object of type dojox.collections.DictionaryEntry
*
* @param k
* @param v
*/
DictionaryEntry(k: String, v: Object): void;
/**
* return an object of type dojox.collections.DictionaryIterator
*
* @param obj
*/
DictionaryIterator(obj: Object): void;
/**
* return an object of type dojox.collections.Iterator
*
* @param a
*/
Iterator(a: any[]): void;
/**
* return an object of type dojox.collections.Queue
*
* @param arr Optional
*/
Queue(arr: any[]): void;
/**
* creates a collection that acts like a dictionary but is also internally sorted.
* Note that the act of adding any elements forces an internal resort, making this object potentially slow.
*
* @param dictionary Optional
*/
SortedList(dictionary: Object): void;
/**
* returns an object of type dojox.collections.Stack
*
* @param arr Optional
*/
Stack(arr: any[]): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/ArrayList.html
*
* Returns a new object of type dojox.collections.ArrayList
*
* @param arr Optional
*/
interface ArrayList{(arr?: any[]): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/BinaryTree.html
*
*
* @param data
*/
interface BinaryTree{(data: any): void}
module BinaryTree {
/**
*
*/
var TraversalMethods: Object
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/BinaryTree.TraversalMethods.html
*
*
*/
interface TraversalMethods {
/**
*
*/
Inorder: number;
/**
*
*/
Postorder: number;
/**
*
*/
Preorder: number;
}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/Dictionary.html
*
* Returns an object of type dojox.collections.Dictionary
*
* @param dictionary Optional
*/
interface Dictionary{(dictionary?: dojox.collections.Dictionary): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/Queue.html
*
* return an object of type dojox.collections.Queue
*
* @param arr Optional
*/
interface Queue{(arr?: any[]): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/SortedList.html
*
* creates a collection that acts like a dictionary but is also internally sorted.
* Note that the act of adding any elements forces an internal resort, making this object potentially slow.
*
* @param dictionary Optional
*/
interface SortedList{(dictionary?: Object): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/collections/Stack.html
*
* returns an object of type dojox.collections.Stack
*
* @param arr Optional
*/
interface Stack{(arr?: any[]): void}
}
}
+352
View File
@@ -0,0 +1,352 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="dojo.d.ts" />
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color.html
*
* Deprecated. Should require dojox/color modules directly rather than trying to access them through
* this module.
*
*/
interface color {
}
module color {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/MeanColorModel.html
*
* A color model that returns a color from a data value
* using an interpolation between two extremum colors around the mean value.
*
* @param startColor The start color.
* @param endColor OptionalThe end color.
*/
class MeanColorModel extends dojox.color.NeutralColorModel {
constructor(startColor: dojo._base.Color, endColor?: dojo._base.Color);
/**
* Return the neutral value in this case the mean value of the data values.
*
* @param min The minimal value.
* @param max The maximum value.
* @param sum The sum of all values.
* @param values The sorted array of values used to compute colors.
*/
computeNeutral(min: number, max: number, sum: number, values: number[]): any;
/**
* return the color for a given data value.
*
* @param value The data value.
*/
getColor(value: number): any;
/**
* Return the normalized (between 0 and 1) value for a given data value.
* This implementation uses an power function to map neutral value to 0.5
* and distribute other values around it.
*
* @param value The data value
*/
getNormalizedValue(value: number): any;
/**
* Initialize the color model from a list of data items and using a function
* that returns the value used to compute the color for a given item.
*
* @param items The data items.
* @param colorFunc The function that returns the value used to compute the color for particular data item.
*/
initialize(items: Object[], colorFunc: Function): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/NeutralColorModel.html
*
* Base class for color models that return a color from a data value
* using an interpolation between two extremum colors around a neutral value.
*
* @param startColor The start color.
* @param endColor OptionalThe end color.
*/
class NeutralColorModel extends dojox.color.SimpleColorModel {
constructor(startColor: dojo._base.Color, endColor?: dojo._base.Color);
/**
* Return the neutral value. This can be for example the mean or average value.
* This function must be implemented by implementations.
*
* @param min The minimal value.
* @param max The maximum value.
* @param sum The sum of all values.
* @param values The sorted array of values used to compute colors.
*/
computeNeutral(min: number, max: number, sum: number, values: number[]): void;
/**
* return the color for a given data value.
*
* @param value The data value.
*/
getColor(value: number): any;
/**
* Return the normalized (between 0 and 1) value for a given data value.
* This implementation uses an power function to map neutral value to 0.5
* and distribute other values around it.
*
* @param value The data value
*/
getNormalizedValue(value: number): any;
/**
* Initialize the color model from a list of data items and using a function
* that returns the value used to compute the color for a given item.
*
* @param items The data items.
* @param colorFunc The function that returns the value used to compute the color for particular data item.
*/
initialize(items: Object[], colorFunc: Function): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/SimpleColorModel.html
*
* Base class for color models that return a color from a data value
* using an interpolation between two extremum colors.
*
* @param startColor The start color.
* @param endColor OptionalThe end color.
*/
class SimpleColorModel {
constructor(startColor: dojo._base.Color, endColor?: dojo._base.Color);
/**
* return the color for a given data value.
*
* @param value The data value.
*/
getColor(value: number): any;
/**
* Return the normalized (between 0 and 1) value for a given data value.
* This function must be implemented by implementations.
*
* @param value The data value.
*/
getNormalizedValue(value: number): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/Palette.html
*
* An object that represents a palette of colors.
* A Palette is a representation of a set of colors. While the standard
* number of colors contained in a palette is 5, it can really handle any
* number of colors.
*
* A palette is useful for the ability to transform all the colors in it
* using a simple object-based approach. In addition, you can generate
* palettes using dojox.color.Palette.generate; these generated palettes
* are based on the palette generators at http://kuler.adobe.com.
*
* @param base
*/
interface Palette{(base: String): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/Palette.html
*
* An object that represents a palette of colors.
* A Palette is a representation of a set of colors. While the standard
* number of colors contained in a palette is 5, it can really handle any
* number of colors.
*
* A palette is useful for the ability to transform all the colors in it
* using a simple object-based approach. In addition, you can generate
* palettes using dojox.color.Palette.generate; these generated palettes
* are based on the palette generators at http://kuler.adobe.com.
*
* @param base
*/
interface Palette{(base: any[]): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/Palette.html
*
* An object that represents a palette of colors.
* A Palette is a representation of a set of colors. While the standard
* number of colors contained in a palette is 5, it can really handle any
* number of colors.
*
* A palette is useful for the ability to transform all the colors in it
* using a simple object-based approach. In addition, you can generate
* palettes using dojox.color.Palette.generate; these generated palettes
* are based on the palette generators at http://kuler.adobe.com.
*
* @param base
*/
interface Palette{(base: dojo._base.Color): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/Palette.html
*
* An object that represents a palette of colors.
* A Palette is a representation of a set of colors. While the standard
* number of colors contained in a palette is 5, it can really handle any
* number of colors.
*
* A palette is useful for the ability to transform all the colors in it
* using a simple object-based approach. In addition, you can generate
* palettes using dojox.color.Palette.generate; these generated palettes
* are based on the palette generators at http://kuler.adobe.com.
*
* @param base
*/
interface Palette{(base: dojox.color.Palette): void}
module Palette {
/**
*
*/
var generators: Object
/**
* Clones the current palette.
*
*/
interface clone{(): any}
/**
* Generate a new Palette using any of the named functions in
* dojox.color.Palette.generators or an optional function definition. Current
* generators include "analogous", "monochromatic", "triadic", "complementary",
* "splitComplementary", and "shades".
*
* @param base
* @param type
*/
interface generate{(base: String, type: Function): any}
/**
* Generate a new Palette using any of the named functions in
* dojox.color.Palette.generators or an optional function definition. Current
* generators include "analogous", "monochromatic", "triadic", "complementary",
* "splitComplementary", and "shades".
*
* @param base
* @param type
*/
interface generate { (base: dojo._base.Color, type: Function): any}
/**
* Generate a new Palette using any of the named functions in
* dojox.color.Palette.generators or an optional function definition. Current
* generators include "analogous", "monochromatic", "triadic", "complementary",
* "splitComplementary", and "shades".
*
* @param base
* @param type
*/
interface generate{(base: String, type: String): any}
/**
* Generate a new Palette using any of the named functions in
* dojox.color.Palette.generators or an optional function definition. Current
* generators include "analogous", "monochromatic", "triadic", "complementary",
* "splitComplementary", and "shades".
*
* @param base
* @param type
*/
interface generate { (base: dojo._base.Color, type: String): any}
/**
* Transform the palette using a specific transformation function
* and a set of transformation parameters.
* {palette}.transform is a simple way to uniformly transform
* all of the colors in a palette using any of 5 formulae:
* RGBA, HSL, HSV, CMYK or CMY.
*
* Once the forumula to be used is determined, you can pass any
* number of parameters based on the formula "d"[param]; for instance,
* { use: "rgba", dr: 20, dg: -50 } will take all of the colors in
* palette, add 20 to the R value and subtract 50 from the G value.
*
* Unlike other types of transformations, transform does not alter
* the original palette but will instead return a new one.
*
* @param kwArgs An object with the following properties:use (String, optional): Specify the color model to use for the transformation. Can be "rgb", "rgba", "hsv", "hsl", "cmy", "cmyk".dr (Number, optional): The delta to be applied to the red aspect of the RGB/RGBA color model.dg (Number, optional): The delta to be applied to the green aspect of the RGB/RGBA color model.db (Number, optional): The delta to be applied to the blue aspect of the RGB/RGBA color model.da (Number, optional): The delta to be applied to the alpha aspect of the RGBA color model.dc (Number, optional): The delta to be applied to the cyan aspect of the CMY/CMYK color model.dm (Number, optional): The delta to be applied to the magenta aspect of the CMY/CMYK color model.dy (Number, optional): The delta to be applied to the yellow aspect of the CMY/CMYK color model.dk (Number, optional): The delta to be applied to the black aspect of the CMYK color model.dh (Number, optional): The delta to be applied to the hue aspect of the HSL/HSV color model.ds (Number, optional): The delta to be applied to the saturation aspect of the HSL/HSV color model.dl (Number, optional): The delta to be applied to the luminosity aspect of the HSL color model.dv (Number, optional): The delta to be applied to the value aspect of the HSV color model.
*/
interface transform{(kwArgs: Object): any}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/Palette.generators.html
*
*
*/
interface generators {
/**
* Create a 5 color palette based on the analogous rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.high (Number, optional): The difference between the hue of the base color and the highest hue. In degrees, default is 60.low (Number, optional): The difference between the hue of the base color and the lowest hue. In degrees, default is 18.
*/
analogous(args: Object): any;
/**
* Create a 5 color palette based on the complementary rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.
*/
complementary(args: Object): any;
/**
* Create a 5 color palette based on the compound rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.
*/
compound(args: Object): any;
/**
* Create a 5 color palette based on the monochromatic rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.
*/
monochromatic(args: Object): any;
/**
* Create a 5 color palette based on the shades rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.
*/
shades(args: Object): any;
/**
* Create a 5 color palette based on the split complementary rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.da (Number, optional): The delta angle to be used to determine where the split for the complementary rules happen.In degrees, the default is 30.
*/
splitComplementary(args: Object): any;
/**
* Create a 5 color palette based on the triadic rules as implemented at
* http://kuler.adobe.com.
*
* @param args An object with the following properties:base (dojo/_base/Color): The base color to be used to generate the palette.
*/
triadic(args: Object): any;
}
}
module _base {
}
module api {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/color/api/ColorModel.html
*
* API for classes that implement a color model that returns a color from a data value.
*
*/
class ColorModel {
constructor();
/**
* return the color for a given data value.
*
* @param value The data value.
*/
getColor(value: number): void;
/**
* Optionally initialize the color model from a list of data items and using a function
* that returns the value used to compute the color for a given item.
*
* @param items The data items.
* @param colorFunc The function that returns the value used to compute the color for particular data item.
*/
initialize(items: Object[], colorFunc: Function): void;
}
}
}
}
+221
View File
@@ -0,0 +1,221 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module css3 {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/transit.html
*
* Performs a transition to hide a node and show another node.
* This module defines the transit method which is used
* to transit the specific region of an application from
* one view/page to another view/page. This module relies
* on utilities provided by dojox/css3/transition for the
* transition effects.
*
* @param from
* @param to
* @param options OptionalThe argument to specify the transit effect and direction.The effect can be specified in options.transition. Thevalid values are 'slide', 'flip', 'fade', 'none'.The direction can be specified in options.reverse. If itis true, the transit effects will be conducted in thereverse direction to the default direction. Finally the durationof the transition can be overridden by setting the duration property.
*/
interface transit{(from: HTMLElement, to: HTMLElement, options?: Object): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/transition.html
*
* This module defines the transition utilities which can be used
* to perform transition effects based on the CSS Transition standard.
*
* @param args OptionalThe arguments which will be mixed into this transition object.
*/
interface transition{(args?: Object): void}
module transition {
/**
*
*/
var autoClear: boolean
/**
*
*/
var deferred: Object
/**
*
*/
var direction: number
/**
*
*/
var duration: number
/**
*
*/
var endState: Object
/**
*
*/
var in_: boolean
/**
*
*/
var node: Object
/**
*
*/
var playing: Object
/**
*
*/
var startState: Object
/**
* The callback which will be called right after the end
* of the transition effect and before the final state is
* cleared.
*
*/
interface beforeClear{(): void}
/**
* The callback which will be called right before the start
* of the transition effect.
*
*/
interface beforeStart{(): void}
/**
* The method which plays multiple transitions one by one.
*
* @param args The array of transition objects which will be played in a chain.
*/
interface chainedPlay{(args: any[]): void}
/**
* Method to clear the state after a transition.
*
*/
interface clear{(): void}
/**
* Method which is used to create the transition object of fade effect.
*
* @param node The node that the fade transition effect will be applied on.
* @param config The cofig arguments which will be mixed into this transition object.
*/
interface fade{(node: any, config: any): void}
/**
* Method which is used to create the transition object of flip effect.
*
* @param node The node that the flip transition effect will be applied on.
* @param config The cofig arguments which will be mixed into this transition object.
*/
interface flip{(node: any, config: any): void}
/**
*
* @param nodes
*/
interface getWaitingList{(nodes: any[]): any}
/**
* The method which groups multiple transitions and plays
* them together.
*
* @param args The array of transition objects which will be played together.
*/
interface groupedPlay{(args: any[]): any}
/**
* Method to initialize the state for a transition.
*
*/
interface initState{(): void}
/**
* Plays the transition effect defined by this transition object.
*
*/
interface play{(): void}
/**
* Method which is used to create the transition object of a slide effect.
*
* @param node The node that the slide transition effect will be applied on.
* @param config The cofig arguments which will be mixed into this transition object.
*/
interface slide{(node: any, config: any): void}
/**
* Method to start the transition.
*
*/
interface start{(): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/transition.endState.html
*
*
*/
interface endState {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/transition.startState.html
*
*
*/
interface startState {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/transition.playing.html
*
*
*/
interface playing {
}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/css3/fx.html
*
* Utilities for animation effects.
*
*/
interface fx {
/**
* Returns an animation that does a "bounce" effect on args.node.
* Vertical bounce animation. The scaleX, scaleY deformation and the
* jump height (args.jumpHeight) can be specified.
*
* @param args
*/
bounce(args: Object): any;
/**
* Returns an animation that expands args.node.
* Scales an element to args.endScale.
*
* @param args
*/
expand(args: Object): any;
/**
* Returns an animation that flips an element around his y axis.
* Flips an element around his y axis. The default is a 360deg flip
* but it is possible to run a partial flip using args.whichAnims.
*
* @param args
*/
flip(args: Object): any;
/**
* Returns an animation that will do a "puff" effect on the given node.
* Fades out an element and scales it to args.endScale.
*
* @param args
*/
puff(args: Object): any;
/**
* Returns an animation that rotates an element.
* Rotates an element from args.startAngle to args.endAngle.
*
* @param args
*/
rotate(args: Object): any;
/**
* Returns an animation that shrinks args.node.
* Shrinks an element, same as expand({ node: node, endScale: .01 });
*
* @param args
*/
shrink(args: Object): any;
}
}
}
+6600
View File
File diff suppressed because one or more lines are too long
+1364
View File
File diff suppressed because it is too large Load Diff
+21991
View File
File diff suppressed because it is too large Load Diff
+321
View File
@@ -0,0 +1,321 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="dojo.d.ts" />
declare module dojox {
module dnd {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/dnd/BoundingBoxController.html
*
* Allows the user draw bounding boxes around nodes on the page.
* Publishes to the "/dojox/dnd/bounding" topic to tell the selector to check
* to see whether any dnd items fall within the coordinates of the bounding box
*
* @param sources an array of dojox.dnd.Selectors which need to be aware ofthe positioning of the bounding box.
* @param domNode the DOM node or id which represents the bounding box on the page.
*/
class BoundingBoxController {
constructor(sources: dojox.dnd.Selector[], domNode: String);
/**
* Override-able by the client as an extra check to ensure that a bounding
* box is viable. In some instances, it might not make sense that
* a mouse down -> mouse move -> mouse up interaction represents a bounding box.
* For example, if a dialog is open the client might want to suppress a bounding
* box. This function could be used by the client to ensure that a bounding box is only
* drawn on the document when certain conditions are met.
*
* @param evt the mouse event which caused this callback to fire.
*/
boundingBoxIsViable(evt: Object): boolean;
/**
* prepares this object to be garbage-collected
*
*/
destroy(): void;
/**
* Override-able by the client as an extra check to ensure that a bounding
* box should begin to be drawn. If the client has any preconditions to when a
* bounding box should be drawn, they should be included in this method.
*
* @param evt the mouse event which caused this callback to fire.
*/
shouldStartDrawingBox(evt: Object): boolean;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/dnd/Selector.html
*
*
* @param node node or node's id to build the selector on
* @param params Optionala dictionary of parameters
*/
class Selector extends dojo.dnd.Selector {
constructor(node: HTMLElement, params?: Object);
/**
* Indicates whether to allow dnd item nodes to be nested within other elements.
* By default this is false, indicating that only direct children of the container can
* be draggable dnd item nodes
*
*/
"allowNested": boolean;
/**
*
*/
"conservative": boolean;
/**
* The DOM node the mouse is currently hovered over
*
*/
"current": HTMLElement;
/**
* Map from an item's id (which is also the DOMNode's id) to
* the dojo/dnd/Container.Item itself.
*
*/
"map": Object;
/**
* The set of id's that are currently selected, such that this.selection[id] == 1
* if the node w/that id is selected. Can iterate over selected node's id's like:
*
* for(var id in this.selection)
*
*/
"selection": Object;
/**
*
*/
"singular": boolean;
/**
*
*/
"skipForm": boolean;
/**
* removes all data items from the map
*
*/
clearItems(): void;
/**
* creator function, dummy at the moment
*
*/
creator(): void;
/**
* deletes all selected items
*
*/
deleteSelectedNodes(): Function;
/**
* removes a data item from the map by its key (id)
*
* @param key
*/
delItem(key: String): void;
/**
* deselects a node
*
* @param node Node to deselect (id or DOM Node)
*/
deselectNode(node: String): Function;
/**
* deselects a node
*
* @param node Node to deselect (id or DOM Node)
*/
deselectNode(node: HTMLElement): Function;
/**
* prepares the object to be garbage-collected
*
*/
destroy(): void;
/**
*
* @param type
* @param event
*/
emit(type: any, event: any): any;
/**
* iterates over a data map skipping members that
* are present in the empty object (IE and/or 3rd-party libraries).
*
* @param f
* @param o Optional
*/
forInItems(f: Function, o: Object): String;
/**
* iterates over selected items;
* see dojo/dnd/Container.forInItems() for details
*
* @param f
* @param o Optional
*/
forInSelectedItems(f: Function, o: Object): void;
/**
* returns a list (an array) of all valid child nodes
*
*/
getAllNodes(): any;
/**
* returns a data item by its key (id)
*
* @param key
*/
getItem(key: String): any;
/**
* returns a list (an array) of selected nodes
*
*/
getSelectedNodes(): any;
/**
* inserts an array of new nodes before/after an anchor node
*
* @param data Logical representation of the object being dragged.If the drag object's type is "text" then data is a String,if it's another type then data could be a different Object,perhaps a name/value hash.
* @param before insert before the anchor, if true, and after the anchor otherwise
* @param anchor the anchor node to be used as a point of insertion
*/
insertNodes(data: Object, before: boolean, anchor: HTMLElement): Function;
/**
* inserts new data items (see dojo/dnd/Container.insertNodes() method for details)
*
* @param addSelected all new nodes will be added to selected items, if true, no selection change otherwise
* @param data a list of data items, which should be processed by the creator function
* @param before insert before the anchor, if true, and after the anchor otherwise
* @param anchor the anchor node to be used as a point of insertion
*/
insertNodes(addSelected: boolean, data: any[], before: boolean, anchor: HTMLElement): Function;
/**
* checks if node is selected
*
* @param node Node to check (id or DOM Node)
*/
isSelected(node: String): any;
/**
* checks if node is selected
*
* @param node Node to check (id or DOM Node)
*/
isSelected(node: HTMLElement): any;
/**
*
* @param params
* @param node
* @param Ctor
*/
markupFactory(params: any, node: any, Ctor: any): any;
/**
*
* @param type
* @param listener
*/
on(type: any, listener: any): any;
/**
* selects all items
*
*/
selectAll(): any;
/**
* selects nodes by bounding box
*
* @param left Left coordinate of the bounding box
* @param top Top coordinate of the bounding box
* @param right Right coordinate of the bounding box
* @param bottom Bottom coordinate of the bounding box
* @param add OptionalIf true, node is added to selection, otherwise currentselection is removed, and node will be the only selection.
*/
selectByBBox(left: number, top: number, right: number, bottom: number, add: boolean): Function;
/**
* selects a node
*
* @param node Node to select (id or DOM Node)
* @param add OptionalIf true, node is added to selection, otherwise currentselection is removed, and node will be the only selection.
*/
selectNode(node: String, add: boolean): Function;
/**
* selects a node
*
* @param node Node to select (id or DOM Node)
* @param add OptionalIf true, node is added to selection, otherwise currentselection is removed, and node will be the only selection.
*/
selectNode(node: HTMLElement, add: boolean): Function;
/**
* unselects all items
*
*/
selectNone(): any;
/**
* associates a data item with its key (id)
*
* @param key
* @param data
*/
setItem(key: String, data: any): void;
/**
* shifts the currently selected dnd item forwards and backwards.
* One possible use would be to allow a user select different
* dnd items using the right and left keys.
*
* @param toNext If true, we select the next node, otherwise the previous one.
* @param add OptionalIf true, add to selection, otherwise current selection isremoved before adding any nodes.
*/
shift(toNext: boolean, add: boolean): void;
/**
* collects valid child items and populate the map
*
*/
startup(): void;
/**
* sync up the node list with the data map
*
*/
sync(): Function;
/**
* event processor for onmousedown
*
* @param e mouse event
*/
onMouseDown(e: Event): void;
/**
* event processor for onmousemove
*
* @param e mouse event
*/
onMouseMove(e: Event): void;
/**
* event processor for onmouseout
*
* @param e mouse event
*/
onMouseOut(e: Event): void;
/**
* event processor for onmouseover or touch, to mark that element as the current element
*
* @param e mouse event
*/
onMouseOver(e: Event): void;
/**
* event processor for onmouseup
*
* @param e mouse event
*/
onMouseUp(e: Event): void;
/**
* this function is called once, when mouse is out of our container
*
*/
onOutEvent(): void;
/**
* this function is called once, when mouse is over our container
*
*/
onOverEvent(): void;
/**
* event processor for onselectevent and ondragevent
*
* @param e mouse event
*/
onSelectStart(e: Event): void;
}
}
}
+14198
View File
File diff suppressed because it is too large Load Diff
+4050
View File
File diff suppressed because it is too large Load Diff
+15305
View File
File diff suppressed because it is too large Load Diff
+1012
View File
File diff suppressed because it is too large Load Diff
+587
View File
@@ -0,0 +1,587 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module encoding {
module compression {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/compression/splay.html
*
*
* @param n
*/
interface splay{(n: any): void}
module splay {
/**
*
* @param stream
*/
interface decode{(stream: any): number}
/**
*
* @param value
* @param stream
*/
interface encode{(value: any, stream: any): any}
/**
*
*/
interface reset{(): void}
/**
*
* @param i
*/
interface splay{(i: any): void}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/compression/lzw.html
*
*
*/
interface lzw {
/**
*
* @param n
*/
Decoder(n: any): void;
/**
*
* @param n
*/
Encoder(n: any): void;
}
}
module crypto {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/RSAKey.html
*
*
* @param rngf
*/
class RSAKey {
constructor(rngf: any);
/**
* Return the PKCS#1 RSA decryption of "ctext".
*
* @param ctext an even-length hex string
*/
decrypt(ctext: String): any;
/**
*
* @param text
*/
encrypt(text: any): any;
/**
* Generate a new random private key B bits long, using public expt E
*
* @param B
* @param E
*/
generate(B: any, E: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
*/
setPrivate(N: any, E: any, D: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
* @param P
* @param Q
* @param DP
* @param DQ
* @param C
*/
setPrivateEx(N: any, E: any, D: any, P: any, Q: any, DP: any, DQ: any, C: any): void;
/**
* Set the public key fields N and e from hex strings
*
* @param N
* @param E
*/
setPublic(N: any, E: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/RSAKey-ext.html
*
*
* @param rngf
*/
class RSAKey_ext {
constructor(rngf: any);
/**
* Return the PKCS#1 RSA decryption of "ctext".
*
* @param ctext an even-length hex string
*/
decrypt(ctext: String): any;
/**
*
* @param text
*/
encrypt(text: any): any;
/**
* Generate a new random private key B bits long, using public expt E
*
* @param B
* @param E
*/
generate(B: any, E: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
*/
setPrivate(N: any, E: any, D: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
* @param P
* @param Q
* @param DP
* @param DQ
* @param C
*/
setPrivateEx(N: any, E: any, D: any, P: any, Q: any, DP: any, DQ: any, C: any): void;
/**
* Set the public key fields N and e from hex strings
*
* @param N
* @param E
*/
setPublic(N: any, E: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/_base.html
*
*
*/
interface _base {
/**
*
*/
Blowfish: Object;
/**
* Enumeration for various cipher modes.
*
*/
cipherModes: Object;
/**
* Enumeration for input and output encodings.
*
*/
outputTypes: Object;
/**
*
*/
SimpleAES: Object;
/**
*
*/
RSAKey(): void;
}
module _base {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/_base.RSAKey.html
*
*
* @param rngf
*/
class RSAKey {
constructor(rngf: any);
/**
* Return the PKCS#1 RSA decryption of "ctext".
*
* @param ctext an even-length hex string
*/
decrypt(ctext: String): any;
/**
*
* @param text
*/
encrypt(text: any): any;
/**
* Generate a new random private key B bits long, using public expt E
*
* @param B
* @param E
*/
generate(B: any, E: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
*/
setPrivate(N: any, E: any, D: any): void;
/**
* Set the private key fields N, e, d and CRT params from hex strings
*
* @param N
* @param E
* @param D
* @param P
* @param Q
* @param DP
* @param DQ
* @param C
*/
setPrivateEx(N: any, E: any, D: any, P: any, Q: any, DP: any, DQ: any, C: any): void;
/**
* Set the public key fields N and e from hex strings
*
* @param N
* @param E
*/
setPublic(N: any, E: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/_base.cipherModes.html
*
* Enumeration for various cipher modes.
*
*/
interface cipherModes {
/**
*
*/
CBC: number;
/**
*
*/
CFB: number;
/**
*
*/
CTR: number;
/**
*
*/
ECB: number;
/**
*
*/
OFB: number;
/**
*
*/
PCBC: number;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/crypto/_base.outputTypes.html
*
* Enumeration for input and output encodings.
*
*/
interface outputTypes {
/**
*
*/
Base64: number;
/**
*
*/
Hex: number;
/**
*
*/
Raw: number;
/**
*
*/
String: number;
}
}
}
module digests {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/SHA1.html
*
* Computes the SHA1 digest of the data, and returns the result according to output type.
*
* @param data
* @param outputType Optional
*/
interface SHA1{(data: String, outputType?: Object): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/MD5.html
*
* computes the digest of data, and returns the result according to type outputType
*
* @param data
* @param outputType Optional
*/
interface MD5{(data: String, outputType?: Object): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/SHA224.html
*
*
* @param data
* @param outputType Optional
*/
interface SHA224{(data: String, outputType?: number): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/SHA256.html
*
*
* @param data
* @param outputType Optional
*/
interface SHA256{(data: String, outputType?: number): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/SHA384.html
*
*
* @param data
* @param outputType Optional
*/
interface SHA384{(data: String, outputType?: number): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/SHA512.html
*
*
* @param data
* @param outputType Optional
*/
interface SHA512{(data: String, outputType?: number): void}
module _sha_32 {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/_base.html
*
*
*/
interface _base {
/**
* Enumeration for input and output encodings.
*
*/
outputTypes: Object;
/**
* add a pair of words together with rollover
*
* @param a
* @param b
*/
addWords(a: String, b: String): number;
/**
* computes the digest of data, and returns the result according to type outputType
*
* @param data
* @param outputType OptionalAn object with the following properties:Base64HexStringRaw
*/
MD5(data: String, outputType: Object): void;
/**
* Computes the SHA1 digest of the data, and returns the result according to output type.
*
* @param data
* @param outputType OptionalAn object with the following properties:Base64HexStringRaw
*/
SHA1(data: String, outputType: Object): void;
/**
*
* @param input
*/
stringToUtf8(input: any): void;
/**
* convert a string to a word array
*
* @param s
*/
stringToWord(s: String): any[];
/**
* convert an array of words to base64 encoding, should be more efficient
* than using dojox.encoding.base64
*
* @param wa
*/
wordToBase64(wa: String[]): void;
/**
* convert an array of words to a hex tab
*
* @param wa
*/
wordToHex(wa: String[]): void;
/**
* convert an array of words to a string
*
* @param wa
*/
wordToString(wa: String[]): void;
}
module _base {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/_base.outputTypes.html
*
* Enumeration for input and output encodings.
*
*/
interface outputTypes {
/**
*
*/
Base64: number;
/**
*
*/
Hex: number;
/**
*
*/
Raw: number;
/**
*
*/
String: number;
}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/digests/_sha-64.html
*
*
*/
interface _sha_64 {
/**
*
*/
outputTypes: Object;
/**
*
* @param msg
* @param length
* @param hash
* @param depth
*/
digest(msg: any, length: any, hash: any, depth: any): any[];
/**
*
* @param s
*/
stringToUtf8(s: any): any;
/**
*
* @param wa
*/
toBase64(wa: any): any;
/**
*
* @param wa
*/
toHex(wa: any): any;
/**
*
* @param s
*/
toWord(s: any): any;
}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/_base.html
*
*
*/
interface _base {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/bits.html
*
*
*/
interface bits {
/**
*
* @param buffer
* @param width
*/
InputStream(buffer: any, width: any): void;
/**
*
*/
OutputStream(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/ascii85.html
*
*
*/
interface ascii85 {
/**
* decodes the input string back to array of numbers
*
* @param input the input string to decode
*/
decode(input: String): void;
/**
* encodes input data in ascii85 string
*
* @param input an array of numbers (0-255) to encode
*/
encode(input: any[]): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/base64.html
*
*
*/
interface base64 {
/**
* Convert a base64-encoded string to an array of bytes
*
* @param str
*/
decode(str: String): void;
/**
* Encode an array of bytes as a base64-encoded string
*
* @param ba
*/
encode(ba: number[]): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/encoding/easy64.html
*
*
*/
interface easy64 {
/**
* decodes the input string back to array of numbers
*
* @param input the input string to decode
*/
decode(input: String): void;
/**
* encodes input data in easy64 string
*
* @param input an array of numbers (0-255) to encode
*/
encode(input: any[]): void;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/flash.html
*
* Deprecated. Should require dojox/flash modules directly rather than trying to access them through
* this module.
*
*/
interface flash {
}
module flash {
module _base {
}
}
}
+29059
View File
File diff suppressed because it is too large Load Diff
+2018
View File
File diff suppressed because it is too large Load Diff
+1083
View File
File diff suppressed because it is too large Load Diff
+21554
View File
File diff suppressed because it is too large Load Diff
+4724
View File
File diff suppressed because it is too large Load Diff
+101
View File
@@ -0,0 +1,101 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module gesture {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/gesture/Base.html
*
*
* @param args
*/
class Base {
constructor(args: any);
/**
* Default event e.g. 'tap' is a default event of dojox.gesture.tap
*
*/
"defaultEvent": string;
/**
* A list of sub events e.g ['hold', 'doubletap'],
* used by being combined with defaultEvent like 'tap.hold', 'tap.doubletap' etc.
*
*/
"subEvents": any[];
/**
* Whether the gesture is touch-device only
*
*/
"touchOnly": boolean;
/**
* Process the 'cancel' phase of a gesture
*
* @param data
* @param e
*/
cancel(data: any, e: any): void;
/**
* Release all handlers and resources
*
*/
destroy(): void;
/**
* Fire a gesture event and invoke registered listeners
* a simulated GestureEvent will also be sent along
*
* @param node Target node to fire the gesture
* @param event An object containing specific gesture info e.g {type: 'tap.hold'|'swipe.left'), ...}all these properties will be put into a simulated GestureEvent when fired.Note - Default properties in a native Event won't be overwritten, see on.emit() for more details.
*/
fire(node: HTMLElement, event: Object): void;
/**
* Initialization works
*
*/
init(): void;
/**
* Check if the node is locked, isLocked(node) means
* whether it's a descendant of the currently locked node.
*
* @param node
*/
isLocked(node: any): boolean;
/**
* Lock all descendants of the node.
*
* @param node
*/
lock(node: HTMLElement): void;
/**
* Process the 'move' phase of a gesture
*
* @param data
* @param e
*/
move(data: any, e: any): void;
/**
* Process the 'press' phase of a gesture
*
* @param data
* @param e
*/
press(data: any, e: any): void;
/**
* Process the 'release' phase of a gesture
*
* @param data
* @param e
*/
release(data: any, e: any): void;
/**
* Release the lock
*
*/
unLock(): void;
}
}
}
+11807
View File
File diff suppressed because it is too large Load Diff
+3237
View File
File diff suppressed because it is too large Load Diff
+26086
View File
File diff suppressed because it is too large Load Diff
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module help {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/help/_base.html
*
*
*/
interface _base {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/help/console.html
*
*
*/
interface console {
}
}
}
+2373
View File
File diff suppressed because it is too large Load Diff
+570
View File
@@ -0,0 +1,570 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html.html
*
* Deprecated. Should require dojox/html modules directly rather than trying to access them through
* this module.
*
*/
interface html {
}
module html {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/ellipsis.html
*
* offers cross-browser support for text-overflow: ellipsis
* Add "dojoxEllipsis" on any node that you want to ellipsis-ize. In order to function properly,
* the node with the dojoxEllipsis class set on it should be a child of a node with a defined width.
* It should also be a block-level element (i.e. <div>) - it will not work on td elements.
* NOTE: When using the dojoxEllipsis class within tables, the table needs to have the table-layout: fixed style
*
*/
interface ellipsis {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/entities.html
*
*
*/
interface entities {
/**
*
*/
html: any[];
/**
*
*/
latin: any[];
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding to decode.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the HTML and Latin entities as theset to map and decode.
*/
decode(str: any, m: any): void;
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the and Latin entities as theset to map and escape.
*/
encode(str: any, m: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/metrics.html
*
*
*/
interface metrics {
/**
*
* @param recalculate
*/
getCachedFontMeasurements(recalculate: any): any;
/**
* Returns an object that has pixel equivilents of standard font size values.
*
*/
getFontMeasurements(): Object;
/**
*
*/
getScrollbar(): Object;
/**
*
* @param text
* @param style
* @param className Optional
*/
getTextBox(text: String, style: Object, className: String): void;
/**
*
*/
initOnFontResize(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.html
*
*
*/
interface styles {
/**
*
*/
entities: Object;
/**
*
*/
"ext-dojo": Object;
/**
*
*/
metrics: Object;
/**
* Getter/Setter
* If passed a title, enables a that style sheet. All other
* toggle-able style sheets are disabled.
* If no argument is passed, returns currently enabled
* style sheet.
*
* @param title Optional
*/
activeStyleSheet(title: String): void;
/**
* Disables the dynamic style sheet with the name passed in the
* argument. If no arg is passed, defaults to the default style sheet.
*
* @param styleSheetName
*/
disableStyleSheet(styleSheetName: String): void;
/**
* Enables the style sheet with the name passed in the
* argument. Deafults to the default style sheet.
*
* @param styleSheetName
*/
enableStyleSheet(styleSheetName: String): void;
/**
* Creates and returns a dynamically created style sheet
* used for dynamic styles
*
* @param styleSheetName OptionalThe name given the style sheet so that multiplestyle sheets can be created and referenced. Ifno argument is given, the name "default" is used.
*/
getDynamicStyleSheet(styleSheetName: String): any;
/**
* Returns the style sheet that was initially enabled
* on document launch.
* TODO, does not work.
*
*/
getPreferredStyleSheet(): void;
/**
* Returns a style sheet based on the argument.
* Searches dynamic style sheets first. If no matches,
* searches document style sheets.
*
* @param styleSheetName OptionalA title or an href to a style sheet. Title can bean attribute in a tag, or a dynamic style sheetreference. Href can be the name of the file.If no argument, the assumed created dynamic stylesheet is used.
*/
getStyleSheet(styleSheetName: String): void;
/**
* Collects all the style sheets referenced in the HTML page,
* including any included via @import.
*
*/
getStyleSheets(): any;
/**
* Searches HTML for style sheets that are "toggle-able" -
* can be enabled and disabled. These would include sheets
* with the title attribute, as well as the REL attribute.
*
*/
getToggledStyleSheets(): any;
/**
* Creates a style and attaches it to a dynamically created stylesheet
*
* @param selector A fully qualified class name, as it would appear ina CSS dojo.doc. Start classes with periods, targetnodes with '#'. Large selectors can also be createdlike:"#myDiv.myClass span input"
* @param declaration A single string that would make up a style block, notincluding the curly braces. Include semi-colons betweenstatements. Do not use JavaScript style declarationsin camel case, use as you would in a CSS dojo.doc:"color:#ffoooo;font-size:12px;margin-left:5px;"
* @param styleSheetName OptionalName of the dynamic style sheet this rule should beinserted into. If is not found by that name, it iscreated. If no name is passed, the name "default" isused.
*/
insertCssRule(selector: String, declaration: String, styleSheetName: String): String;
/**
* Not implemented - it seems to have some merit for changing some complex
* selectors. It's not much use for changing simple ones like "span".
* For now, simply write a new rule which will cascade over the first.
*
* Modifies an existing cssRule
*
* @param selector
* @param declaration
* @param styleSheetName
*/
modifyCssRule(selector: any, declaration: any, styleSheetName: any): void;
/**
* Removes a cssRule base on the selector and declaration passed
* The declaration is needed for cases of dupe selectors
* Only removes DYNAMICALLY created cssRules. If you
* created it with dh.insertCssRule, it can be removed.
*
* @param selector
* @param declaration
* @param styleSheetName
*/
removeCssRule(selector: String, declaration: String, styleSheetName: String): void;
}
module styles {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles._ContentSetter.html
*
*
* @param params
* @param node
*/
class _ContentSetter {
constructor(params: Object, node: String);
/**
* Adjust relative paths in html string content to point to this page
* Only useful if you grab content from a another folder than the current one
*
*/
"adjustPaths": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of , wrapper before injection
*
*/
"cleanContent": boolean;
/**
* The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
*
*/
"content": string;
/**
*
*/
"executeScripts": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of <html> <body> wrapper before injection
*
*/
"extractContent": boolean;
/**
* Usually only used internally, and auto-generated with each instance
*
*/
"id": Object;
/**
* An node which will be the parent element that we set content into
*
*/
"node": HTMLElement;
/**
* Should the node by passed to the parser after the new content is set
*
*/
"parseContent": boolean;
/**
* Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
* will search for data-dojo-type (or dojoType). For backwards compatibility
* reasons defaults to dojo._scopeName (which is "dojo" except when
* multi-version support is used, when it will be something like dojo16, dojo20, etc.)
*
*/
"parserScope": string;
/**
*
*/
"referencePath": string;
/**
*
*/
"renderStyles": boolean;
/**
*
*/
"scriptHasHooks": boolean;
/**
*
*/
"scriptHookReplacement": Object;
/**
* Start the child widgets after parsing them. Only obeyed if parseContent is true.
*
*/
"startup": boolean;
/**
*
*/
empty(): void;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: String, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: HTMLElement, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: NodeList, params: Object): any;
/**
* sets the content on the node
*
*/
setContent(): void;
/**
*
*/
tearDown(): void;
/**
* Called after instantiation, but before set();
* It allows modification of any of the object properties - including the node and content
* provided - before the set operation actually takes place
* This implementation extends that of dojo.html._ContentSetter
* to add handling for adjustPaths, renderStyles on the html string content before it is set
*
*/
onBegin(): void;
/**
*
* @param err
*/
onContentError(err: any): String;
/**
* Called after set(), when the new content has been pushed into the node
* It provides an opportunity for post-processing before handing back the node to the caller
* This implementation extends that of dojo.html._ContentSetter
*
*/
onEnd(): any;
/**
*
* @param err
*/
onExecError(err: any): String;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.entities.html
*
*
*/
interface entities {
/**
*
*/
html: any[];
/**
*
*/
latin: any[];
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding to decode.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the HTML and Latin entities as theset to map and decode.
*/
decode(str: any, m: any): void;
/**
* Function to obtain an entity encoding for a specified character
*
* @param str The string to process for possible entity encoding.
* @param m An optional list of character to entity name mappings (array ofarrays). If not provided, it uses the and Latin entities as theset to map and escape.
*/
encode(str: any, m: any): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.ext-dojo.html
*
*
*/
interface ext_dojo {
/**
*
*/
style: Object;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/styles.metrics.html
*
*
*/
interface metrics {
/**
*
* @param recalculate
*/
getCachedFontMeasurements(recalculate: any): any;
/**
* Returns an object that has pixel equivilents of standard font size values.
*
*/
getFontMeasurements(): Object;
/**
*
*/
getScrollbar(): Object;
/**
*
* @param text
* @param style
* @param className Optional
*/
getTextBox(text: String, style: Object, className: String): void;
/**
*
*/
initOnFontResize(): void;
}
}
module _base {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/html/_base._ContentSetter.html
*
*
* @param params
* @param node
*/
class _ContentSetter {
constructor(params: Object, node: String);
/**
* Adjust relative paths in html string content to point to this page
* Only useful if you grab content from a another folder than the current one
*
*/
"adjustPaths": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of , wrapper before injection
*
*/
"cleanContent": boolean;
/**
* The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
*
*/
"content": string;
/**
*
*/
"executeScripts": boolean;
/**
* Should the content be treated as a full html document,
* and the real content stripped of <html> <body> wrapper before injection
*
*/
"extractContent": boolean;
/**
* Usually only used internally, and auto-generated with each instance
*
*/
"id": Object;
/**
* An node which will be the parent element that we set content into
*
*/
"node": HTMLElement;
/**
* Should the node by passed to the parser after the new content is set
*
*/
"parseContent": boolean;
/**
* Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
* will search for data-dojo-type (or dojoType). For backwards compatibility
* reasons defaults to dojo._scopeName (which is "dojo" except when
* multi-version support is used, when it will be something like dojo16, dojo20, etc.)
*
*/
"parserScope": string;
/**
*
*/
"referencePath": string;
/**
*
*/
"renderStyles": boolean;
/**
*
*/
"scriptHasHooks": boolean;
/**
*
*/
"scriptHookReplacement": Object;
/**
* Start the child widgets after parsing them. Only obeyed if parseContent is true.
*
*/
"startup": boolean;
/**
*
*/
empty(): void;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: String, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: HTMLElement, params: Object): any;
/**
* front-end to the set-content sequence
*
* @param cont OptionalAn html string, node or enumerable list of nodes for insertion into the domIf not provided, the object's content property will be used
* @param params Optional
*/
set(cont: NodeList, params: Object): any;
/**
* sets the content on the node
*
*/
setContent(): void;
/**
*
*/
tearDown(): void;
/**
* Called after instantiation, but before set();
* It allows modification of any of the object properties - including the node and content
* provided - before the set operation actually takes place
* This implementation extends that of dojo.html._ContentSetter
* to add handling for adjustPaths, renderStyles on the html string content before it is set
*
*/
onBegin(): void;
/**
*
* @param err
*/
onContentError(err: any): String;
/**
* Called after set(), when the new content has been pushed into the node
* It provides an opportunity for post-processing before handing back the node to the caller
* This implementation extends that of dojo.html._ContentSetter
*
*/
onEnd(): any;
/**
*
* @param err
*/
onExecError(err: any): String;
}
}
module ext_dojo {
module style {
}
}
module format {
}
}
}
+2762
View File
File diff suppressed because it is too large Load Diff
+244
View File
@@ -0,0 +1,244 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module io {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/httpParse.html
*
* Parses an HTTP stream for a message.
*
* @param httpStream HTTP stream to parse
* @param topHeaders OptionalExtra header information to add to each HTTP request (kind of HTTP inheritance)
* @param partial OptionalA true value indicates that the stream may not be finished, it may end arbitrarily in mid stream.The last XHR object will have a special property _lastIndex that indicates the how far alongthe httpStream could be successfully parsed into HTTP messages.
*/
interface httpParse { (httpStream: String, topHeaders?: String, partial?: boolean): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/xhrMultiPart.html
*
*
* @param args
*/
interface xhrMultiPart { (args: Object): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/xhrWindowNamePlugin.html
*
* Adds the windowName transport as an XHR plugin for the given site. See
* dojox.io.windowName for more information on the transport.
*
* @param url Url prefix of the site which can handle windowName requests.
* @param httpAdapter OptionalThis allows for adapting HTTP requests that could not otherwise besent with window.name, so you can use a convention for headers and PUT/DELETE methods.
* @param trusted Optional
*/
interface xhrWindowNamePlugin { (url: String, httpAdapter?: Function, trusted?: boolean): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/xhrScriptPlugin.html
*
* Adds the script transport (JSONP) as an XHR plugin for the given site. See
* dojox.io.script for more information on the transport. Note, that JSONP
* is not a secure transport, by loading data from a third-party site using JSONP
* the site has full access to your JavaScript environment.
*
* @param url Url prefix of the site which can handle JSONP requests.
* @param callbackParamName
* @param httpAdapter OptionalThis allows for adapting HTTP requests that could not otherwise besent with JSONP, so you can use a convention for headers and PUT/DELETE methods.
*/
interface xhrScriptPlugin { (url: String, callbackParamName: String, httpAdapter?: Function): void }
module proxy {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/proxy/xip.html
*
* Object that implements the iframe handling for XMLHttpRequest
* IFrame Proxying.
*
* Do not use this object directly. See the Dojo Book page
* on XMLHttpRequest IFrame Proxying:
* http://dojotoolkit.org/book/dojo-book-0-4/part-5-connecting-pieces/i-o/cross-domain-xmlhttprequest-using-iframe-proxy
* Usage of XHR IFrame Proxying does not work from local disk in Safari.
*
*/
interface xip {
/**
*
*/
urlLimit: number;
/**
*
*/
xipClientUrl: Object;
/**
*
*/
createFacade(): any;
/**
*
* @param stateId
*/
destroyState(stateId: String): void;
/**
*
* @param frag
*/
fragmentReceived(frag: any): void;
/**
* HTML5 document messaging endpoint. Unpack the event to see if we want to use it.
*
* @param evt
*/
fragmentReceivedEvent(evt: any): void;
/**
*
* @param stateId
*/
frameLoaded(stateId: String): void;
/**
*
* @param stateId
* @param cmd
* @param message
*/
makeServerUrl(stateId: any, cmd: any, message: any): String;
/**
*
* @param stateId
* @param urlEncodedData
*/
receive(stateId: String, urlEncodedData: String): void;
/**
* starts the xdomain request using the provided facade.
* This method first does some init work, then delegates to _realSend.
*
* @param facade
*/
send(facade: Object): any;
/**
*
* @param stateId
* @param encodedData
*/
sendRequest(stateId: any, encodedData: any): void;
/**
*
* @param stateId
*/
sendRequestPart(stateId: any): void;
/**
*
* @param stateId
*/
sendRequestStart(stateId: any): void;
/**
*
* @param stateId
* @param cmd
* @param message
*/
setServerUrl(stateId: any, cmd: any, message: any): void;
/**
*
* @param encodedMessage
*/
unpackMessage(encodedMessage: any): Object;
/**
* XMLHttpRequest facade object used by dojox.io.proxy.xip.
*
* Do not use this object directly. See the Dojo Book page
* on XMLHttpRequest IFrame Proxying:
* http://dojotoolkit.org/book/dojo-book-0-4/part-5-connecting-pieces/i-o/cross-domain-xmlhttprequest-using-iframe-proxy
*
* @param ifpServerUrl
*/
XhrIframeFacade(ifpServerUrl: any): void;
}
module xip {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/proxy/xip._state.html
*
*
*/
interface _state {
}
}
}
module xhrPlugins {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/scriptFrame.html
*
*
*/
interface scriptFrame {
}
module scriptFrame {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/scriptFrame._loadedIds.html
*
*
*/
interface _loadedIds {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/scriptFrame._waiters.html
*
*
*/
interface _waiters {
}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/io/windowName.html
*
*
*/
interface windowName {
/**
* Provides secure cross-domain request capability.
* Sends a request using an iframe (POST or GET) and reads the response through the
* frame's window.name.
* In order to provide a windowname transport accessible resources/web services, a server
* should check for the presence of a parameter window.name=true and if a request includes
* such a parameter, it should respond to the request with an HTML
* document that sets it's window.name to the string that is to be
* delivered to the client. For example, if a client makes a window.name request like:
*
* http://othersite.com/greeting?windowname=true
* And server wants to respond to the client with "Hello", it should return an html page:
*
* <html><script type="text/javascript">
* window.name="Hello";
* </script></html>
* One can provide XML or JSON data by simply quoting the data as a string, and parsing the data
*
* on the client.
* If you use the authorization window.name protocol, the requester should include an
* authElement element in the args, and a request will be created like:
*
* http://othersite.com/greeting?windowname=auth
* And the server can respond like this:
*
* <html><script type="text/javascript">
* var loc = window.name;
* authorizationButton.onclick = function(){
* window.name="Hello";
* location = loc;
* };
* </script></html>
* When using windowName from a XD Dojo build, make sure to set the
*
* dojo.dojoBlankHtmlUrl property to a local URL.
*
* @param method The method to use to send the request, GET or POST
* @param args See dojo.xhrargs.authElement: DOMNode?By providing an authElement, this indicates that windowName should use theauthorized window.name protocol, relying onthe loaded XD resource to return to the provided return URL on completionof authorization/authentication. The provided authElement will be used to placethe iframe in, so the user can interact with the server resource for authenticationand/or authorization to access the resource.args.onAuthLoad: Function?When using authorized access to resources, this function will be called when theauthorization page has been loaded. (When authorization is actually completed,the deferred callback function is called with the result). The primary use for thisis to make the authElement visible to the user once the resource has loaded(this can be preferable to showing the iframe while the resource is loadingsince it may not require authorization, it may simply return the resource).
*/
send(method: String, args: Object): any;
}
}
}
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/jq.html
*
*
*/
interface jq {
}
}
+132
View File
@@ -0,0 +1,132 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module json {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/json/query.html
*
* Performs a JSONQuery on the provided object and returns the results.
* If no object is provided (just a query), it returns a "compiled" function that evaluates objects
* according to the provided query.
* JSONQuery provides a comprehensive set of data querying tools including filtering,
* recursive search, sorting, mapping, range selection, and powerful expressions with
* wildcard string comparisons and various operators. JSONQuery generally supersets
* JSONPath and provides syntax that matches and behaves like JavaScript where
* possible.
*
* JSONQuery evaluations begin with the provided object, which can referenced with
* $. From
* the starting object, various operators can be successively applied, each operating
* on the result of the last operation.
*
* Supported Operators
* .property - This will return the provided property of the object, behaving exactly
* like JavaScript.
* [expression] - This returns the property name/index defined by the evaluation of
* the provided expression, behaving exactly like JavaScript.
* [?expression] - This will perform a filter operation on an array, returning all the
* items in an array that match the provided expression. This operator does not
* need to be in brackets, you can simply use ?expression, but since it does not
* have any containment, no operators can be used afterwards when used
* without brackets.
* [^?expression] - This will perform a distinct filter operation on an array. This behaves
* as [?expression] except that it will remove any duplicate values/objects from the
* result set.
* [/expression], [\expression], [/expression, /expression] - This performs a sort
* operation on an array, with sort based on the provide expression. Multiple comma delimited sort
* expressions can be provided for multiple sort orders (first being highest priority). /
* indicates ascending order and \ indicates descending order
* [=expression] - This performs a map operation on an array, creating a new array
* with each item being the evaluation of the expression for each item in the source array.
* [start:end:step] - This performs an array slice/range operation, returning the elements
* from the optional start index to the optional end index, stepping by the optional step number.
* [expr,expr] - This a union operator, returning an array of all the property/index values from
* the evaluation of the comma delimited expressions.
* . or [] - This returns the values of all the properties of the current object.
* $ - This is the root object, If a JSONQuery expression does not being with a $,
* it will be auto-inserted at the beginning.
* @ - This is the current object in filter, sort, and map expressions. This is generally
* not necessary, names are auto-converted to property references of the current object
* in expressions.
* ..property - Performs a recursive search for the given property name, returning
* an array of all values with such a property name in the current object and any subobjects
* expr = expr - Performs a comparison (like JS's ==). When comparing to
* a string, the comparison string may contain wildcards * (matches any number of
* characters) and ? (matches any single character).
* expr ~ expr - Performs a string comparison with case insensitivity.
* ..[?expression] - This will perform a deep search filter operation on all the objects and
* subobjects of the current data. Rather than only searching an array, this will search
* property values, arrays, and their children.
* $1,$2,$3, etc. - These are references to extra parameters passed to the query
* function or the evaluator function.
* +, -, /, *, &, |, %, (, ), <, >, <=, >=, != - These operators behave just as they do
* in JavaScript.
* dojox.json.query(queryString,object)
* and
*
* dojox.json.query(queryString)(object)
* always return identical results. The first one immediately evaluates, the second one returns a
*
* function that then evaluates the object.
*
* @param query Query string
* @param obj OptionalTarget of the JSONQuery
*/
interface query{(query: String, obj?: Object): void}
module schema {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/json/ref.html
*
* Adds advanced JSON {de}serialization capabilities to the base json library.
* This enhances the capabilities of dojo.toJson and dojo.fromJson,
* adding referencing support, date handling, and other extra format handling.
* On parsing, references are resolved. When references are made to
* ids/objects that have been loaded yet, the loader function will be set to
* _loadObject to denote a lazy loading (not loaded yet) object.
*
*/
interface ref {
/**
*
*/
refAttribute: string;
/**
*
*/
serializeFunctions: boolean;
/**
* evaluates the passed string-form of a JSON object.
*
* @param str a string literal of a JSON item, for instance:'{ "foo": [ "bar", 1, { "baz": "thud" } ] }'
* @param args OptionalSee resolveJson
*/
fromJson(str: String, args: Object): any;
/**
* Indexes and resolves references in the JSON object.
* A JSON Schema object that can be used to advise the handling of the JSON (defining ids, date properties, urls, etc)
*
* @param root The root object of the object graph to be processed
* @param args OptionalObject with additional arguments:The index parameter: This is the index object (map) to use to store an index of all the objects. If you are using inter-message referencing, you must provide the same object for each call.The defaultId parameter: This is the default id to use for the root object (if it doesn't define it's own id)The idPrefix parameter: This the prefix to use for the ids as they enter the index. This allows multiple tables to use ids (that might otherwise collide) that enter the same global index. idPrefix should be in the form "/Service/". For example, if the idPrefix is "/Table/", and object is encountered {id:"4",...}, this would go in the index as "/Table/4".The idAttribute parameter: This indicates what property is the identity property. This defaults to "id"The assignAbsoluteIds parameter: This indicates that the resolveJson should assign absolute ids (__id) as the objects are being parsed.The schemas parameter: This provides a map of schemas, from which prototypes can be retrievedThe loader parameter: This is a function that is called added to the reference objects that can't be resolved (lazy objects)
*/
resolveJson(root: Object, args: Object): any;
/**
* Create a JSON serialization of an object.
* This has support for referencing, including circular references, duplicate references, and out-of-message references
* id and path-based referencing is supported as well and is based on http://www.json.com/2007/10/19/json-referencing-proposal-and-library/.
*
* @param it an object to be serialized.
* @param prettyPrint Optionalif true, we indent objects and arrays to make the output prettier.The variable dojo.toJsonIndentStr is used as the indent string-- to use something other than the default (tab),change that variable before calling dojo.toJson().
* @param idPrefix OptionalThe prefix that has been used for the absolute ids
* @param indexSubObjects Optional
*/
toJson(it: Object, prettyPrint: boolean, idPrefix: Object, indexSubObjects: Object): any;
}
}
}
+31
View File
@@ -0,0 +1,31 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/jsonPath.html
*
* Deprecated. Should require dojox/jsonPath modules directly rather than trying to access them through
* this module.
*
*/
interface jsonPath {
}
module jsonPath {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/jsonPath/query.html
*
* Perform jsonPath query expr on javascript object or json string obj
*
* @param obj object || json string to perform query on
* @param expr jsonPath expression (string) to be evaluated
* @param arg {} special arguments.resultType: "VALUE"||"BOTH"||"PATH"} (defaults to value)evalType: "RESULT"||"ITEM"} (defaults to ?)
*/
interface query { (obj: Object, expr: String, arg: Object): void }
}
}
+12022
View File
File diff suppressed because it is too large Load Diff
+11435
View File
File diff suppressed because it is too large Load Diff
+2330
View File
File diff suppressed because it is too large Load Diff
+150
View File
@@ -0,0 +1,150 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math.html
*
* Deprecated. Should require dojox/math modules directly rather than trying to access them through
* this module.
*
*/
interface math {
}
module math {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/BigInteger.html
*
*
* @param a
* @param b
* @param c
*/
interface BigInteger{(a: any, b: any, c: any): void}
module BigInteger {
/**
*
* @param i
* @param x
* @param w
* @param j
* @param c
* @param n
*/
interface am{(i: any, x: any, w: any, j: any, c: any, n: any): number}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/BigInteger-ext.html
*
*
* @param a
* @param b
* @param c
*/
interface BigInteger_ext{(a: any, b: any, c: any): void}
module BigInteger_ext {
/**
*
* @param i
* @param x
* @param w
* @param j
* @param c
* @param n
*/
interface am{(i: any, x: any, w: any, j: any, c: any, n: any): number}
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/round.html
*
*
* @param v
* @param p
* @param m
*/
interface round{(v: any, p: any, m: any): void}
module _base {
}
module curves {
}
module matrix {
}
module random {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/random/prng4.html
*
*
*/
interface prng4{(): void}
module prng4 {
/**
*
*/
var size: number
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/random/Secure.html
*
* Super simple implementation of a random number generator,
* which relies on Math.random().
*
* @param prng function that returns an instance of PRNG (pseudo random number generator)with two methods: init(array) and next(). It should have a property "size"to indicate the required pool size.
* @param noEvents Optionalif false or absent, onclick and onkeypress event will be used to add"randomness", otherwise events will not be used.
*/
class Secure {
constructor(prng: Function, noEvents?: boolean);
/**
* Disconnects events, if any, preparing the object for GC.
*
*/
destroy(): void;
/**
* Fills in an array of bytes with random numbers
*
* @param byteArray array to be filled in with random numbers, only existingelements will be filled.
*/
nextBytes(byteArray: any[]): void;
/**
* Mix in the current time (w/milliseconds) into the pool
*
*/
seedTime(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/math/random/Simple.html
*
* Super simple implementation of a random number generator,
* which relies on Math.random().
*
*/
class Simple {
constructor();
/**
* Prepares the object for GC. (empty in this case)
*
*/
destroy(): void;
/**
* Fills in an array of bytes with random numbers
*
* @param byteArray array to be filled in with random numbers, only existingelements will be filled.
*/
nextBytes(byteArray: any[]): void;
}
}
module stats {
}
}
}
+999
View File
@@ -0,0 +1,999 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="dojo.d.ts" />
declare module dojox {
module mdnd {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/AreaManager.html
*
* Drag And Drop manager
*
*/
class AreaManager {
constructor();
/**
* CSS class enabled an area if areaClass is defined
*
*/
"areaClass": string;
/**
* Enable the refresh of registered areas on drag start.
*
*/
"autoRefresh": boolean;
/**
* CSS class enabled a drag handle.
*
*/
"dragHandleClass": string;
/**
* To add an item programmatically.
*
* @param area a node corresponding to the D&D Area
* @param node the node which has to be treated.
* @param index the place in the area
* @param notCheckParent
*/
addDragItem(area: HTMLElement, node: HTMLElement, index: number, notCheckParent: boolean): any;
/**
* Destroy the component.
*
*/
destroy(): void;
/**
* find the nearest target area according to coordinates.
* Coordinates are representing by an object : for example, {'x':10,'y':10}
*
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating the area size
*/
findCurrentIndexArea(coords: Object, size: Object): any;
/**
* Initialize the manager by calling the registerByClass method
*
*/
init(): void;
/**
* Search the right place to insert the dropIndicator and display the dropIndicator.
*
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
*/
placeDropIndicator(coords: Object, size: Object): any;
/**
* Register all Dnd Areas identified by the attribute areaClass :
* insert Dnd Areas using the specific sort of dropMode.
*
*/
registerByClass(): void;
/**
* To register Dnd Area : insert the DndArea using the specific sort of dropMode.
*
* @param area a DOM node corresponding to the Dnd Area
* @param notInitAreas if false or undefined, init the areas.
*/
registerByNode(area: HTMLElement, notInitAreas: boolean): void;
/**
* Delete a moveable item programmatically. The node is removed from the area.
*
* @param area A node corresponding to the DndArea.
* @param node The node which has to be treated.
*/
removeDragItem(area: HTMLElement, node: HTMLElement): any;
/**
* Unregister a D&D Area and its children into the AreaManager.
*
* @param area A node corresponding to the D&D Area.
*/
unregister(area: HTMLElement): any;
/**
* Occurs when the dojo.dnd.Moveable.onDrag is fired.
* Search the nearest target area and called the placeDropIndicator
*
* @param node The node which is dragged
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
* @param mousePosition coordinates of mouse
*/
onDrag(node: HTMLElement, coords: Object, size: Object, mousePosition: Object): void;
/**
* Optionally called by the getTargetArea method of TargetFinder class.
*
* @param coords coordinates of the dragged Node.
* @param size size of the dragged Node.
*/
onDragEnter(coords: Object, size: Object): void;
/**
* Optionally called by the getTargetArea method of TargetFinder class.
*
* @param coords coordinates of the dragged Node.
* @param size size of the dragged Node.
*/
onDragExit(coords: Object, size: Object): void;
/**
* Initialize the drag (see dojox.mdnd.Moveable.initOffsetDrag())
*
* @param node The node which is about to be dragged
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
*/
onDragStart(node: HTMLElement, coords: Object, size: Object): void;
/**
* Drop the dragged item where the dropIndicator is displayed.
*
* @param node The node which is about to be dropped
*/
onDrop(node: HTMLElement): void;
/**
* Cancel the drop.
* The dragNode returns into the source.
*
*/
onDropCancel(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/AutoScroll.html
*
* Activate scrolling while dragging a widget.
*
*/
class AutoScroll {
constructor();
/**
* default mouse move offset
*
*/
"interval": number;
/**
* Default mouse margin
*
*/
"marginMouse": number;
/**
*
*/
"recursiveTimer": number;
/**
* Check if an autoScroll have to be launched.
*
* @param e
*/
checkAutoScroll(e: Event): void;
/**
*
*/
destroy(): void;
/**
* Set the visible part of the window. Varies accordion to Navigator.
*
*/
getViewport(): void;
/**
*
*/
init(): void;
/**
* Set the hightest heigh and width authorized scroll.
*
*/
setAutoScrollMaxPage(): void;
/**
* set the node which is dragged
*
* @param node node to scroll
*/
setAutoScrollNode(node: HTMLElement): void;
/**
* Stop the autoscroll.
*
*/
stopAutoScroll(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/DropIndicator.html
*
* DropIndicator managment for DnD.
*
*/
class DropIndicator {
constructor();
/**
* the drop indicator node
*
*/
"node": HTMLElement;
/**
* destroy the dropIndicator
*
*/
destroy(): void;
/**
* Place the DropIndicator in the right place
*
* @param area the dnd targer area node
* @param nodeRef node where the dropIndicator have to be placed into the area
* @param size
*/
place(area: HTMLElement, nodeRef: HTMLElement, size: Object): any;
/**
* remove the DropIndicator (not destroy)
*
*/
remove(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/LazyManager.html
*
* This class allows to launch a drag and drop dojo on the fly.
*
*/
class LazyManager {
constructor();
/**
* cancel a drag and drop dojo on the fly.
*
*/
cancelDrag(): void;
/**
*
*/
destroy(): void;
/**
*
* @param draggedNode
*/
getItem(draggedNode: HTMLElement): Object;
/**
* launch a dojo drag and drop on the fly.
*
* @param e
* @param draggedNode Optional
*/
startDrag(e: Event, draggedNode: HTMLElement): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/Moveable.html
*
* Allow end-users to track a DOM node into the web page
*
* @param params Hash of parameters
* @param node The draggable node
*/
class Moveable {
constructor(params: Object, node: HTMLElement);
/**
* The user clicks on the handle, but the drag action will really begin
* if he tracks the main node to more than 3 pixels.
*
*/
"dragDistance": number;
/**
* The node on which the user clicks to drag the main node.
*
*/
"handle": HTMLElement;
/**
* A flag to control a drag action if a form element has been focused.
* If true, the drag action is not executed.
*
*/
"skip": boolean;
/**
* Delecte associated events
*
*/
destroy(): void;
/**
* Initialize the gap between main node coordinates and the clicked point.
* Call the onDragStart method.
*
* @param e A DOM event
*/
initOffsetDrag(e: Event): void;
/**
* identify the type of target node associated with a DOM event.
*
* @param e a DOM event
*/
isFormElement(e: Event): any;
/**
* Stub function.
* Notes : border box model for size value, margin box model for coordinates
*
* @param node a DOM node
* @param coords position of the main node (equals to css left/top properties)
* @param size an object encapsulating width and height values
* @param mousePosition coordiantes of mouse
*/
onDrag(node: HTMLElement, coords: Object, size: Object, mousePosition: Object): void;
/**
* Stub function
* Notes : Coordinates don't contain margins
*
* @param node a DOM node
*/
onDragEnd(node: HTMLElement): void;
/**
* Stub function.
* Notes : border box model
*
* @param node a DOM node
* @param coords absolute position of the main node
* @param size an object encapsulating width an height values
*/
onDragStart(node: HTMLElement, coords: Object, size: Object): void;
/**
* Occurs when the user moves the mouse after clicking on the
* handle.
* Determinate when the drag action will have to begin (see
* dragDistance).
*
* @param e A DOM event
*/
onFirstMove(e: Event): void;
/**
* Occurs when the user clicks on the handle node.
* Skip the drag action if a specific node is targeted.
* Listens to mouseup and mousemove events on to the HTML document.
*
* @param e a DOM event
*/
onMouseDown(e: Event): void;
/**
* Occurs when the user releases the mouse
* Calls the onDragEnd method.
*
* @param e a DOM event
*/
onMouseUp(e: Event): void;
/**
* Occurs when the user moves the mouse.
* Calls the onDrag method.
*
* @param e a DOM event
*/
onMove(e: Event): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/PureSource.html
*
* A Source Object, which can be used only as a DnD source.
* A Source can contained several dnd items.
* A dnd item is not a source.
*
* @param node Node or node's id to build the source on.
* @param params OptionalAny property of this class may be configured via the paramsobject which is mixed-in to the 'dojo.dnd.Source' instance.
*/
class PureSource extends dojo.dnd.Selector {
constructor(node: HTMLElement, params?: Object);
/**
* Indicates whether to allow dnd item nodes to be nested within other elements.
* By default this is false, indicating that only direct children of the container can
* be draggable dnd item nodes
*
*/
"allowNested": boolean;
/**
*
*/
"copyOnly": boolean;
/**
* The DOM node the mouse is currently hovered over
*
*/
"current": HTMLElement;
/**
*
*/
"generateText": boolean;
/**
*
*/
"horizontal": boolean;
/**
*
*/
"isSource": boolean;
/**
* Map from an item's id (which is also the DOMNode's id) to
* the dojo/dnd/Container.Item itself.
*
*/
"map": Object;
/**
* The set of id's that are currently selected, such that this.selection[id] == 1
* if the node w/that id is selected. Can iterate over selected node's id's like:
*
* for(var id in this.selection)
*
*/
"selection": Object;
/**
*
*/
"singular": boolean;
/**
*
*/
"skipForm": boolean;
/**
*
*/
"targetState": string;
/**
*
*/
"withHandles": boolean;
/**
* removes all data items from the map
*
*/
clearItems(): void;
/**
* Returns true, if we need to copy items, false to move.
* It is separated to be overwritten dynamically, if needed.
*
* @param keyPressed The "copy" was pressed.
*/
copyState(keyPressed: boolean): any;
/**
* creator function, dummy at the moment
*
*/
creator(): void;
/**
* deletes all selected items
*
*/
deleteSelectedNodes(): Function;
/**
* removes a data item from the map by its key (id)
*
* @param key
*/
delItem(key: String): void;
/**
* Prepares the object to be garbage-collected.
*
*/
destroy(): void;
/**
*
* @param type
* @param event
*/
emit(type: any, event: any): any;
/**
* iterates over a data map skipping members that
* are present in the empty object (IE and/or 3rd-party libraries).
*
* @param f
* @param o Optional
*/
forInItems(f: Function, o: Object): String;
/**
* iterates over selected items;
* see dojo/dnd/Container.forInItems() for details
*
* @param f
* @param o Optional
*/
forInSelectedItems(f: Function, o: Object): void;
/**
* returns a list (an array) of all valid child nodes
*
*/
getAllNodes(): any;
/**
* returns a data item by its key (id)
*
* @param key
*/
getItem(key: String): any;
/**
* returns a list (an array) of selected nodes
*
*/
getSelectedNodes(): any;
/**
* inserts an array of new nodes before/after an anchor node
*
* @param data Logical representation of the object being dragged.If the drag object's type is "text" then data is a String,if it's another type then data could be a different Object,perhaps a name/value hash.
* @param before insert before the anchor, if true, and after the anchor otherwise
* @param anchor the anchor node to be used as a point of insertion
*/
insertNodes(data: Object, before: boolean, anchor: HTMLElement): Function;
/**
* inserts new data items (see dojo/dnd/Container.insertNodes() method for details)
*
* @param addSelected all new nodes will be added to selected items, if true, no selection change otherwise
* @param data a list of data items, which should be processed by the creator function
* @param before insert before the anchor, if true, and after the anchor otherwise
* @param anchor the anchor node to be used as a point of insertion
*/
insertNodes(addSelected: boolean, data: any[], before: boolean, anchor: HTMLElement): Function;
/**
* Markup methods.
*
* @param params ???
* @param node ???
*/
markupFactory(params: Object, node: HTMLElement): any;
/**
*
* @param type
* @param listener
*/
on(type: any, listener: any): any;
/**
* selects all items
*
*/
selectAll(): any;
/**
* unselects all items
*
*/
selectNone(): any;
/**
* associates a data item with its key (id)
*
* @param key
* @param data
*/
setItem(key: String, data: any): void;
/**
* collects valid child items and populate the map
*
*/
startup(): void;
/**
* sync up the node list with the data map
*
*/
sync(): Function;
/**
* Topic event processor for /dnd/cancel, called to cancel the Dnd
* operation.
*
*/
onDndCancel(): void;
/**
* Event processor for onmousedown.
*
* @param e Mouse event.
*/
onMouseDown(e: Event): void;
/**
* Event processor for onmousemove.
*
* @param e Mouse event.
*/
onMouseMove(e: Event): void;
/**
* event processor for onmouseout
*
* @param e mouse event
*/
onMouseOut(e: Event): void;
/**
* event processor for onmouseover or touch, to mark that element as the current element
*
* @param e mouse event
*/
onMouseOver(e: Event): void;
/**
* Event processor for onmouseup.
*
* @param e Mouse event
*/
onMouseUp(e: Event): void;
/**
* Called once, when mouse is out our container.
*
*/
onOutEvent(): void;
/**
* Called once, when mouse is over our container.
*
*/
onOverEvent(): void;
/**
* event processor for onselectevent and ondragevent
*
* @param e mouse event
*/
onSelectStart(e: Event): void;
}
module adapter {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/adapter/DndFromDojo.html
*
* Allow communication between Dojo dnd items and DojoX D&D areas
*
*/
class DndFromDojo {
constructor();
/**
* size by default of dropIndicator (display only into a D&D Area)
*
*/
"dropIndicatorSize": Object;
/**
* Check if a dragNode is accepted into a dojo target.
*
* @param node The dragged node.
* @param accept Object containing the type accepted for a target dojo.
*/
isAccepted(node: HTMLElement, accept: Object): any;
/**
* Subscribe to somes topics of dojo drag and drop.
*
*/
subscribeDnd(): void;
/**
* Unsubscribe to some topics of dojo drag and drop.
*
*/
unsubscribeDnd(): void;
/**
* Called when the mouse enters or exits of a source dojo.
*
* @param source the dojo source/target
*/
onDndSource(source: Object): void;
/**
* Occurs when the user drages an DOJO dnd item inside a D&D dojoX area.
*
*/
onDragEnter(): void;
/**
* Occurs when the user leaves a D&D dojoX area after dragging an DOJO dnd item over it.
*
*/
onDragExit(): void;
/**
* Occurs when the "/dnd/start" topic is published.
*
* @param source the source which provides items
* @param nodes the list of transferred items
* @param copy copy items, if true, move items otherwise
*/
onDragStart(source: Object, nodes: any[], copy: boolean): void;
/**
* Occurs when the user leaves a D&D dojox area after dragging an DOJO dnd item over it.
*
* @param source the source which provides items
* @param nodes the list of transferred items
* @param copy copy items, if true, move items otherwise
*/
onDrop(source: Object, nodes: any[], copy: boolean): void;
/**
* Occurs when the "/dnd/cancel" topic is published.
*
*/
onDropCancel(): void;
/**
* Occurs when the user moves the mouse.
*
* @param e the DOM event
*/
onMouseMove(e: Event): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/adapter/DndToDojo.html
*
* Allow communication between an item of dojox D&D area to a target dojo.
*
*/
class DndToDojo {
constructor();
/**
* Return true if the dragged node is accepted.
* This method has to be overwritten according to registered target.
*
* @param draggedNode
* @param target
*/
isAccepted(draggedNode: HTMLElement, target: Object): boolean;
/**
* Refresh the coordinates of all registered dojo target.
*
*/
refresh(): void;
/**
* Refresh the coordinates of registered dojo target with a specific type.
*
* @param type A String to identify dojo targets.
*/
refreshByType(type: String): void;
/**
* Register a target dojo.
* The target is represented by an object containing :
*
* the dojo area node
* the type reference to identify a group node
* the coords of the area to enable refresh position
*
* @param area The DOM node which has to be registered.
* @param type A String to identify the node.
* @param dojoTarget True if the dojo D&D have to be enable when mouse is hover the registered target dojo.
*/
register(area: HTMLElement, type: String, dojoTarget: boolean): void;
/**
* Unregister all targets dojo.
*
*/
unregister(): void;
/**
* Unregister a target dojo.
*
* @param area The DOM node of target dojo.
*/
unregisterByNode(area: HTMLElement): void;
/**
* Unregister several targets dojo having the same type passing in parameter.
*
* @param type A String to identify dojo targets.
*/
unregisterByType(type: String): void;
/**
* Call when the mouse enters in a registered dojo target.
*
* @param e The current Javascript Event.
*/
onDragEnter(e: Event): void;
/**
* Call when the mouse exit of a registered dojo target.
*
* @param e current javscript event
*/
onDragExit(e: Event): void;
/**
* Called when an onmouseup event is loaded on a registered target dojo.
*
* @param e Event object.
*/
onDrop(e: Event): void;
/**
* Call when the mouse moving after an onStartDrag of AreaManger.
* Check if the coordinates of the mouse is in a dojo target.
*
* @param e Event object.
*/
onMouseMove(e: Event): void;
}
}
module dropMode {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/dropMode/DefaultDropMode.html
*
* Enabled a type of calcul for Dnd.
* Default class to find the nearest target.
*
*/
class DefaultDropMode {
constructor();
/**
* Add a DnD Area into an array sorting by the x position.
*
* @param areas array of areas
* @param object data type of a DndArea
*/
addArea(areas: any[], object: Object): any;
/**
*
*/
destroy(): void;
/**
* return coordinates of the draggable item
* return for:
*
* X point : the middle
* Y point : search if the user goes up or goes down with his mouse.
* Up : top of the draggable item
* Down : bottom of the draggable item
*
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
* @param mousePosition coordinates of mouse
*/
getDragPoint(coords: Object, size: Object, mousePosition: Object): any;
/**
* Return the index where the drop has to be placed.
*
* @param targetArea a DnD area object
* @param coords coordinates [x,y] of the draggable item
*/
getDropIndex(targetArea: Object, coords: Object): any;
/**
* get the nearest DnD area.
* Coordinates are basically provided by the getDragPoint method.
*
* @param areaList a list of DnD areas objects
* @param coords coordinates [x,y] of the dragItem
* @param currentIndexArea an index representing the active DnD area
*/
getTargetArea(areaList: any[], coords: Object, currentIndexArea: number): any;
/**
* initialize the horizontal line in order to determinate the drop zone.
*
* @param area the DnD area
*/
initItems(area: Object): void;
/**
* take into account the drop indicator DOM element in order to compute horizontal lines
*
* @param area a DnD area object
* @param indexItem index of a draggable item
* @param size dropIndicator size
* @param added boolean to know if a dropIndicator has been added or deleted
*/
refreshItems(area: Object, indexItem: number, size: Object, added: boolean): void;
/**
* Refresh intervals between areas to determinate the nearest area to drop an item.
* Algorithm :
* the marker should be the vertical line passing by the
* central point between two contiguous areas.
* Note:
* If the page has only one targetArea, it's not necessary to calculate coords.
*
* @param areaList array of areas
*/
updateAreas(areaList: any[]): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/dropMode/OverDropMode.html
*
* Default class to find the nearest target only if the mouse is over an area.
*
*/
class OverDropMode {
constructor();
/**
* Add a D&D Area into an array sorting by the x position.
*
* @param areas array of areas
* @param object data type of a DndArea
*/
addArea(areas: any[], object: Object): any;
/**
*
*/
destroy(): void;
/**
* return coordinates of the draggable item.
*
* For X point : the x position of mouse
* For Y point : the y position of mouse
*
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
* @param mousePosition coordinates of mouse
*/
getDragPoint(coords: Object, size: Object, mousePosition: Object): any;
/**
* Return the index where the drop has to be placed.
*
* @param targetArea a D&D area object.
* @param coords coordinates [x,y] of the draggable item.
*/
getDropIndex(targetArea: Object, coords: Object): any;
/**
* get the nearest D&D area.
*
* @param areaList a list of D&D areas objects
* @param coords coordinates [x,y] of the dragItem (see getDragPoint())
* @param currentIndexArea an index representing the active D&D area
*/
getTargetArea(areaList: any[], coords: Object, currentIndexArea: number): any;
/**
* initialize the horizontal line in order to determinate the drop zone.
*
* @param area the D&D area.
*/
initItems(area: Object): void;
/**
* take into account the drop indicator DOM element in order to compute horizontal lines
*
* @param area a D&D area object
* @param indexItem index of a draggable item
* @param size dropIndicator size
* @param added boolean to know if a dropIndicator has been added or deleted
*/
refreshItems(area: Object, indexItem: number, size: Object, added: boolean): void;
/**
* refresh areas position and size to determinate the nearest area to drop an item
* the area position (and size) is equal to the postion of the domNode associated.
*
* @param areaList array of areas
*/
updateAreas(areaList: any[]): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/mdnd/dropMode/VerticalDropMode.html
*
* Enabled a type of calcul for Dnd.
* Default class to find the nearest target.
*
*/
class VerticalDropMode {
constructor();
/**
* Add a DnD Area into an array sorting by the x position.
*
* @param areas array of areas
* @param object data type of a DndArea
*/
addArea(areas: any[], object: Object): any;
/**
*
*/
destroy(): void;
/**
* return coordinates of the draggable item
* return for:
*
* X point : the middle
* Y point : search if the user goes up or goes down with his mouse.
* Up : top of the draggable item
* Down : bottom of the draggable item
*
* @param coords an object encapsulating X and Y position
* @param size an object encapsulating width and height values
* @param mousePosition coordinates of mouse
*/
getDragPoint(coords: Object, size: Object, mousePosition: Object): any;
/**
* Return the index where the drop has to be placed.
*
* @param targetArea a DnD area object
* @param coords coordinates [x,y] of the draggable item
*/
getDropIndex(targetArea: Object, coords: Object): any;
/**
* get the nearest DnD area.
* Coordinates are basically provided by the getDragPoint method.
*
* @param areaList a list of DnD areas objects
* @param coords coordinates [x,y] of the dragItem
* @param currentIndexArea an index representing the active DnD area
*/
getTargetArea(areaList: any[], coords: Object, currentIndexArea: number): any;
/**
* initialize the horizontal line in order to determinate the drop zone.
*
* @param area the DnD area
*/
initItems(area: Object): void;
/**
* take into account the drop indicator DOM element in order to compute horizontal lines
*
* @param area a DnD area object
* @param indexItem index of a draggable item
* @param size dropIndicator size
* @param added boolean to know if a dropIndicator has been added or deleted
*/
refreshItems(area: Object, indexItem: number, size: Object, added: boolean): void;
/**
* Refresh intervals between areas to determinate the nearest area to drop an item.
* Algorithm :
* the marker should be the vertical line passing by the
* central point between two contiguous areas.
* Note:
* If the page has only one targetArea, it's not necessary to calculate coords.
*
* @param areaList array of areas
*/
updateAreas(areaList: any[]): void;
}
}
}
}
+60718
View File
File diff suppressed because it is too large Load Diff
+21505
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rails.html
*
*
*/
interface rails {
/**
*
* @param selector
* @param evtName
* @param fn
*/
live(selector: any, evtName: any, fn: any): void;
}
}
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module robot {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/robot/recorder.html
*
*
*/
interface recorder {
}
}
}
+269
View File
@@ -0,0 +1,269 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="dojo.d.ts" />
declare module dojox {
module rpc {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/Rest.html
*
* This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE.
* A normal GET query is done by using the service directly:
*
* var restService = dojox.rpc.Rest("Project");
* restService("4");
* This will do a GET for the URL "/Project/4".
*
* restService.put("4","new content");
* This will do a PUT to the URL "/Project/4" with the content of "new content".
*
* You can also use the SMD service to generate a REST service:
*
* var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",...
* services.myRestService("parameters");
* The modifying methods can be called as sub-methods of the rest service method like:
*
* services.myRestService.put("parameters","data to put in resource");
* services.myRestService.post("parameters","data to post to the resource");
* services.myRestService['delete']("parameters");
*
* @param path
* @param isJson Optional
* @param schema Optional
* @param getRequest Optional
*/
interface Rest{(path: String, isJson?: boolean, schema?: Object, getRequest?: Function): void}
module Rest {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/Rest._index.html
*
*
*/
interface _index {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/Rest._timeStamps.html
*
*
*/
interface _timeStamps {
}
}
module Client {
}
module JsonRPC {
}
module ProxiedPath {
}
module Service {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/OfflineRest.html
*
* Makes the REST service be able to store changes in local
* storage so it can be used offline automatically.
*
*/
interface OfflineRest {
/**
*
*/
stores: any[];
/**
* Adds a store to the monitored store for local storage
*
* @param store Store to add
* @param baseQuery OptionalThis is the base query to should be used to load the items forthe store. Generally you want to load all the items that should beavailable when offline.
*/
addStore(store: dojo.data.api.Read, baseQuery: String): void;
/**
*
*/
downloadChanges(): void;
/**
*
*/
sendChanges(): void;
/**
*
*/
sync(): void;
/**
*
*/
turnOffAutoSync(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/JsonRest.html
*
*
*/
interface JsonRest {
/**
*
*/
conflictDateHeader: string;
/**
*
*/
schemas: Object;
/**
*
*/
services: Object;
/**
*
* @param service
* @param id
*/
byId(service: any, id: any): any;
/**
* adds an object to the list of dirty objects. This object
* contains a reference to the object itself as well as a
* cloned and trimmed version of old object for use with
* revert.
*
* @param object
* @param _deleting
*/
changing(object: any, _deleting: any): void;
/**
* Saves the dirty data using REST Ajax methods
*
* @param kwArgs
*/
commit(kwArgs: any): any[];
/**
* deletes an object
*
* @param object object to delete
*/
deleteObject(object: any): void;
/**
* Fetches a resource by an absolute path/id and returns a dojo.Deferred.
*
* @param absoluteId
*/
fetch(absoluteId: any): any;
/**
* Creates or gets a constructor for objects from this service
*
* @param service
* @param schema
*/
getConstructor(service: Function, schema: any): any;
/**
* Creates or gets a constructor for objects from this service
*
* @param service
* @param schema
*/
getConstructor(service: String, schema: any): any;
/**
*
*/
getDirtyObjects(): any[];
/**
* Return the ids attribute used by this service (based on it's schema).
* Defaults to "id", if not other id is defined
*
* @param service
*/
getIdAttribute(service: any): String;
/**
* Returns the REST service and the local id for the given absolute id. The result
* is returned as an object with a service property and an id property
*
* @param absoluteId This is the absolute id of the object
*/
getServiceAndId(absoluteId: String): Object;
/**
* returns true if the item is marked as dirty or true if there are any dirty items
*
* @param item
* @param store
*/
isDirty(item: any, store: any): any;
/**
*
* @param service
* @param id
* @param args
*/
query(service: any, id: any, args: any): any;
/**
* Registers a service for as a JsonRest service, mapping it to a path and schema
*
* @param service This is the service to register
* @param servicePath This is the path that is used for all the ids for the objects returned by service
* @param schema OptionalThis is a JSON Schema object to associate with objects returned by this service
*/
registerService(service: Function, servicePath: String, schema: Object): void;
/**
* Reverts all the changes made to JSON/REST data
*
* @param service
*/
revert(service: any): void;
/**
*
* @param actions
* @param kwArgs
*/
sendToServer(actions: any, kwArgs: any): void;
/**
* This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE.
* A normal GET query is done by using the service directly:
*
* var restService = dojox.rpc.Rest("Project");
* restService("4");
* This will do a GET for the URL "/Project/4".
*
* restService.put("4","new content");
* This will do a PUT to the URL "/Project/4" with the content of "new content".
*
* You can also use the SMD service to generate a REST service:
*
* var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",...
* services.myRestService("parameters");
* The modifying methods can be called as sub-methods of the rest service method like:
*
* services.myRestService.put("parameters","data to put in resource");
* services.myRestService.post("parameters","data to post to the resource");
* services.myRestService['delete']("parameters");
*
* @param path
* @param isJson Optional
* @param schema Optional
* @param getRequest Optional
*/
serviceClass(path: String, isJson: boolean, schema: Object, getRequest: Function): Function;
}
module JsonRest {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/JsonRest.services.html
*
*
*/
interface services {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/rpc/JsonRest.schemas.html
*
*
*/
interface schemas {
}
}
}
}
+59
View File
@@ -0,0 +1,59 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module secure {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/secure/DOM.html
*
*
* @param element
*/
interface DOM{(element: any): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/secure/sandbox.html
*
* Creates a secure sandbox from which scripts and HTML can be loaded that
* will only be able to access the provided element and it's descendants, the
* rest of the DOM and JS environment will not be accessible to the sandboxed
* scripts and HTML.
* This function will create and return a sandbox object (see dojox.secure.__Sandbox)
* for the provided element.
*
* @param element The DOM element to use as the container for the sandbox
*/
interface sandbox{(element: any): void}
module fromJson {
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/secure/capability.html
*
*
*/
interface capability {
/**
*
*/
keywords: any[];
/**
* pass in the text of a script. If it passes and it can be eval'ed, it should be safe.
* Note that this does not do full syntax checking, it relies on eval to reject invalid scripts.
* There are also known false rejections:
*
* Nesting vars inside blocks will not declare the variable for the outer block
* Named functions are not treated as declaration so they are generally not allowed unless the name is declared with a var.
* Var declaration that involve multiple comma delimited variable assignments are not accepted
*
* @param script the script to execute
* @param safeLibraries The safe libraries that can be called (the functions can not be access/modified by the untrusted code, only called)
* @param safeGlobals These globals can be freely interacted with by the untrusted code
*/
validate(script: String, safeLibraries: any[], safeGlobals: Object): void;
}
}
}
+1823
View File
File diff suppressed because it is too large Load Diff
+52
View File
@@ -0,0 +1,52 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/socket.html
*
* Provides a simple socket connection using WebSocket, or alternate
* communication mechanisms in legacy browsers for comet-style communication. This is based
* on the WebSocket API and returns an object that implements the WebSocket interface:
* http://dev.w3.org/html5/websockets/#websocket
* Provides socket connections. This can be used with virtually any Comet protocol.
*
* @param argsOrUrl This uses the same arguments as the other I/O functions in Dojo, or aURL to connect to. The URL should be a relative URL in order to properlywork with WebSockets (it can still be host relative, like //other-site.org/endpoint)
*/
interface socket{(argsOrUrl: Object): void}
module socket {
/**
* Provides a simple long-poll based comet-style socket/connection to a server and returns an
* object implementing the WebSocket interface:
* http://dev.w3.org/html5/websockets/#websocket
*
* @param args This uses the same arguments as the other I/O functions in Dojo, with this addition:args.interval:Indicates the amount of time (in milliseconds) after a response was receivedbefore another request is made. By default, a request is made immediatelyafter getting a response. The interval can be increased to reduce load on theserver or to do simple time-based polling where the server always respondsimmediately.args.transport:Provide an alternate transport like dojo.io.script.get
*/
interface LongPoll{(args: Object): any}
/**
*
* @param socket
* @param newSocket
* @param listenForOpen
*/
interface replace{(socket: any, newSocket: any, listenForOpen: any): void}
/**
* A wrapper for WebSocket, than handles standard args and relative URLs
*
* @param args
* @param fallback
*/
interface WebSocket{(args: any, fallback: any): void}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/socket/Reconnect.html
*
* Provides auto-reconnection to a websocket after it has been closed
*
* @param socket Socket to add reconnection support to.
* @param options
*/
interface Reconnect{(socket: any, options: any): void}
}
}
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/sql.html
*
* Deprecated. Should require dojox/sql modules directly rather than trying to access them through
* this module.
*
*/
interface sql {
}
module sql {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/sql/_crypto.html
*
*
*/
interface _crypto {
}
module _base {
}
}
}
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/storage.html
*
*
*/
interface storage {
}
}
+271
View File
@@ -0,0 +1,271 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module string_ {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/string/sprintf.html
*
*
* @param format
* @param filler
*/
interface sprintf { (format: String, filler: any): void }
module sprintf {
/**
*
* @param format
*/
interface Formatter { (format: String): void }
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/string/Builder.html
*
* A fast buffer for creating large strings.
*
* @param str Optional
*/
interface Builder { (str?: String): void }
module Builder {
/**
*
*/
var length: number
/**
* Append all arguments to the end of the buffer
*
* @param s
*/
interface append { (s: String[]): void }
/**
* Append an array of items to the internal buffer.
*
* @param strings
*/
interface appendArray { (strings: any[]): void }
/**
* Remove all characters from the buffer.
*
*/
interface clear { (): void }
/**
* Alias for append.
*
* @param s
*/
interface concat { (s: String[]): void }
/**
* Insert string str starting at index.
*
* @param index
* @param str
*/
interface insert { (index: number, str: String): void }
/**
* Remove len characters starting at index start. If len
* is not provided, the end of the string is assumed.
*
* @param start
* @param len Optional
*/
interface remove { (start: number, len: number): void }
/**
* Replace instances of one string with another in the buffer.
*
* @param oldStr
* @param newStr
*/
interface replace { (oldStr: String, newStr: String): void }
/**
* Return the string representation of the internal buffer.
*
*/
interface toString { (): void }
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/string/tokenize.html
*
* Split a string by a regular expression with the ability to capture the delimeters
*
* @param str
* @param re
* @param parseDelim OptionalEach group (excluding the 0 group) is passed as a parameter. If the function returnsa value, it's added to the list of tokens.
* @param instance OptionalUsed as the "this" instance when calling parseDelim
*/
interface tokenize { (str: String, re: RegExp, parseDelim?: Function, instance?: Object): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/string/BidiEngine.html
*
* This class provides a bidi transformation engine, i.e.
* functions for reordering and shaping bidi text.
* Bidi stands for support for languages with a bidirectional script.
*
* Usually Unicode Bidi Algorithm used by OS platform (and web browsers) is capable of properly transforming
* Bidi text and as a result it is adequately displayed on the screen. However, in some situations,
* Unicode Bidi Algorithm is not invoked or is not properly applied. This may occur in situation in which software
* responsible for rendering the text is not leveraging Unicode Bidi Algorithm implemented by OS (e.g. dojox.GFX renderers).
*
* Bidi engine provided in this class implements Unicode Bidi Algorithm as specified at
* http://www.unicode.org/reports/tr9/.
*
* For more information on basic Bidi concepts please read
* "Bidirectional script support - A primer" available from
* http://www.ibm.com/developerworks/websphere/library/techarticles/bidi/bidigen.html.
*
* As of February 2011, Bidi engine has following limitations:
*
* No support for following numeric shaping options:
* H - Hindi,
* C - Contextual,
* N - Nominal.
*
* No support for following shaping options:
* I - Initial shaping,
* M - Middle shaping,
* F - Final shaping,
* B - Isolated shaping.
*
* No support for source-to-target or/and target-to-source maps.
* No support for LRE/RLE/LRO/RLO/PDF (they are handled like neutrals).
* No support for Windows compatibility.
* No support for insert/remove marks.
* No support for code pages (currently only UTF-8 is supported. Ideally we should convert from any code page to UTF-8).
*
*/
class BidiEngine {
constructor();
/**
* Central public API for Bidi engine. Transforms the text according to formatIn, formatOut parameters.
* If formatIn or formatOut parametrs are not valid throws an exception.
* Both formatIn and formatOut parameters are 5 letters long strings.
* For example - "ILYNN". Each letter is associated with specific attribute of Bidi layout.
* Possible and default values for each one of the letters are provided below:
*
* First letter:
*
* Letter position/index:
* 1
* Letter meaning:
* Ordering Schema.
* Possible values:
* I - Implicit (Logical).
* V - Visual.
*
* Default value:
* I
* Second letter:
*
* Letter position/index:
* 2
* Letter meaning:
* Orientation.
* Possible values:
* L - Left To Right.
* R - Right To Left.
* C - Contextual Left to Right.
* D - Contextual Right to Left.
*
* Default value:
* L
* Third letter:
*
* Letter position/index:
* 3
* Letter meaning:
* Symmetric Swapping.
* Possible values:
* Y - Symmetric swapping is on.
* N - Symmetric swapping is off.
*
* Default value:
* Y
* Fourth letter:
*
* Letter position/index:
* 4
* Letter meaning:
* Shaping.
* Possible values:
* S - Text is shaped.
* N - Text is not shaped.
*
* Default value:
* N
* Fifth letter:
*
* Letter position/index:
* 5
* Letter meaning:
* Numeric Shaping.
* Possible values:
* N - Nominal.
*
* Default value:
* N
* The output of this function is original text (passed via first argument) transformed from input Bidi layout (second argument)
* to output Bidi layout (last argument).
*
* Sample call:
*
* mytext = bidiTransform("HELLO WORLD", "ILYNN", "VLYNN");
* In this case, "HELLO WORLD" text is transformed from Logical - LTR to Visual - LTR Bidi layout with
*
* default values for symmetric swapping (Yes), shaping (Not shaped) and numeric shaping (Nominal).
*
* @param text
* @param formatIn Input Bidi layout in which inputText is passed to the function.
* @param formatOut Output Bidi layout to which inputText should be transformed.
*/
bidiTransform(text: String, formatIn: String, formatOut: String): any;
/**
* Determine the base direction of a bidi text according
* to its first strong directional character.
*
* @param text The text to check.
*/
checkContextual(text: String): any;
/**
* Return true if text contains RTL directed character.
* Iterates over the text string, letter by letter starting from its beginning,
* searching for RTL directed character.
* Return true if found else false. Needed for vml transformation.
*
* @param text The source string.
*/
hasBidiChar(text: String): any;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/string/BidiComplex.html
*
*
*/
interface BidiComplex {
/**
* Attach key listeners to the INPUT field to accomodate dynamic complex BiDi expressions
*
* @param field
* @param pattern
*/
attachInput(field: HTMLElement, pattern: String): void;
/**
* Create the display string by adding the Unicode direction Markers
*
* @param str
* @param pattern
*/
createDisplayString(str: String, pattern: String): void;
/**
* removes all Unicode directional markers from the string
*
* @param str
*/
stripSpecialCharacters(str: any): void;
}
}
}
+82
View File
@@ -0,0 +1,82 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module testing {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/testing/DocTest.html
*
* This class executes doctests.
* DocTests are tests that are defined inside the comment.
* A doctest looks as if it was copied from the shell (which it mostly is).
* A doctest is executed when the following conditions match:
* 1) all lines are comments
* 2) the line always starts with spaces/tabs followed by "//"
* and at least one space
* 3) the line(s) of the test to execute starts with ">>>"
* preceeded by what is described in 2)
* 4) the first line after 3) starting without ">>>" is the exptected result.
* preceeded by what is described in 2)
* 5) the test sequence is terminated by an empty line, or the next
* test in the following line, or a new line that does not start as described in 2)
* (simple said: is not a comment)
* preceeded by what is described in 2)
*
* I.e. the following is a simple doctest, that will actually also be run
* if you run this class against this file here:
*
*
* 1+1 // A simple test case. Terminated by an empty line
* 2
*
* 1==2
* false
* "a"+"b" // Also without the empty line before, this is a new test.
* "ab"
*
* var anything = "anything" // Multiple commands for one test.
* "something"==anything
* false
*
*
* DocTests are great for inline documenting a class or method, they also
* are very helpful in understanding what the class/method actually does.
* They don't make sense everywhere, but sometimes they are really handy.
*
*/
class DocTest {
constructor();
/**
*
*/
"errors": any[];
/**
* Extract the tests from the given module or string.
*
* @param moduleName
*/
getTests(moduleName: String): any;
/**
*
* @param data
*/
getTestsFromString(data: String): any;
/**
* Run the doctests in the module given.
*
* @param moduleName
*/
run(moduleName: any): void;
/**
*
* @param commands
* @param expected
*/
runTest(commands: any, expected: any): Object;
}
}
}
+106
View File
@@ -0,0 +1,106 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/timing.html
*
* Deprecated. Should require dojox/timing modules directly rather than trying to access them through
* this module.
*
*/
interface timing {
}
module timing {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/timing/Sequence.html
*
* This class provides functionality to really sequentialize
* function calls. You need to provide a list of functions and
* some parameters for each (like: pauseBefore) and they will
* be run one after another. This can be very useful for slideshows
* or alike things.
* This array will contain the sequence defines resolved, so that
* ie. repeat:10 will result in 10 elements in the sequence, so
* the repeat handling is easier and we don't need to handle that
* many extra cases. Also the doneFunction, if given is added at the
* end of the resolved-sequences.
*
*/
class Sequence {
constructor();
/**
* Run the passed sequence definition
*
* @param defs The sequence of actions
* @param doneFunction OptionalThe function to call when done
*/
go(defs: any[], doneFunction: Function): void;
/**
* Run the passed sequence definition
*
* @param defs The sequence of actions
* @param doneFunction OptionalThe function to call when done
*/
go(defs: any[], doneFunction: any[]): void;
/**
* This method just provides a hook from the outside, so that
* an interrupted sequence can be continued.
*
*/
goOn(): void;
/**
* Stop the currently running sequence.
* This can only interrupt the sequence not the last function that
* had been started. If the last function was i.e. a slideshow
* that is handled inside a function that you have given as
* one sequence item it cant be stopped, since it is not controlled
* by this object here. In this case it would be smarter to
* run the slideshow using a sequence object so you can also stop
* it using this method.
*
*/
stop(): void;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/timing/doLater.html
*
* Check if a parameter is ready, and if not,
* "do later". doLater will ping the parameter
* until it evaluates to something (truthy).
* It thens calls the caller with original
* arguments, using the supplied context or
* window.
* dojox.timing.doLater(conditional) is testing if the call
* should be done later. So it returns
* true if the param is false.
*
* @param conditional Can be a property that eventually gets set, oran expression, method... anything that can beevaluated.
* @param context OptionalThe namespace where the call originated.Defaults to global and anonymous functions
* @param interval OptionalPoll time to check conditional in Milliseconds
*/
interface doLater { (conditional: any, context?: Object, interval?: number): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/timing/Streamer.html
*
* Streamer will take an input function that pushes N datapoints into a
* queue, and will pass the next point in that queue out to an
* output function at the passed interval; this way you can emulate
* a constant buffered stream of data.
*
* @param input the function executed when the internal queue reaches minimumSize
* @param output the function executed on internal tick
* @param interval the interval in ms at which the output function is fired.
* @param minimum the minimum number of elements in the internal queue.
* @param initialData
*/
interface Streamer { (input: Function, output: Function, interval: number, minimum: number, initialData: any[]): void }
module _base {
}
}
}
+1107
View File
File diff suppressed because it is too large Load Diff
+224
View File
@@ -0,0 +1,224 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid.html
*
* Deprecated. Should require dojox/uuid modules directly rather than trying to access them through
* this module.
*
*/
interface uuid {
}
module uuid {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid/generateRandomUuid.html
*
* This function generates random UUIDs, meaning "version 4" UUIDs.
* A typical generated value would be something like this:
* "3b12f1df-5232-4804-897e-917bf397618a"
*
* For more information about random UUIDs, see sections 4.4 and
* 4.5 of RFC 4122: http://tools.ietf.org/html/rfc4122#section-4.4
*
* This generator function is designed to be small and fast,
* but not necessarily good.
*
* Small: This generator has a small footprint. Once comments are
* stripped, it's only about 25 lines of code, and it doesn't
* dojo.require() any other modules.
*
* Fast: This generator can generate lots of new UUIDs fairly quickly
* (at least, more quickly than the other dojo UUID generators).
*
* Not necessarily good: We use Math.random() as our source
* of randomness, which may or may not provide much randomness.
*
*/
interface generateRandomUuid { (): void }
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid/generateTimeBasedUuid.html
*
* This function generates time-based UUIDs, meaning "version 1" UUIDs.
* For more info, see
* http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt
* http://www.infonuovo.com/dma/csdocs/sketch/instidid.htm
* http://kruithof.xs4all.nl/uuid/uuidgen
* http://www.opengroup.org/onlinepubs/009629399/apdxa.htm#tagcjh_20
* http://jakarta.apache.org/commons/sandbox/id/apidocs/org/apache/commons/id/uuid/clock/Clock.html
*
* @param node OptionalA 12-character hex string representing either a pseudo-node orhardware-node (an IEEE 802.3 network node). A hardware-nodewill be something like "017bf397618a", always with the first bitbeing 0. A pseudo-node will be something like "f17bf397618a",always with the first bit being 1.
*/
interface generateTimeBasedUuid { (node?: String): void }
module generateTimeBasedUuid {
/**
* Returns the 'node' value that will be included in generated UUIDs.
*
*/
interface getNode { (): void }
/**
*
* @param node Optional
*/
interface isValidNode { (node: String): void }
/**
* Sets the 'node' value that will be included in generated UUIDs.
*
* @param node Optional
*/
interface setNode { (node: String): void }
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid/Uuid.html
*
* This is the constructor for the Uuid class. The Uuid class offers
* methods for inspecting existing UUIDs.
*
* @param input Optional
*/
interface Uuid { (input?: String): void }
module Uuid {
/**
* Compares this UUID to another UUID, and returns 0, 1, or -1.
* This implementation is intended to match the sample implementation
* in IETF RFC 4122: http://www.ietf.org/rfc/rfc4122.txt
*
* @param otherUuid
*/
interface compare { (otherUuid: dojox.uuid.Uuid): void }
/**
* Given two UUIDs to compare, this method returns 0, 1, or -1.
* This method is designed to be used by sorting routines, like the
* JavaScript built-in Array sort() method. This implementation is
* intended to match the sample implementation in IETF RFC 4122:
* http://www.ietf.org/rfc/rfc4122.txt
*
* @param uuidOne
* @param uuidTwo
*/
interface compare { (uuidOne: dojox.uuid.Uuid, uuidTwo: dojox.uuid.Uuid): void }
/**
* Returns the default generator. See setGenerator().
*
*/
interface getGenerator { (): void }
/**
* If this is a version 1 UUID (a time-based UUID), getNode() returns a
* 12-character string with the "node" or "pseudonode" portion of the UUID,
* which is the rightmost 12 characters.
*
*/
interface getNode { (): void }
/**
* If this is a version 1 UUID (a time-based UUID), this method returns
* the timestamp value encoded in the UUID. The caller can ask for the
* timestamp to be returned either as a JavaScript Date object or as a
* 15-character string of hex digits.
*
* @param returnType Optional
*/
interface getTimestamp { (returnType: String): any }
/**
* Returns a variant code that indicates what type of UUID this is.
* Returns one of the enumerated dojox.uuid.variant values.
*
*/
interface getVariant { (): void }
/**
* Returns a version number that indicates what type of UUID this is.
* Returns one of the enumerated dojox.uuid.version values.
*
*/
interface getVersion { (): void }
/**
* Returns true if this UUID is equal to the otherUuid, or false otherwise.
*
* @param otherUuid
*/
interface isEqual { (otherUuid: dojox.uuid.Uuid): void }
/**
* Returns true if the UUID was initialized with a valid value.
*
*/
interface isValid { (): void }
/**
* Sets the default generator, which will be used by the
* "new dojox.uuid.Uuid()" constructor if no parameters
* are passed in.
*
* @param generator Optional
*/
interface setGenerator { (generator: Function): void }
/**
* This method returns a standard 36-character string representing
* the UUID, such as "3b12f1df-5232-4804-897e-917bf397618a".
*
*/
interface toString { (): void }
}
module _base {
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid/_base.variant.html
*
*
*/
interface variant {
/**
*
*/
DCE: string;
/**
*
*/
MICROSOFT: string;
/**
*
*/
NCS: string;
/**
*
*/
UNKNOWN: string;
}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojox/uuid/_base.version.html
*
*
*/
interface version {
/**
*
*/
DCE_SECURITY: number;
/**
*
*/
NAME_BASED_MD5: number;
/**
*
*/
NAME_BASED_SHA1: number;
/**
*
*/
RANDOM: number;
/**
*
*/
TIME_BASED: number;
/**
*
*/
UNKNOWN: number;
}
}
}
}
+1306
View File
File diff suppressed because it is too large Load Diff
+30673
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for Dojo v1.9
// Project: http://dojotoolkit.org
// Definitions by: Michael Van Sickle <https://github.com/vansimke>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module dojox {
module xml {
module parser {
}
module Script {
}
module widgetParser {
}
}
}