##// END OF EJS Templates
created typings for basic part of dojo and dijit further work is required to...
cin -
r2:8ec37bf1b4d1 default
parent child
Show More
@@ -0,0 +1,107
1 import DropDownButton = require("./form/DropDownButton");
2 import _Widget = require("./_Widget");
3 import _TemplatedMixin = require("./_TemplatedMixin");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5 import { CSSStateNodes, _CssStateMixin } from "./_CssStateMixin";
6 import { _MonthWidgetConstructor, CalendarLite } from "./CalendarLite";
7
8 interface _MonthDropDownButton extends DropDownButton<_MonthDropDown> {
9 onMonthSelect(): void;
10 postCreate(): void;
11
12 set(name: 'month', value: number): this;
13 set(name: string, value: any): this;
14 set(values: Object): this;
15 }
16
17 type _MonthDropDownButtonConstructor = _WidgetBaseConstructor<_MonthDropDownButton>;
18
19 interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin {
20 months: string[];
21 baseClass: string;
22 templateString: string;
23
24 /**
25 * Callback when month is selected from drop down
26 */
27 onChange(month: number): void;
28
29 set(name: 'months', value: string[]): this;
30 set(name: string, value: any): this;
31 set(values: Object): this;
32 }
33
34 type _MonthDropDownConstructor = _WidgetBaseConstructor<_MonthDropDown>;
35
36 interface Calendar extends CalendarLite, _Widget, _CssStateMixin {
37
38 baseClass: string;
39
40 /**
41 * Set node classes for various mouse events, see dijit._CssStateMixin for more details
42 */
43 cssStateNodes: CSSStateNodes;
44
45 /**
46 * Creates the drop down button that displays the current month and lets user pick a new one
47 */
48 _createMonthWidget(): _MonthDropDownButton;
49
50 postCreate(): void;
51
52 /**
53 * Handler for when user selects a month from the drop down list
54 */
55 _onMonthSelect(newMonth: number): void;
56
57 /**
58 * Handler for mouse over events on days, sets hovered style
59 */
60 _onDayMouseOver(evt: MouseEvent): void;
61
62 /**
63 * Handler for mouse out events on days, clears hovered style
64 */
65 _onDayMouseOut(evt: MouseEvent): void;
66 _onDayMouseDown(evt: MouseEvent): void;
67 _onDayMouseUp(evt: MouseEvent): void;
68
69 /**
70 * Provides keyboard navigation of calendar.
71 */
72 handleKey(evt: KeyboardEvent): void;
73
74 /**
75 * For handling keydown events on a stand alone calendar
76 */
77 _onKeyDown(evt: KeyboardEvent): void;
78
79 /**
80 * Deprecated. Notification that a date cell was selected. It may be the same as the previous value.
81 */
82 onValueSelected(date: Date): void;
83
84 onChange(date: Date): void;
85
86 /**
87 * May be overridden to return CSS classes to associate with the date entry for the given dateObject
88 * for example to indicate a holiday in specified locale.
89 */
90 getClassForDate(dateObject: Date, locale?: string): string;
91
92 get(name: 'value'): Date;
93 get(name: string): any;
94
95 set(name: 'value', value: number | Date): this;
96 set(name: string, value: any): this;
97 set(values: Object): this;
98 }
99
100 interface CalendarConstructor extends _WidgetBaseConstructor<Calendar> {
101 _MonthWidget: _MonthWidgetConstructor;
102 _MonthDropDown: _MonthDropDownButtonConstructor;
103 _MonthDropDownButton: _MonthDropDownButtonConstructor;
104 }
105
106 declare const Calendar: CalendarConstructor;
107 export = Calendar;
@@ -0,0 +1,181
1 import _WidgetBase = require("./_WidgetBase");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3 import _TemplatedMixin = require("./_TemplatedMixin");
4
5 declare namespace CalendarLite {
6 interface _MonthWidget extends _WidgetBase {
7 set(name: 'month', value: Date): this;
8 set(name: string, value: any): this;
9 set(values: Object): this;
10 }
11
12 type _MonthWidgetConstructor = _WidgetBaseConstructor<_MonthWidget>;
13
14 interface CalendarLite extends _WidgetBase, _TemplatedMixin {
15 /**
16 * Template for main calendar
17 */
18 templateString: string;
19
20 /**
21 * Template for cell for a day of the week (ex: M)
22 */
23 dowTemplateString: string;
24
25 dateTemplateString: string;
26 weekTemplateString: string;
27
28 /**
29 * The currently selected Date, initially set to invalid date to indicate no selection.
30 */
31 value: Date;
32
33 /**
34 * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines
35 * at dojo/date and dojo/date/locale.
36 */
37 datePackage: string;
38
39 /**
40 * How to represent the days of the week in the calendar header. See locale
41 */
42 dayWidth: string;
43
44 /**
45 * Order fields are traversed when user hits the tab key
46 */
47 tabIndex: string;
48
49 /**
50 * (Optional) The first day of week override. By default the first day of week is determined
51 * for the current locale (extracted from the CLDR).
52 * Special value -1 (default value), means use locale dependent value.
53 */
54 dayOffset: number;
55
56 /**
57 * Date object containing the currently focused date, or the date which would be focused
58 * if the calendar itself was focused. Also indicates which year and month to display,
59 * i.e. the current "page" the calendar is on.
60 */
61 currentFocus: Date;
62
63 /**
64 * Put the summary to the node with role=grid
65 */
66 _setSummaryAttr: string;
67
68 baseClass: string;
69
70 /**
71 * Runs various tests on the value, checking that it's a valid date, rather
72 * than blank or NaN.
73 */
74 _isValidDate(value: Date): boolean;
75
76 /**
77 * Convert Number into Date, or copy Date object. Then, round to nearest day,
78 * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366)
79 */
80 _patchDate(value: number | Date): Date;
81
82 /**
83 * This just sets the content of node to the specified text.
84 * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434.
85 */
86 _setText(node: HTMLElement, text?: string): void;
87
88 /**
89 * Fills in the calendar grid with each day (1-31).
90 * Call this on creation, when moving to a new month.
91 */
92 _populateGrid(): void;
93
94 /**
95 * Fill in localized month, and prev/current/next years
96 */
97 _populateControls(): void;
98
99 /**
100 * Sets calendar's value to today's date
101 */
102 goToToday(): void;
103
104 /**
105 * Creates the drop down button that displays the current month and lets user pick a new one
106 */
107 _createMonthWidget(): void;
108
109 buildRendering(): void;
110 postCreate(): void;
111
112 /**
113 * Set up connects for increment/decrement of months/years
114 */
115 _connectControls(): void;
116
117 /**
118 * If the calendar currently has focus, then focuses specified date,
119 * changing the currently displayed month/year if necessary.
120 * If the calendar doesn't have focus, updates currently
121 * displayed month/year, and sets the cell that will get focus
122 * when Calendar is focused.
123 */
124 _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void;
125
126 /**
127 * Focus the calendar by focusing one of the calendar cells
128 */
129 focus(): void;
130
131 /**
132 * Handler for day clicks, selects the date if appropriate
133 */
134 _onDayClick(evt: MouseEvent): void;
135
136 /**
137 * Returns the cell corresponding to the date, or null if the date is not within the currently
138 * displayed month.
139 */
140 _getNodeByDate(value: Date): HTMLElement;
141
142 /**
143 * Marks the specified cells as selected, and clears cells previously marked as selected.
144 * For CalendarLite at most one cell is selected at any point, but this allows an array
145 * for easy subclassing.
146 */
147 _markSelectedDates(dates: Date[]): void;
148
149 /**
150 * Called only when the selected date has changed
151 */
152 onChange(date: Date): void;
153
154 /**
155 * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
156 */
157 isDisabledDate(dateObject: Date, locale?: string): boolean;
158
159 /**
160 * May be overridden to return CSS classes to associate with the date entry for the given dateObject,
161 * for example to indicate a holiday in specified locale.
162 */
163 getClassForDate(dateObject: Date, locale?: string): string;
164
165 get(name: 'value'): Date;
166 get(name: string): any;
167
168 set(name: 'value', value: number | Date): this;
169 set(name: string, value: any): this;
170 set(values: Object): this;
171 }
172
173 interface CalendarLiteConstructor extends _WidgetBaseConstructor<CalendarLite> {
174 _MonthWidget: _MonthWidgetConstructor;
175 }
176
177 }
178
179 declare type CalendarLite = CalendarLite.CalendarLite;
180 declare const CalendarLite: CalendarLite.CalendarLiteConstructor;
181 export = CalendarLite;
@@ -0,0 +1,8
1 import { _ConfirmDialogMixin } from "./_ConfirmDialogMixin";
2 import { DialogConstructor } from "./Dialog";
3
4 interface ConfirmDialog extends _ConfirmDialogMixin { }
5
6 type ConfirmDialogConstructor = DialogConstructor;
7 declare const ConfirmDialog: ConfirmDialogConstructor;
8 export = ConfirmDialog;
@@ -0,0 +1,24
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 interface Destroyable {
4 _destroyed?: true;
5
6 /**
7 * Destroy this class, releasing any resources registered via own().
8 */
9 destroy(preserveDom?: boolean): void;
10
11 /**
12 * Track specified handles and remove/destroy them when this instance is destroyed, unless they were
13 * already removed/destroyed manually.
14 */
15 own(...args: any[]): any[];
16 }
17
18 /**
19 * Mixin to track handles and release them when instance is destroyed.
20 */
21 interface DestroyableConstructor extends DeclareConstructor<Destroyable> { }
22
23 declare const Destroyable: DestroyableConstructor;
24 export = Destroyable;
@@ -0,0 +1,147
1 import _TemplatedMixin = require("./_TemplatedMixin");
2 import _FormMixin = require("./form/_FormMixin");
3 import _DialogMixin = require("./_DialogMixin");
4 import _CssStateMixin = require("./_CssStateMixin");
5 import { CSSStateNodes } from "./_CssStateMixin";
6 import DojoPromise = require("dojo/promise/Promise");
7 import { DomGeometryWidthHeight } from "dojo/dom-geometry";
8 import { _WidgetBaseConstructor, _WidgetBase } from "./_WidgetBase";
9 import ContentPane = require("./layout/ContentPane");
10
11 interface _DialogBase extends _TemplatedMixin, _FormMixin, _DialogMixin, _CssStateMixin {
12 templateString: string;
13 baseClass: string;
14 cssStateNodes: CSSStateNodes;
15
16 /**
17 * True if Dialog is currently displayed on screen.
18 */
19 open: boolean;
20
21 /**
22 * The time in milliseconds it takes the dialog to fade in and out
23 */
24 duration: number;
25
26 /**
27 * A Toggle to modify the default focus behavior of a Dialog, which
28 * is to re-focus the element which had focus before being opened.
29 * False will disable refocusing. Default: true
30 */
31 refocus: boolean;
32
33 /**
34 * A Toggle to modify the default focus behavior of a Dialog, which
35 * is to focus on the first dialog element after opening the dialog.
36 * False will disable autofocusing. Default: true
37 */
38 autofocus: boolean;
39
40 /**
41 * Toggles the movable aspect of the Dialog. If true, Dialog
42 * can be dragged by it's title. If false it will remain centered
43 * in the viewport.
44 */
45 draggable: boolean;
46
47 /**
48 * Maximum size to allow the dialog to expand to, relative to viewport size
49 */
50 maxRatio: number;
51
52 /**
53 * Dialog show [x] icon to close itself, and ESC key will close the dialog.
54 */
55 closable: boolean;
56 postMixInProperties(): void;
57 postCreate(): void;
58
59 /**
60 * Called when data has been loaded from an href.
61 * Unlike most other callbacks, this function can be connected to (via `dojo.connect`)
62 * but should *not* be overridden.
63 */
64 onLoad(data?: any): void;
65
66 focus(): void;
67
68 /* Not entirely sure of the resolution type of these promises */
69
70 /**
71 * Display the dialog
72 */
73 show(): DojoPromise<any>;
74
75 /**
76 * Hide the dialog
77 */
78 hide(): DojoPromise<any>;
79
80 /**
81 * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as
82 * necessary to keep it visible.
83 *
84 * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the
85 * size of the dialog.
86 */
87 resize(dim?: DomGeometryWidthHeight): void;
88
89 destroy(preserveDom?: boolean): void;
90 }
91
92 type _DialogBaseConstructor = _WidgetBaseConstructor<_DialogBase>;
93
94 interface Dialog extends ContentPane, _DialogBase {
95 /* overrides conflicting methods */
96 resize(dim?: DomGeometryWidthHeight): void;
97 }
98
99 interface DialogLevelManager {
100 _beginZIndex: number;
101
102 /**
103 * Call right before fade-in animation for new dialog.
104 *
105 * Saves current focus, displays/adjusts underlay for new dialog,
106 * and sets the z-index of the dialog itself.
107 *
108 * New dialog will be displayed on top of all currently displayed dialogs.
109 * Caller is responsible for setting focus in new dialog after the fade-in
110 * animation completes.
111 */
112 show(dialog: _WidgetBase, underlayAttrs: Object): void;
113
114 /**
115 * Called when the specified dialog is hidden/destroyed, after the fade-out
116 * animation ends, in order to reset page focus, fix the underlay, etc.
117 * If the specified dialog isn't open then does nothing.
118 *
119 * Caller is responsible for either setting display:none on the dialog domNode,
120 * or calling dijit/popup.hide(), or removing it from the page DOM.
121 */
122 hide(dialog: _WidgetBase): void;
123
124 /**
125 * Returns true if specified Dialog is the top in the task
126 */
127 isTop(dialog: _WidgetBase): boolean;
128 }
129
130 declare namespace Dialog {
131
132 interface DialogConstructor extends _WidgetBaseConstructor<Dialog> {
133 /**
134 * for monkey patching and dojox/widget/DialogSimple
135 */
136 _DialogBase: _DialogBaseConstructor;
137 _DialogLevelManager: DialogLevelManager;
138 _dialogStack: {
139 dialog: _WidgetBase,
140 focus: any,
141 underlayAttrs: any
142 }[];
143 }
144 }
145
146 declare const Dialog: Dialog.DialogConstructor;
147 export = Dialog;
@@ -0,0 +1,12
1 import _MenuBase = require("./_MenuBase");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3
4 /**
5 * A menu, without features for context menu (Meaning, drop down menu)
6 */
7 interface DropDownMenu extends _MenuBase { }
8
9 type DropDownMenuConstructor = _WidgetBaseConstructor<DropDownMenu>;
10
11 declare const DropDownMenu: DropDownMenuConstructor;
12 export = DropDownMenu;
@@ -0,0 +1,14
1 import { _WidgetBaseConstructor } from "./_WidgetBase";
2 import TitlePane = require("./TitlePane");
3
4 /**
5 * An accessible fieldset that can be expanded or collapsed via
6 * its legend. Fieldset extends `dijit.TitlePane`.
7 */
8 interface Fieldset extends TitlePane {
9 open: boolean;
10 }
11
12 type FieldsetConstructor = _WidgetBaseConstructor<Fieldset>;
13 declare const Fieldset: FieldsetConstructor;
14 export = Fieldset;
@@ -0,0 +1,54
1 import DropDownMenu = require("./DropDownMenu");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3
4 /**
5 * A context menu you can assign to multiple elements
6 */
7 interface Menu extends DropDownMenu {
8 /**
9 * Array of dom node ids of nodes to attach to.
10 * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
11 */
12 targetNodeIds: string[];
13
14 /**
15 * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to
16 * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to
17 * a range of rows in a table, tree, etc.
18 *
19 * The application must require() an appropriate level of dojo/query to handle the selector.
20 */
21 selector: string;
22
23 /**
24 * If true, right clicking anywhere on the window will cause this context menu to open.
25 * If false, must specify targetNodeIds.
26 */
27 contextMenuForWindow: boolean;
28
29 /**
30 * If true, menu will open on left click instead of right click, similar to a file menu.
31 */
32 leftClickToOpen: boolean;
33
34 /**
35 * When this menu closes, re-focus the element which had focus before it was opened.
36 */
37 refocus: boolean;
38
39 /**
40 * Attach menu to given node
41 */
42 bindDomNode(node: string | Node): void;
43
44 /**
45 * Detach menu from given node
46 */
47 unBindDomNode(nodeName: string | Node): void;
48 }
49
50 interface MenuConstructor extends _WidgetBaseConstructor<Menu> { }
51
52 declare const Menu: MenuConstructor;
53 export = Menu;
54 No newline at end of file
@@ -0,0 +1,23
1 import _MenuBase = require("./_MenuBase");
2 import _WidgetBase = require("./_WidgetBase");
3 import { _WidgetBaseConstructor } from "./_WidgetBase";
4
5 interface MenuBar extends _MenuBase {
6 baseClass: 'dijitMenuBar';
7 popupDelay: number;
8 _isMenuBar: true;
9 _orient: string[];
10 _moveToPopup(evt: Event): void;
11 focusChild(item: _WidgetBase): void;
12 _onChildDeselect(item: _WidgetBase): void;
13 _onLeftArrow(): void;
14 _onRightArrow(): void;
15 _onDownArrow(): void;
16 _onUpArrow(): void;
17 onItemClick(item: _WidgetBase, evt: Event): void;
18 }
19
20 interface MenuBarConstructor extends _WidgetBaseConstructor<MenuBar> { }
21
22 declare const MenuBar: MenuBarConstructor;
23 export = MenuBar No newline at end of file
@@ -0,0 +1,9
1 import MenuItem = require("./MenuItem");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3
4 interface MenuBarItem extends MenuItem { }
5
6 interface MenuBarItemConstructor extends _WidgetBaseConstructor<MenuBarItem> { }
7
8 declare const MenuBarItem: MenuBarItemConstructor;
9 export = MenuBarItem;
@@ -0,0 +1,69
1 import _Widget = require("./_Widget");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import _Contained = require("./_Contained");
4 import _CssStateMixin = require("./_CssStateMixin");
5 import { _WidgetBaseConstructor } from "./_WidgetBase";
6
7 interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin {
8 /**
9 * Text for the accelerator (shortcut) key combination, a control, alt, etc. modified keystroke meant to execute the menu item regardless of where the focus is on the page.
10 *
11 * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators.
12 */
13 accelKey: string;
14
15 /**
16 * If true, the menu item is disabled.
17 * If false, the menu item is enabled.
18 */
19 disabled: boolean;
20
21 /** Menu text as HTML */
22 label: string;
23
24 /**
25 * Class to apply to DOMNode to make it display an icon.
26 */
27 iconClass: string;
28
29 /**
30 * Hook for attr('accelKey', ...) to work.
31 * Set accelKey on this menu item.
32 */
33 _setAccelKeyAttr(value: string): void;
34
35 /**
36 * Hook for attr('disabled', ...) to work.
37 * Enable or disable this menu item.
38 */
39 _setDisabledAttr(value: boolean): void;
40
41 _setLabelAttr(val: string): void;
42 _setIconClassAttr(val: string): void;
43
44 _fillContent(source: Element): void;
45
46 /**
47 * Indicate that this node is the currently selected one
48 */
49 _setSelected(selected: boolean): void;
50
51 focus(): void;
52
53 /**
54 * Deprecated.
55 * Use set('disabled', bool) instead.
56 */
57 setDisabled(disabled: boolean): void;
58
59 /**
60 * Deprecated.
61 * Use set('label', ...) instead.
62 */
63 setLabel(content: string): void;
64 }
65
66 interface MenuItemConstructor extends _WidgetBaseConstructor<MenuItem> { }
67
68 declare const MenuItem: MenuItemConstructor;
69 export = MenuItem; No newline at end of file
@@ -0,0 +1,11
1 import _WidgetBase = require("./_WidgetBase");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import _Contained = require("./_Contained");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5
6 interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { }
7
8 interface MenuSeparatorConstructor extends _WidgetBaseConstructor<MenuSeparator> { }
9
10 declare const MenuSeparator: MenuSeparatorConstructor;
11 export = MenuSeparator;
@@ -0,0 +1,9
1 import { _WidgetBaseConstructor } from "./_WidgetBase";
2 import PopupMenuItem = require("./PopupMenuItem");
3
4 interface PopupMenuBarItem extends PopupMenuItem { }
5
6 interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor<PopupMenuBarItem> { }
7
8 declare const PopupMenuBarItem: PopupMenuBarItemConstructor;
9 export = PopupMenuBarItem;
@@ -0,0 +1,27
1 import MenuItem = require("./MenuItem");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3
4 /**
5 * An item in a Menu that spawn a drop down (usually a drop down menu)
6 */
7 interface PopupMenuItem extends MenuItem {
8 /**
9 * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef.
10 *
11 * srcNodeRef.innerHTML contains both the menu item text and a popup widget
12 * The first part holds the menu item text and the second part is the popup
13 */
14 _fillContent(source: Element): void;
15
16 /**
17 * Open the popup to the side of/underneath this MenuItem, and optionally focus first item
18 */
19 _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void;
20
21 _closePopup(): void;
22 }
23
24 interface PopupMenuItemConstructor extends _WidgetBaseConstructor<PopupMenuItem> { }
25
26 declare const PopupMenuItem: PopupMenuItemConstructor;
27 export = PopupMenuItem;
@@ -0,0 +1,58
1 import ContentPane = require("./layout/ContentPane");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import _CssStateMixin = require("./_CssStateMixin");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5
6 interface TitlePane extends ContentPane, _TemplatedMixin, _CssStateMixin {
7 /**
8 * Whether pane can be opened or closed by clicking the title bar.
9 */
10 toggleable: boolean;
11
12 /**
13 * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane)
14 */
15 tabIndex: string;
16
17 /**
18 * Time in milliseconds to fade in/fade out
19 */
20 duration: number;
21
22 /**
23 * Don't change this parameter from the default value.
24 *
25 * This ContentPane parameter doesn't make sense for TitlePane, since TitlePane is never a child of a layout container, nor should TitlePane try to control the size of an inner widget.
26 */
27 doLayout: boolean;
28
29 /**
30 * Switches between opened and closed state
31 */
32 toggle(): void;
33
34 /**
35 * Set the open/close css state for the TitlePane
36 */
37 _setCss(): void;
38
39 /**
40 * Handler for when user hits a key
41 */
42 _onTitleKey(e: Event): void;
43
44 /**
45 * Handler when user clicks the title bar
46 */
47 _onTitleClick(): void;
48
49 /**
50 * Deprecated. Use set('title', ...) instead.
51 */
52 setTitle(): void;
53 }
54
55 interface TitlePaneConstructor extends _WidgetBaseConstructor<TitlePane> { }
56
57 declare const TitlePane: TitlePaneConstructor;
58 export = TitlePane; No newline at end of file
@@ -0,0 +1,11
1 import _Widget = require("./_Widget");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import _KeyNavContainer = require("./_KeyNavContainer");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5
6 interface Toolbar extends _Widget, _TemplatedMixin, _KeyNavContainer { }
7
8 interface ToolbarConstructor extends _WidgetBaseConstructor<Toolbar> { }
9
10 declare const Toolbar: ToolbarConstructor;
11 export = Toolbar;
@@ -0,0 +1,10
1 import _Widget = require("./_Widget");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import { _WidgetBaseConstructor } from "./_WidgetBase";
4
5 interface ToolbarSeparator extends _Widget, _TemplatedMixin { }
6
7 interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor<ToolbarSeparator> { }
8
9 declare const ToolbarSeparator: ToolbarSeparatorConstructor;
10 export = ToolbarSeparatorConstructor;
@@ -0,0 +1,121
1 import _Widget = require("./_Widget");
2 import { NodeOrString } from "dojo/interfaces";
3 import dojo = require("dojo/_base/html");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5 import { PlaceRectangle } from "./place";
6
7 interface Tooltip extends _Widget {
8 /**
9 * HTML to display in the tooltip.
10 * Specified as innerHTML when creating the widget from markup.
11 */
12 label: string;
13
14 /**
15 * Number of milliseconds to wait after hovering over/focusing on the object, before
16 * the tooltip is displayed.
17 */
18 showDelay: number;
19
20 /**
21 * Number of milliseconds to wait after unhovering the object, before
22 * the tooltip is hidden. Note that blurring an object hides the tooltip immediately.
23 */
24 hideDelay: number;
25
26 /**
27 * Id of domNode(s) to attach the tooltip to.
28 * When user hovers over specified dom node(s), the tooltip will appear.
29 */
30 connectId: NodeOrString | NodeOrString[];
31
32 /**
33 * See description of `dijit/Tooltip.defaultPosition` for details on position parameter.
34 */
35 position: string;
36
37 /**
38 * CSS expression to apply this Tooltip to descendants of connectIds, rather than to
39 * the nodes specified by connectIds themselves. Useful for applying a Tooltip to
40 * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter.
41 * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; }
42 *
43 * The application must require() an appropriate level of dojo/query to handle the selector.
44 */
45 selector: string;
46
47 /**
48 * Attach tooltip to specified node if it's not already connected
49 */
50 addTarget(node: NodeOrString): void;
51
52 /**
53 * Detach tooltip from specified node
54 */
55 removeTarget(node: NodeOrString): void;
56
57 /**
58 * User overridable function that return the text to display in the tooltip.
59 */
60 getContent(node: Node): Node;
61
62 /**
63 * Display the tooltip; usually not called directly.
64 */
65 open(target: Node): void;
66
67 /**
68 * Hide the tooltip or cancel timer for show of tooltip
69 */
70 close(): void;
71
72 /**
73 * Called when the tooltip is shown
74 */
75 onShow(): void;
76
77 /**
78 * Called when the tooltip is hidden
79 */
80 onHide(): void;
81 }
82
83 interface TooltipConstructor extends _WidgetBaseConstructor<Tooltip> {
84 /**
85 * This variable controls the position of tooltips, if the position is not specified to
86 * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values
87 * possible for `dijit/place.around()`. The recommended values are:
88 *
89 * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right
90 * in the case of RTL scripts like Hebrew and Arabic
91 * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left
92 * in the case of RTL scripts like Hebrew and Arabic
93 * - above-centered: tooltip is centered above anchor node
94 * - below-centered: tooltip is centered above anchor node
95 *
96 * The list is positions is tried, in order, until a position is found where the tooltip fits
97 * within the viewport.
98 *
99 * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls
100 * the screen so that there's no room above the target node. Nodes with drop downs, like
101 * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
102 * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
103 * is only room below (or above) the target node, but not both.
104 */
105 defaultPosition: [string];
106
107 /**
108 * Static method to display tooltip w/specified contents in specified position.
109 * See description of dijit/Tooltip.defaultPosition for details on position parameter.
110 * If position is not specified then dijit/Tooltip.defaultPosition is used.
111 */
112 show(innerHTML: string, aroundNode: PlaceRectangle, position?: [string], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void;
113
114 /**
115 * Hide the tooltip
116 */
117 hide(aroundNode: PlaceRectangle): void;
118 }
119
120 declare const Tooltip: TooltipConstructor;
121 export = Tooltip;
@@ -0,0 +1,75
1 import ContentPane = require("./layout/ContentPane");
2 import _TemplatedMixin = require("./_TemplatedMixin");
3 import _FormMixin = require("./form/_FormMixin");
4 import _DialogMixin = require("./_DialogMixin");
5 import { _WidgetBaseConstructor } from "./_WidgetBase";
6 import { PlaceCorner, PlacePosition } from "./place";
7
8 interface TooltipDialog extends ContentPane, _TemplatedMixin, _FormMixin, _DialogMixin {
9 /**
10 * Description of tooltip dialog (required for a11y)
11 */
12 title: string;
13
14 /**
15 * Don't change this parameter from the default value.
16 * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
17 * is never a child of a layout container, nor can you specify the size of
18 * TooltipDialog in order to control the size of an inner widget.
19 */
20 doLayout: boolean;
21
22 /**
23 * A Toggle to modify the default focus behavior of a Dialog, which
24 * is to focus on the first dialog element after opening the dialog.
25 * False will disable autofocusing. Default: true.
26 */
27 autofocus: boolean;
28
29 /**
30 * The pointer to the first focusable node in the dialog.
31 */
32 _firstFocusItem: any;
33
34 /**
35 * The pointer to which node has focus prior to our dialog.
36 */
37 _lastFocusItem: any;
38
39 /**
40 * Configure widget to be displayed in given position relative to the button.
41 *
42 * This is called from the dijit.popup code, and should not be called directly.
43 */
44 orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void;
45
46 /**
47 * Focus on first field
48 */
49 focus(): void;
50
51 /**
52 * Called when dialog is displayed.
53 *
54 * This is called from the dijit.popup code, and should not be called directly.
55 */
56 onOpen(pos: {
57 aroundCorner: PlaceCorner
58 aroundNodePos: PlacePosition
59 corner: PlaceCorner
60 x: number
61 y: number
62 }): void;
63
64 /**
65 * Handler for keydown events
66 *
67 * Keep keyboard focus in dialog; close dialog on escape key
68 */
69 _onKey(evt: KeyboardEvent): void;
70 }
71
72 interface TooltipDialogConstructor extends _WidgetBaseConstructor<TooltipDialog> { }
73
74 declare const TooltipDialog: TooltipDialogConstructor;
75 export = TooltipDialog;
@@ -0,0 +1,87
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import { Handle } from "dojo/interfaces";
3 import _WidgetBase = require("./_WidgetBase");
4
5 declare module "./_WidgetBase" {
6 interface _WidgetBase {
7 dojoAttachEvent: string;
8 dojoAttachPoint: string;
9 }
10 }
11
12 declare module "dojo/_base/kernel" {
13 interface Dijit {
14 _AttachMixin: _AttachMixinConstructor;
15 }
16 }
17
18 interface _AttachMixin {
19 /**
20 * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
21 */
22 _attachPoints: string[];
23
24 /**
25 * List of connections associated with data-dojo-attach-event=... in the template
26 */
27 _attachEvents: Handle[];
28
29 /**
30 * Object to which attach points and events will be scoped. Defaults to 'this'.
31 */
32 attachScope: any;
33
34 /**
35 * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event.
36 *
37 * Should generally be left false (the default value) both for performance and to avoid failures when this.containerNode holds other _AttachMixin instances with their own attach points and events.
38 */
39 searchContainerNode: boolean;
40
41 /**
42 * Attach to DOM nodes marked with special attributes.
43 */
44 buildRendering(): void;
45
46 /**
47 * hook for _WidgetsInTemplateMixin
48 */
49 _beforeFillContent(): void;
50
51 /**
52 * Iterate through the dom nodes and attach functions and nodes accordingly.
53 *
54 * Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
55 * - dojoAttachPoint/data-dojo-attach-point
56 * - dojoAttachEvent/data-dojo-attach-event
57 */
58 _attachTemplateNodes(rootNode: Element | Node): void;
59
60 /**
61 * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
62 *
63 * Returns true if caller should process baseNode's children too.
64 */
65 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
66 baseNode: T,
67 getAttrFunc: (baseNode: T, attr: string) => string,
68 attachFunc: (node: T, type: string, func?: Function) => Handle
69 ): boolean;
70
71 /**
72 * Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
73 */
74 _attach(node: Element | Node, type: string, func?: Function): Handle;
75
76 /**
77 * Detach and clean up the attachments made in _attachtempalteNodes.
78 */
79 _detachTemplateNodes(): void;
80
81 destroyRendering(preserveDom?: boolean): void;
82 }
83
84 interface _AttachMixinConstructor extends DeclareConstructor<_AttachMixin> { }
85
86 declare const _AttachMixin: _AttachMixinConstructor;
87 export = _AttachMixin;
@@ -0,0 +1,27
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 interface _BidiMixin {
4
5 /**
6 * Gets the right direction of text.
7 */
8 getTextDir(text: string): string;
9
10 /**
11 * Set element.dir according to this.textDir, assuming this.textDir has a value.
12 */
13 applyTextDir(element: HTMLElement, text?: string): void;
14
15 /**
16 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
17 */
18 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
19
20 /**
21 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
22 */
23 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
24 }
25
26 declare const _BidiMixin: DeclareConstructor<_BidiMixin>;
27 export = _BidiMixin;
@@ -0,0 +1,28
1 import _WidgetBase = require("./_WidgetBase");
2
3 declare module "./_WidgetBase" {
4 interface _WidgetBase {
5
6 /**
7 * Gets the right direction of text.
8 */
9 getTextDir(text: string): string;
10
11 /**
12 * Set element.dir according to this.textDir, assuming this.textDir has a value.
13 */
14 applyTextDir(element: HTMLElement, text?: string): void;
15
16 /**
17 * Wraps by UCC (Unicode control characters) option's text according to this.textDir
18 */
19 enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string;
20
21 /**
22 * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir).
23 */
24 restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement;
25 }
26 }
27
28 export = _WidgetBase;
@@ -0,0 +1,29
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import _WidgetsInTemplateMixin = require("./_WidgetsInTemplateMixin");
3
4 interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin {
5 /**
6 * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate
7 */
8 actionBarTemplate: string;
9
10 /**
11 * Label of OK button.
12 */
13 buttonOk: string;
14
15 /**
16 * Label of cancel button.
17 */
18 buttonCancel: string;
19 }
20
21 type _ConfirmDialogMixinContructor = DeclareConstructor<_ConfirmDialogMixin>;
22
23 declare const _ConfirmDialogMixin: _ConfirmDialogMixinContructor
24
25 declare module "dojo/_base/kernel" {
26 interface Dijit {
27 _ConfirmDialogMixin: _ConfirmDialogMixinContructor;
28 }
29 }
@@ -0,0 +1,33
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import _WidgetBase = require("./_WidgetBase");
3
4 interface _Contained {
5 /**
6 * Returns the previous child of the parent or null if this is the
7 * first child of the parent.
8 */
9 getPreviousSibling<T extends _WidgetBase>(): T;
10
11 /**
12 * Returns the next child of the parent or null if this is the last
13 * child of the parent.
14 */
15 getNextSibling<T extends _WidgetBase>(): T;
16
17 /**
18 * Returns the index of this widget within its container parent.
19 * It returns -1 if the parent does not exist or if the parent is
20 * not a dijit/_Container.
21 */
22 getIndexInParent(): number;
23 }
24
25 declare module "dojo/_base/kernel" {
26 interface Dijit {
27 _Contained: _ContainedConstructor;
28 }
29 }
30
31 type _ContainedConstructor = DeclareConstructor<_Contained>;
32 declare const _Contained: _ContainedConstructor;
33 export = _Contained;
@@ -0,0 +1,39
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import _WidgetBase = require("./_WidgetBase");
3
4 interface _Container {
5 buildRendering(): void;
6
7 /**
8 * Makes the given widget a child of this widget.
9 */
10 addChild<T extends _WidgetBase>(widget: T, insertIndex?: number): void;
11
12 /**
13 * Removes the passed widget instance from this widget but does
14 * not destroy it. You can also pass in an integer indicating
15 * the index within the container to remove (ie, removeChild(5) removes the sixth widget)
16 */
17 removeChild<T extends _WidgetBase>(widget: T): void;
18 removeChild<T extends number>(widget: number): void;
19
20 /**
21 * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
22 */
23 hasChildren(): boolean;
24
25 /**
26 * Gets the index of the child in this container or -1 if not found
27 */
28 getIndexOfChild<T extends _WidgetBase>(widget: T): number;
29 }
30
31 declare module "dojo/_base/kernel" {
32 interface Dijit {
33 _Container: _ContainerConstructor
34 }
35 }
36
37 type _ContainerConstructor = DeclareConstructor<_Container>;
38 declare const _Container: _ContainerConstructor;
39 export = _Container;
@@ -0,0 +1,31
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 declare namespace _CssStateMixin {
4 interface CSSStateNodes {
5 [node: string]: string;
6 }
7
8
9 interface _CssStateMixin {
10 /**
11 * True if cursor is over this widget
12 */
13 hovering: boolean;
14
15 /**
16 * True if mouse was pressed while over this widget, and hasn't been released yet
17 */
18 active: boolean;
19 }
20 }
21
22 declare module "dojo/_base/kernel" {
23 interface Dijit {
24 _CssStateMixin: _CssStateMixinConstructor
25 }
26 }
27
28 type _CssStateMixin = _CssStateMixin._CssStateMixin;
29 type _CssStateMixinConstructor = DeclareConstructor<_CssStateMixin>;
30 declare const _CssStateMixin: _CssStateMixinConstructor;
31 export = _CssStateMixin;
@@ -0,0 +1,35
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 interface _DialogMixin {
4 /**
5 * HTML snippet to show the action bar (gray bar with OK/cancel buttons).
6 * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses.
7 */
8 actionBarTemplate: string;
9
10 /**
11 * Callback when the user hits the submit button.
12 * Override this method to handle Dialog execution.
13 */
14 execute(formContents?: any): void;
15
16 /**
17 * Called when user has pressed the Dialog's cancel button, to notify container.
18 */
19 onCancel(): void;
20
21 /**
22 * Called when user has pressed the dialog's OK button, to notify container.
23 */
24 onExecute(): void;
25 }
26
27 declare module "dojo/_base/kernel" {
28 interface Dijit {
29 _DialogMixin: _DialogMixinConstructor
30 }
31 }
32
33 type _DialogMixinConstructor = DeclareConstructor<_DialogMixin>;
34 declare const _DialogMixin: _DialogMixinConstructor;
35 export = _DialogMixin;
@@ -0,0 +1,42
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import { FocusManager } from "./focus";
3
4 declare module "./_WidgetBase" {
5
6 interface _WidgetBase {
7 /**
8 * This widget or a widget it contains has focus, or is "active" because
9 * it was recently clicked.
10 */
11 focused: boolean;
12
13 /**
14 * Called when the widget becomes "active" because
15 * it or a widget inside of it either has focus, or has recently
16 * been clicked.
17 */
18 onFocus(): void;
19
20 /**
21 * Called when the widget stops being "active" because
22 * focus moved to something outside of it, or the user
23 * clicked somewhere outside of it, or the widget was
24 * hidden.
25 */
26 onBlur(): void;
27 }
28 }
29
30 interface _FocusMixin {
31 _focusManager: FocusManager;
32 }
33
34 declare module "dojo/_base/kernel" {
35 interface Dijit {
36 _FocusMixin: _FocusMixinConstructor;
37 }
38 }
39
40 type _FocusMixinConstructor = DeclareConstructor<_FocusMixin>;
41 declare const _FocusMixin: _FocusMixinConstructor;
42 export = _FocusMixin;
@@ -0,0 +1,140
1 import _FocusMixin = require("./_FocusMixin");
2 import _WidgetBase = require("./_WidgetBase");
3 import { Deferred } from "dojo/Deferred";
4 import { PlaceLocation } from "./place";
5
6 interface _HasDropDown<T extends _WidgetBase> extends _FocusMixin {
7 /**
8 * The button/icon/node to click to display the drop down.
9 * Can be set via a data-dojo-attach-point assignment.
10 * If missing, then either focusNode or domNode (if focusNode is also missing) will be used.
11 */
12 _buttonNode: HTMLElement;
13
14 /**
15 * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
16 * on where the drop down is set to be positioned.
17 * Can be set via a data-dojo-attach-point assignment.
18 * If missing, then _buttonNode will be used.
19 */
20 _arrowWrapperNode: HTMLElement;
21
22 /**
23 * The node to set the aria-expanded class on.
24 * Also sets popupActive class but that will be removed in 2.0.
25 * Can be set via a data-dojo-attach-point assignment.
26 * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.
27 */
28 _popupStateNode: HTMLElement;
29
30 /**
31 * The node to display the popup around.
32 * Can be set via a data-dojo-attach-point assignment.
33 * If missing, then domNode will be used.
34 */
35 _aroundNode: HTMLElement;
36
37 /**
38 * The widget to display as a popup. This widget *must* be
39 * defined before the startup function is called.
40 */
41 dropDown: T;
42
43 /**
44 * Set to true to make the drop down at least as wide as this
45 * widget. Set to false if the drop down should just be its
46 * default width.
47 */
48 autoWidth: boolean;
49
50 /**
51 * Set to true to make the drop down exactly as wide as this
52 * widget. Overrides autoWidth.
53 */
54 forceWidth: boolean;
55
56 /**
57 * The max height for our dropdown.
58 * Any dropdown taller than this will have scrollbars.
59 * Set to 0 for no max height, or -1 to limit height to available space in viewport
60 */
61 maxHeight: number;
62
63 /**
64 * This variable controls the position of the drop down.
65 * It's an array of strings
66 */
67 dropDownPosition: string[];
68 /* TODO remove for TS 1.8 */
69 /* dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; */
70
71 /**
72 * When set to false, the click events will not be stopped, in
73 * case you want to use them in your subclass
74 */
75 _stopClickEvents: boolean;
76
77 /**
78 * Callback when the user mousedown/touchstart on the arrow icon.
79 */
80 _onDropDownMouseDown(e: MouseEvent): void;
81
82 /**
83 * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon.
84 * Note that this function is called regardless of what node the event occurred on (but only after
85 * a mousedown/touchstart on the arrow).
86 */
87 _onDropDownMouseUp(e?: MouseEvent): void;
88
89 /**
90 * The drop down was already opened on mousedown/keydown; just need to stop the event
91 */
92 _onDropDownClick(e: MouseEvent): void;
93
94 buildRendering(): void;
95 postCreate(): void;
96 destroy(preserveDom?: boolean): void;
97
98 /**
99 * Returns true if the dropdown exists and it's data is loaded. This can
100 * be overridden in order to force a call to loadDropDown().
101 */
102 isLoaded(): boolean;
103
104 /**
105 * Creates the drop down if it doesn't exist, loads the data
106 * if there's an href and it hasn't been loaded yet, and then calls
107 * the given callback.
108 */
109 loadDropDown(loadCallback: () => void): void;
110
111 /**
112 * Creates the drop down if it doesn't exist, loads the data
113 * if there's an href and it hasn't been loaded yet, and
114 * then opens the drop down. This is basically a callback when the
115 * user presses the down arrow button to open the drop down.
116 */
117 loadAndOpenDropDown(): Deferred<T>;
118
119 /**
120 * Callback when the user presses the down arrow button or presses
121 * the down arrow key to open/close the drop down.
122 * Toggle the drop-down widget; if it is up, close it, if not, open it
123 */
124 toggleDropDown(): void;
125
126 /**
127 * Opens the dropdown for this widget. To be called only when this.dropDown
128 * has been created and is ready to display (ie, it's data is loaded).
129 */
130 openDropDown(): PlaceLocation;
131
132 /**
133 * Closes the drop down on this widget
134 */
135 closeDropDown(focus?: boolean): void;
136 }
137
138 type _HasDropDownConstructor<T extends _WidgetBase = _WidgetBase> = _HasDropDown<T>;
139 declare const _HasDropDown: _HasDropDownConstructor;
140 export = _HasDropDown;
@@ -0,0 +1,67
1 import _FocusMixin = require("./_FocusMixin");
2 import _Container = require("./_Container");
3 import _WidgetBase = require("./_WidgetBase");
4 import { DeclareConstructor } from "dojo/_base/declare";
5 import _KeyNavMixin = require("./_KeyNavMixin");
6
7 /**
8 * A _Container with keyboard navigation of its children.
9 *
10 * Provides normalized keyboard and focusing code for Container widgets.
11 * To use this mixin, call connectKeyNavHandlers() in postCreate().
12 * Also, child widgets must implement a focus() method.
13 */
14 interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container {
15 /**
16 * Deprecated. You can call this in postCreate() to attach the keyboard handlers to the container, but the preferred method is to override _onLeftArrow() and _onRightArrow(), or _onUpArrow() and _onDownArrow(), to call focusPrev() and focusNext().
17 *
18 * @param prevKeyCodes Key codes for navigating to the previous child.
19 * @param nextKeyCodes Key codes for navigating to the next child.
20 */
21 connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void;
22
23 /**
24 * @deprecated
25 */
26 startupKeyNavChildren(): void;
27
28 /**
29 * Setup for each child widget.
30 *
31 * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child.
32 *
33 * Note: if you add children by a different method than addChild(), then need to call this manually or at least make sure the child's tabIndex is -1.
34 *
35 * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget.
36 */
37 _startupChild(widget: _WidgetBase): void;
38
39 /**
40 * Focus the next widget
41 */
42 focusNext(): void;
43
44 /**
45 * Focus the last focusable node in the previous widget
46 *
47 * (ex: go to the ComboButton icon section rather than button section)
48 */
49 focusPrev(): void;
50
51 /**
52 * Implement _KeyNavMixin.childSelector, to identify focusable child nodes.
53 *
54 * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function.
55 */
56 childSelector(node: Element | Node): boolean | void | any;
57 }
58
59 declare module "dojo/_base/kernel" {
60 interface Dijit {
61 _KeyNavContainer: _KeyNavContainerConstructor
62 }
63 }
64
65 type _KeyNavContainerConstructor = DeclareConstructor<_KeyNavContainer>;
66 declare const _KeyNavContainer: _KeyNavContainerConstructor;
67 export = _KeyNavContainer;
@@ -0,0 +1,168
1 import _FocusMixin = require("./_FocusMixin");
2 import _WidgetBase = require("./_WidgetBase");
3 import { DeclareConstructor } from "dojo/_base/declare";
4
5 /**
6 * A mixin to allow arrow key and letter key navigation of child or descendant widgets.
7 * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree.
8 *
9 * To use this mixin, the subclass must:
10 *
11 * - Implement _getNext(), _getFirst(), _getLast(), _onLeftArrow(), _onRightArrow() _onDownArrow(), _onUpArrow() methods to handle home/end/left/right/up/down keystrokes. Next and previous in this context refer to a linear ordering of the descendants used by letter key search.
12 * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild()
13 * - Define childSelector to a function or string that identifies focusable descendant widgets
14 *
15 * Also, child widgets must implement a focus() method.
16 */
17 interface _KeyNavMixin extends _FocusMixin {
18 /**
19 * Tab index of the container; same as HTML tabIndex attribute.
20 * Note then when user tabs into the container, focus is immediately moved to the first item in the container.
21 */
22 tabIndex: string;
23
24 /**
25 * Selector (passed to on.selector()) used to identify what to treat as a child widget. Used to monitor focus events and set this.focusedChild. Must be set by implementing class. If this is a string (ex: "> *") then the implementing class must require dojo/query.
26 */
27 childSelector: string | Function | null;
28
29 /**
30 * Called on left arrow key, or right arrow key if widget is in RTL mode.
31 * Should go back to the previous child in horizontal container widgets like Toolbar.
32 */
33 _onLeftArrow(evt?: KeyboardEvent): void;
34
35 /**
36 * Called on right arrow key, or left arrow key if widget is in RTL mode.
37 * Should go to the next child in horizontal container widgets like Toolbar.
38 */
39 _onRightArrow(evt?: KeyboardEvent): void;
40
41 /**
42 * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu.
43 */
44 _onUpArrow(evt?: KeyboardEvent): void;
45
46 /**
47 * Called on down arrow key. Should go to the next child in vertical container widgets like Menu.
48 */
49 _onDownArrow(evt?: KeyboardEvent): void;
50
51 /**
52 * Default focus() implementation: focus the first child.
53 */
54 focus(): void;
55
56 /**
57 * Returns first child that can be focused.
58 */
59 _getFirstFocusableChild(): _WidgetBase;
60
61 /**
62 * Returns last child that can be focused.
63 */
64 _getLastFocusableChild(): _WidgetBase;
65
66 /**
67 * Focus the first focusable child in the container.
68 */
69 focusFirstChild(): void;
70
71 /**
72 * Focus the last focusable child in the container.
73 */
74 focusLastChild(): void;
75
76 /**
77 * Focus specified child widget.
78 *
79 * @param widget Reference to container's child widget
80 * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one
81 */
82 focusChild(widget: _WidgetBase, last?: boolean): void;
83
84 /**
85 * Handler for when the container itself gets focus.
86 *
87 * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child.
88 */
89 _onContainerFocus(evt: Event): void;
90
91 /**
92 * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code.
93 *
94 * It marks that the current node is the selected one, and the previously selected node no longer is.
95 */
96 _onChildFocus(child?: _WidgetBase): void;
97
98 _searchString: string;
99
100 multiCharSearchDuration: number;
101
102 /**
103 * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary.
104 */
105 onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void;
106
107 /**
108 * Compares the searchString to the widget's text label, returning:
109 *
110 * * -1: a high priority match and stop searching
111 * * 0: not a match
112 * * 1: a match but keep looking for a higher priority match
113 */
114 _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1;
115
116 /**
117 * When a key is pressed, if it's an arrow key etc. then it's handled here.
118 */
119 _onContainerKeydown(evt: Event): void;
120
121 /**
122 * When a printable key is pressed, it's handled here, searching by letter.
123 */
124 _onContainerKeypress(evt: Event): void;
125
126 /**
127 * Perform a search of the widget's options based on the user's keyboard activity
128 *
129 * Called on keypress (and sometimes keydown), searches through this widget's children looking for items that match the user's typed search string. Multiple characters typed within 1 sec of each other are combined for multicharacter searching.
130 */
131 _keyboardSearch(evt: Event, keyChar: string): void;
132
133 /**
134 * Called when focus leaves a child widget to go to a sibling widget.
135 */
136 _onChildBlur(widget: _WidgetBase): void;
137
138 /**
139 * Returns the next or previous focusable descendant, compared to "child".
140 * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container.
141 */
142 _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
143
144 /**
145 * Returns the first child.
146 */
147 _getFirst(): _WidgetBase | null;
148
149 /**
150 * Returns the last descendant.
151 */
152 _getLast(): _WidgetBase | null;
153
154 /**
155 * Returns the next descendant, compared to "child".
156 */
157 _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null;
158 }
159
160 declare module "dojo/_base/kernel" {
161 interface Dijit {
162 _KeyNavMixin: _KeyNavMixinConstructor;
163 }
164 }
165
166 type _KeyNavMixinConstructor = DeclareConstructor<_KeyNavMixin>;
167 declare const _KeyNavMixin: _KeyNavMixinConstructor;
168 export = _KeyNavMixin; No newline at end of file
@@ -0,0 +1,158
1 import _KeyNavContainer = require("./_KeyNavContainer");
2 import _CssStateMixin = require("./_CssStateMixin");
3 import { _WidgetBaseConstructor, _WidgetBase } from "./_WidgetBase";
4 import _TemplatedMixin = require("./_TemplatedMixin");
5 import _Widget = require("./_Widget");
6 import MenuItem = require("./MenuItem");
7
8 /**
9 * Abstract base class for Menu and MenuBar.
10 * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow().
11 */
12 interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin {
13 selected: MenuItem | null;
14
15 _setSelectedAttr(item?: MenuItem | null): void;
16
17 /**
18 * This Menu has been clicked (mouse or via space/arrow key) or opened as a submenu, so mere mouseover will open submenus. Focusing a menu via TAB does NOT automatically make it active since TAB is a navigation operation and not a selection one.
19 *
20 * For Windows apps, pressing the ALT key focuses the menubar menus (similar to TAB navigation) but the menu is not active (ie no dropdown) until an item is clicked.
21 */
22 activated: boolean;
23
24 _setActivatedAttr(val: boolean): void;
25
26 /**
27 * pointer to menu that displayed me
28 */
29 parentMenu: _Widget | null;
30
31 /**
32 * After a menu has been activated (by clicking on it etc.), number of milliseconds before hovering (without clicking) another MenuItem causes that MenuItem's popup to automatically open.
33 */
34 popupDelay: number;
35
36 /**
37 * For a passive (unclicked) Menu, number of milliseconds before hovering (without clicking) will cause the popup to open. Default is Infinity, meaning you need to click the menu to open it.
38 */
39 passivePopupDelay: number;
40
41 /**
42 * A toggle to control whether or not a Menu gets focused when opened as a drop down from a MenuBar or DropDownButton/ComboButton. Note though that it always get focused when opened via the keyboard.
43 */
44 autoFocus: boolean;
45
46 /**
47 * Selector (passed to on.selector()) used to identify MenuItem child widgets, but exclude inert children like MenuSeparator. If subclass overrides to a string (ex: "> *"), the subclass must require dojo/query.
48 */
49 childSelector(node: Element | Node): boolean | void | Function;
50
51 /**
52 * Attach point for notification about when a menu item has been executed. This is an internal mechanism used for Menus to signal to their parent to close them, because they are about to execute the onClick handler. In general developers should not attach to or override this method.
53 */
54 onExecute(): void;
55
56 /**
57 * Attach point for notification about when the user cancels the current menu
58 * This is an internal mechanism used for Menus to signal to their parent to close them. In general developers should not attach to or override this method.
59 */
60 onCancel(): void;
61
62 /**
63 * This handles the right arrow key (left arrow key on RTL systems), which will either open a submenu, or move to the next item in the ancestor MenuBar
64 */
65 _moveToPopup(evt: Event): void;
66
67 /**
68 * This handler is called when the mouse moves over the popup.
69 */
70 _onPopupHover(evt?: MouseEvent): void;
71
72 /**
73 * Called when cursor is over a MenuItem.
74 */
75 onItemHover(item: MenuItem): void;
76
77 /**
78 * Called when a child MenuItem becomes deselected. Setup timer to close its popup.
79 */
80 _onChildDeselect(item: MenuItem): void;
81
82 /**
83 * Callback fires when mouse exits a MenuItem
84 */
85 onItemUnhover(item: MenuItem): void;
86
87 /**
88 * Cancels the popup timer because the user has stop hovering on the MenuItem, etc.
89 */
90 _stopPopupTimer(): void;
91
92 /**
93 * Cancels the pending-close timer because the close has been preempted
94 */
95 _stopPendingCloseTimer(): void;
96
97 /**
98 * Returns the top menu in this chain of Menus
99 */
100 _getTopMenu(): void;
101
102 /**
103 * Handle clicks on an item.
104 */
105 onItemClick(item: _WidgetBase, evt: Event): void;
106
107 /**
108 * Open the popup to the side of/underneath the current menu item, and optionally focus first item
109 */
110 _openItemPopup(fromItem: MenuItem, focus: boolean): void;
111
112 /**
113 * Callback when this menu is opened.
114 * This is called by the popup manager as notification that the menu was opened.
115 */
116 onOpen(evt?: Event): void;
117
118 /**
119 * Callback when this menu is closed.
120 * This is called by the popup manager as notification that the menu was closed.
121 */
122 onClose(): boolean;
123
124 /**
125 * Called when submenu is clicked or focus is lost. Close hierarchy of menus.
126 */
127 _closeChild(): void;
128 /**
129 * Called when child of this Menu gets focus from:
130 *
131 * 1. clicking it
132 * 2. tabbing into it
133 * 3. being opened by a parent menu.
134 *
135 * This is not called just from mouse hover.
136 */
137 _onItemFocus(item: MenuItem): void;
138
139 /**
140 * Called when focus is moved away from this Menu and it's submenus.
141 */
142 _onBlur(): void;
143
144 /**
145 * Called when the user is done with this menu. Closes hierarchy of menus.
146 */
147 _cleanUp(clearSelectedItem?: boolean): void;
148 }
149
150 declare module "dojo/_base/kernel" {
151 interface Dijit {
152 _MenuBase: _MenuBaseConstructor;
153 }
154 }
155
156 type _MenuBaseConstructor = _WidgetBaseConstructor<_MenuBase>;
157 declare const _MenuBase: _MenuBaseConstructor;
158 export = _MenuBase;
@@ -0,0 +1,32
1 import { DeclareConstructor } from "dojo/_base/declare";
2 import { ExtensionEvent } from "dojo/on";
3 import { WatchHandle } from "dojo/interfaces";
4 import { A11yClick } from "./a11yclick";
5
6 interface _OnDijitClickMixin {
7 /**
8 * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work
9 */
10 connect(obj: any, event: string | ExtensionEvent, method: string | EventListener): WatchHandle;
11 }
12
13 /**
14 * Deprecated. New code should access the dijit/a11yclick event directly, ex:
15 * this.own(on(node, a11yclick, function(){ ... }));
16 *
17 * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work.
18 * It also used to be necessary to make templates with ondijitclick work, but now you can just require
19 * dijit/a11yclick.
20 */
21 interface _OnDijitClickMixinConstructor extends DeclareConstructor<_OnDijitClickMixin>{
22 a11yclick: A11yClick;
23 }
24
25 declare module "dojo/_base/kernel" {
26 interface Dijit {
27 _OnDijitClickMixin: _OnDijitClickMixinConstructor;
28 }
29 }
30
31 declare const _OnDijitClickMixin: _OnDijitClickMixinConstructor;
32 export = _OnDijitClickMixin;
@@ -0,0 +1,45
1 import _AttachMixin = require("./_AttachMixin");
2 import { _WidgetBaseConstructor } from "./_WidgetBase";
3
4 interface _TemplatedMixin extends _AttachMixin {
5
6 /**
7 * A string that represents the widget template.
8 * Use in conjunction with dojo.cache() to load from a file.
9 */
10 templateString: string;
11
12 /**
13 * Path to template (HTML file) for this widget relative to dojo.baseUrl.
14 * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
15 */
16 templatePath: string;
17
18 /**
19 * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's
20 * and events inside this.containerNode. Remove for 2.0.
21 */
22 searchContainerNode: boolean;
23
24 /**
25 * Construct the UI for this widget from a template, setting this.domNode.
26 */
27 buildRendering(): void;
28 }
29
30 interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> {
31 /**
32 * Static method to get a template based on the templatePath or
33 * templateString key
34 */
35 getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement;
36 }
37
38 declare module "dojo/_base/kernel" {
39 interface Dijit {
40 _TemplatedMixin: _TemplatedMixinConstructor;
41 }
42 }
43
44 declare const _TemplatedMixin: _TemplatedMixinConstructor;
45 export = _TemplatedMixin;
@@ -0,0 +1,115
1 import _WidgetBase = require("./_WidgetBase");
2 import _OnDijitClickMixin = require("./_OnDijitClickMixin");
3 import _FocusMixin = require("./_FocusMixin");
4 import { _WidgetBaseConstructor } from "./_WidgetBase";
5
6 interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin {
7 /**
8 * Connect to this function to receive notifications of mouse click events.
9 */
10 onClick(event: DocumentEvent): void;
11
12 /**
13 * Connect to this function to receive notifications of mouse double click events.
14 */
15 onDblClick(event: DocumentEvent): void;
16
17 /**
18 * Connect to this function to receive notifications of keys being pressed down.
19 */
20 onKeyDown(event: DocumentEvent): void;
21
22 /**
23 * Connect to this function to receive notifications of printable keys being typed.
24 */
25 onKeyPress(event: DocumentEvent): void;
26
27 /**
28 * Connect to this function to receive notifications of keys being released.
29 */
30 onKeyUp(event: DocumentEvent): void;
31
32 /**
33 * Connect to this function to receive notifications of when the mouse button is pressed down.
34 */
35 onMouseDown(event: DocumentEvent): void;
36
37 /**
38 * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
39 */
40 onMouseMove(event: DocumentEvent): void;
41
42 /**
43 * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
44 */
45 onMouseOut(event: DocumentEvent): void;
46
47 /**
48 * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
49 */
50 onMouseOver(event: DocumentEvent): void;
51
52 /**
53 * Connect to this function to receive notifications of when the mouse moves off of this widget.
54 */
55 onMouseLeave(event: DocumentEvent): void;
56
57 /**
58 * Connect to this function to receive notifications of when the mouse moves onto this widget.
59 */
60 onMouseEnter(event: DocumentEvent): void;
61
62 /**
63 * Connect to this function to receive notifications of when the mouse button is released.
64 */
65 onMouseUp(event: DocumentEvent): void;
66
67 postCreate(): void;
68
69 /**
70 * Deprecated. Use set() instead.
71 */
72 setAttribute(attr: string, value: any): void;
73
74 /**
75 * This method is deprecated, use get() or set() directly.
76 */
77 attr(name: string | { [attr: string]: any }, value?: any): any;
78
79 /**
80 * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
81 */
82 getDescendants(): _Widget[];
83
84 /**
85 * Called when this widget becomes the selected pane in a
86 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
87 * `dijit/layout/AccordionContainer`, etc.
88 *
89 * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
90 */
91 onShow(): void;
92
93 /**
94 * Called when another widget becomes the selected pane in a
95 * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`,
96 * `dijit/layout/AccordionContainer`, etc.
97 *
98 * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`.
99 */
100 onHide(): void;
101
102 /**
103 * Called when this widget is being displayed as a popup (ex: a Calendar popped
104 * up from a DateTextBox), and it is hidden.
105 * This is called from the dijit.popup code, and should not be called directly.
106 *
107 * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses.
108 * Callback if a user tries to close the child. Child will be closed if this function returns true.
109 */
110 onClose(): boolean;
111 }
112
113 type _WidgetConstructor = _WidgetBaseConstructor<_Widget>;
114 declare const _Widget: _WidgetConstructor;
115 export = _Widget;
@@ -0,0 +1,241
1 import Stateful = require("dojo/Stateful");
2 import Destroyable = require("./Destroyable");
3 import { ExtensionEvent } from "dojo/on";
4 import { NodeFragmentOrString, Handle, NodeOrString, WatchHandle } from "dojo/interfaces";
5 import { DeclareConstructor } from "dojo/_base/declare";
6
7 declare namespace _WidgetBase {
8
9 interface _WidgetBase extends Stateful, Destroyable {
10
11 /**
12 * A unique, opaque ID string that can be assigned by users or by the
13 * system. If the developer passes an ID which is known not to be
14 * unique, the specified ID is ignored and the system-generated ID is
15 * used instead.
16 */
17 id: string;
18
19 /**
20 * Rarely used. Overrides the default Dojo locale used to render this widget,
21 * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
22 * Value must be among the list of locales specified during by the Dojo bootstrap,
23 * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
24 */
25 lang: string;
26
27 /**
28 * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
29 * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
30 * default direction.
31 */
32 dir: string;
33
34 /**
35 * HTML class attribute
36 */
37 class: string;
38
39 /**
40 * HTML style attributes as cssText string or name/value hash
41 */
42 style: string;
43
44 /**
45 * HTML title attribute.
46 *
47 * For form widgets this specifies a tooltip to display when hovering over
48 * the widget (just like the native HTML title attribute).
49 *
50 * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
51 * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's
52 * interpreted as HTML.
53 */
54 title: string;
55
56 /**
57 * When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
58 * this specifies the tooltip to appear when the mouse is hovered over that text.
59 */
60 tooltip: string;
61
62 /**
63 * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
64 * widget state.
65 */
66 baseClass: string;
67
68 /**
69 * pointer to original DOM node
70 */
71 srcNodeRef: HTMLElement;
72
73 /**
74 * This is our visible representation of the widget! Other DOM
75 * Nodes may by assigned to other properties, usually through the
76 * template system's data-dojo-attach-point syntax, but the domNode
77 * property is the canonical "top level" node in widget UI.
78 */
79 domNode: HTMLElement;
80
81 /**
82 * Designates where children of the source DOM node will be placed.
83 * "Children" in this case refers to both DOM nodes and widgets.
84 */
85 containerNode: HTMLElement;
86
87 /**
88 * The document this widget belongs to. If not specified to constructor, will default to
89 * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
90 */
91 ownerDocument: HTMLElement;
92
93 /**
94 * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute
95 * for each XXX attribute to be mapped to the DOM.
96 */
97 attributeMap: { [attribute: string]: any };
98
99 /**
100 * Bi-directional support, the main variable which is responsible for the direction of the text.
101 * The text direction can be different than the GUI direction by using this parameter in creation
102 * of a widget.
103 */
104 textDir: string;
105
106 /**
107 * Kicks off widget instantiation. See create() for details.
108 */
109 postscript(params?: any, srcNodeRef?: HTMLElement): void;
110
111 /**
112 * Kick off the life-cycle of a widget
113 */
114 create(params?: any, srcNodeRef?: HTMLElement): void;
115
116 /**
117 * Called after the parameters to the widget have been read-in,
118 * but before the widget template is instantiated. Especially
119 * useful to set properties that are referenced in the widget
120 * template.
121 */
122 postMixInProperties(): void;
123
124 /**
125 * Construct the UI for this widget, setting this.domNode.
126 * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method.
127 */
128 buildRendering(): void;
129
130 /**
131 * Processing after the DOM fragment is created
132 */
133 postCreate(): void;
134
135 /**
136 * Processing after the DOM fragment is added to the document
137 */
138 startup(): void;
139
140 /**
141 * Destroy this widget and its descendants
142 */
143 destroyRecursive(preserveDom?: boolean): void;
144
145 /**
146 * Destroys the DOM nodes associated with this widget.
147 */
148 destroyRendering(preserveDom?: boolean): void;
149
150 /**
151 * Recursively destroy the children of this widget and their
152 * descendants.
153 */
154 destroyDescendants(preserveDom?: boolean): void;
155
156 /**
157 * Deprecated. Override destroy() instead to implement custom widget tear-down
158 * behavior.
159 */
160 uninitialize(): boolean;
161
162 /**
163 * Used by widgets to signal that a synthetic event occurred, ex:
164 * | myWidget.emit("attrmodified-selectedChildWidget", {}).
165 */
166 emit(type: string, eventObj?: any, callbackArgs?: any[]): any;
167
168 /**
169 * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
170 */
171 on(type: string | ExtensionEvent, func: EventListener | Function): WatchHandle;
172
173 /**
174 * Returns a string that represents the widget.
175 */
176 toString(): string;
177
178 /**
179 * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent
180 * is this widget. Note that it does not return all descendants, but rather just direct children.
181 */
182 getChildren<T extends _WidgetBase>(): T[];
183
184 /**
185 * Returns the parent widget of this widget.
186 */
187 getParent<T extends _WidgetBase>(): T;
188
189 /**
190 * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
191 */
192 connect(obj: any, event: string | ExtensionEvent, method: string | EventListener): WatchHandle;
193
194 /**
195 * Deprecated, will be removed in 2.0, use handle.remove() instead.
196 */
197 disconnect(handle: WatchHandle): void;
198
199 /**
200 * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
201 */
202 subscribe(t: string, method: EventListener): WatchHandle;
203
204 /**
205 * Deprecated, will be removed in 2.0, use handle.remove() instead.
206 */
207 unsubscribe(handle: WatchHandle): void;
208
209 /**
210 * Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
211 */
212 isLeftToRight(): boolean;
213
214 /**
215 * Return true if this widget can currently be focused
216 * and false if not
217 */
218 isFocusable(): boolean;
219
220 /**
221 * Place this widget somewhere in the DOM based
222 * on standard domConstruct.place() conventions.
223 */
224 placeAt<T extends _WidgetBase>(reference: NodeFragmentOrString | T, position?: string | number): this;
225
226 /**
227 * Wrapper to setTimeout to avoid deferred functions executing
228 * after the originating widget has been destroyed.
229 * Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
230 */
231 defer(fcn: Function, delay?: number): Handle;
232 }
233
234 interface _WidgetBaseConstructor<W = _WidgetBase> extends DeclareConstructor<W> {
235 new(params: Object, srcNodeRef: NodeOrString): W;
236 }
237 }
238
239 type _WidgetBase = _WidgetBase._WidgetBase;
240 declare const _WidgetBase: _WidgetBase._WidgetBaseConstructor;
241 export = _WidgetBase;
@@ -0,0 +1,21
1 import { _WidgetBaseConstructor } from "./_WidgetBase";
2
3 interface _WidgetsInTemplateMixin {
4 /**
5 * Used to provide a context require to dojo/parser in order to be
6 * able to use relative MIDs (e.g. `./Widget`) in the widget's template.
7 */
8 contextRequire: Function;
9
10 startup(): void;
11 }
12
13 declare module "dojo/_base/kernel" {
14 interface Dijit {
15 _WidgetsInTemplateMixin: _WidgetsInTemplateMixinConstructor
16 }
17 }
18
19 type _WidgetsInTemplateMixinConstructor = _WidgetBaseConstructor<_WidgetsInTemplateMixin>;
20 declare const _WidgetsInTemplateMixin: _WidgetsInTemplateMixinConstructor;
21 export = _WidgetsInTemplateMixin;
@@ -0,0 +1,84
1 import dijit = require("../main");
2 import _WidgetBase = require("dijit/_WidgetBase");
3
4 type Bookmark = { isCollapsed: boolean, mark?: Range };
5 type FocusNode = Element | null;
6 type RemoveHandle = { remove(): void };
7
8 /**
9 * Deprecated module to monitor currently focused node and stack of currently focused widgets.
10 *
11 * New code should access dijit/focus directly.
12 */
13 declare module "dojo/_base/kernel" {
14 interface Dijit {
15 /**
16 * Currently focused item on screen
17 */
18 _curFocus: FocusNode;
19
20 /**
21 * Previously focused item on screen
22 */
23 _prevFocus: FocusNode;
24
25 /**
26 * Returns true if there is no text selected
27 */
28 isCollapsed(): boolean;
29
30 /**
31 * Retrieves a bookmark that can be used with moveToBookmark to return to the same range
32 */
33 getBookmark(): Bookmark;
34
35 /**
36 * Moves current selection to a bookmark
37 */
38 moveToBookmark(bookmark: Bookmark): void;
39
40 /**
41 * Called as getFocus(), this returns an Object showing the current focus and selected text.
42 *
43 * Called as getFocus(widget), where widget is a (widget representing) a button that was just pressed, it returns where focus was before that button was pressed. (Pressing the button may have either shifted focus to the button, or removed focus altogether.) In this case the selected text is not returned, since it can't be accurately determined.
44 */
45 getFocus(menu: _WidgetBase, openedForWindow?: Window): {
46 node: FocusNode;
47 bookmark: any;
48 openedForWindow?: Window
49 };
50
51 /**
52 * List of currently active widgets (focused widget and it's ancestors)
53 */
54 _activeStack: _WidgetBase[];
55
56 /**
57 * Registers listeners on the specified iframe so that any click or focus event on that iframe (or anything in it) is reported as a focus/click event on the `<iframe>` itself.
58 *
59 * Currently only used by editor.
60 */
61 registerIframe(iframe: HTMLIFrameElement): RemoveHandle;
62
63 /**
64 * Unregisters listeners on the specified iframe created by registerIframe.
65 * After calling be sure to delete or null out the handle itself.
66 */
67 unregisterIframe(handle?: RemoveHandle): void;
68
69 /**
70 * Registers listeners on the specified window (either the main window or an iframe's window) to detect when the user has clicked somewhere or focused somewhere.
71 *
72 * Users should call registerIframe() instead of this method.
73 */
74 registerWin(targetWindow: Window, effectiveNode: Element): RemoveHandle;
75
76 /**
77 * Unregisters listeners on the specified window (either the main window or an iframe's window) according to handle returned from registerWin().
78 * After calling be sure to delete or null out the handle itself.
79 */
80 unregisterWin(handle?: RemoveHandle): void;
81 }
82 }
83
84 export = dijit; No newline at end of file
@@ -0,0 +1,23
1 import dijit = require("../main");
2 import _WidgetBase = require("../_WidgetBase");
3
4 declare module "dojo/_base/kernel" {
5 interface Dijit {
6 byId(id: string | _WidgetBase): _WidgetBase;
7 getUniqueId(widgetType: string): string;
8 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
9 byNode(node: Node): _WidgetBase;
10 getEnclosingWidgets(node: Node): _WidgetBase;
11
12 /**
13 * defaultDuration: Integer
14 * The default fx.animation speed (in ms) to use for all Dijit
15 * transitional fx.animations, unless otherwise specified
16 * on a per-instance basis. Defaults to 200, overrided by
17 * `djConfig.defaultDuration`
18 */
19 defaultDuration: number;
20 }
21 }
22
23 export = dijit; No newline at end of file
@@ -0,0 +1,51
1 import { DomGeometryBox } from "dojo/dom-geometry";
2 import dijit = require("../main");
3 import { PlacePosition, LayoutNodeFunction, PlaceCorner, PlaceLocation } from "../place";
4
5 type placeOnScreenAround = (node: Element, aroundNode: Element, aroundCorners: Object | any[], layoutNode?: LayoutNodeFunction) => void;
6
7 /**
8 * Deprecated back compatibility module, new code should use dijit/place directly instead of using this module.
9 */
10 declare module "dojo/_base/kernel" {
11 interface Dijit {
12 /**
13 * Deprecated method to return the dimensions and scroll position of the viewable area of a browser window.
14 *
15 * New code should use windowUtils.getBox()
16 */
17 getViewport(): DomGeometryBox;
18
19 placeOnScreen(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
20
21 /**
22 * Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object for the "around" argument and finds a proper processor to place a node.
23 *
24 * Deprecated, new code should use dijit/place.around() instead.
25 */
26 placeOnScreenAroundElement: placeOnScreenAround;
27
28 /**
29 * Position node adjacent or kitty-corner to aroundNode such that it's fully visible in viewport.
30 *
31 * Deprecated, new code should use dijit/place.around() instead.
32 */
33 placeOnScreenAroundNode: placeOnScreenAround;
34
35 /**
36 * Like dijit.placeOnScreenAroundNode(), except that the "around" parameter is an arbitrary rectangle on the screen (x, y, width, height) instead of a dom node.
37 *
38 * Deprecated, new code should use dijit/place.around() instead.
39 */
40 placeOnScreenAroundRectangle: placeOnScreenAround;
41
42 /**
43 * Deprecated method, unneeded when using dijit/place directly.
44 *
45 * Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit/place.placeOnScreenAroundElement.
46 */
47 getPopupAroundAlignment(position: string[], leftToRight?: boolean): { [s: string]: PlaceCorner };
48 }
49 }
50
51 export = dijit;
@@ -0,0 +1,2
1 import popup = require("../popup");
2 export = popup;
@@ -0,0 +1,7
1 import { DomGeometryXYBox } from "dojo/dom-geometry";
2
3 declare module "dojo/_base/kernel" {
4 interface Dijit {
5 scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
6 }
7 }
1 NO CONTENT: new file 100644
1 NO CONTENT: new file 100644
@@ -0,0 +1,56
1 import dijit = require("../main");
2
3 declare module "dojo/_base/kernel" {
4 interface Dijit {
5 /**
6 * Determines if an element has a particular role.
7 */
8 hasWaiRole(elem: Element, role: string): boolean;
9
10 /**
11 * Gets the role for an element (which should be a wai role).
12 */
13 getWaiRole(elem: Element): string;
14
15 /**
16 * Sets the role on an element.
17 */
18 setWaiRole(elem: Element, role: string): void;
19
20 /**
21 * Removes the specified role from an element.
22 * Removes role attribute if no specific role provided (for backwards compat.)
23 */
24 removeWaiRole(elem: Element, role: string): void;
25
26 /**
27 * Determines if an element has a given state.
28 *
29 * Checks for an attribute called "aria-"+state.
30 */
31 hasWaiState(elem: Element, state: string): boolean;
32
33 /**
34 * Gets the value of a state on an element.
35 *
36 * Checks for an attribute called "aria-"+state.
37 */
38 getWaiState(elem: Element, state: string): string;
39
40 /**
41 * Sets a state on an element.
42 *
43 * Sets an attribute called "aria-"+state.
44 */
45 setWaiState(elem: Element, state: string, value: string): void;
46
47 /**
48 * Removes a state from an element.
49 *
50 * Sets an attribute called "aria-"+state.
51 */
52 removeWaiState(elem: Element, state: string): void;
53 }
54 }
55
56 export = dijit;
@@ -0,0 +1,7
1 import "dojo/_base/kernel";
2
3 declare module "dojo/_base/kernel" {
4 interface Dijit {
5 getDocumentWindow(doc?: Document): Window;
6 }
7 }
@@ -0,0 +1,33
1 import { Handle } from "dojo/interfaces";
2 import { ExtensionEvent } from "dojo/on";
3
4 declare namespace a11yclick {
5
6 interface A11yClick {
7
8 /**
9 * Custom press, release, and click synthetic events
10 * which trigger on a left mouse click, touch, or space/enter keyup.
11 */
12 (node: HTMLElement, listener: Function): Handle;
13
14 /**
15 * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation.
16 */
17 press: ExtensionEvent;
18
19 /**
20 * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation.
21 */
22 release: ExtensionEvent;
23
24 /**
25 * Mouse cursor or a finger is dragged over the given node.
26 */
27 move: ExtensionEvent;
28 }
29
30 }
31
32 declare const a11yclick: a11yclick.A11yClick;
33 export = a11yclick;
@@ -0,0 +1,62
1 import _WidgetBase = require("./_WidgetBase");
2 import { Handle } from "dojo/interfaces";
3
4 declare namespace focus {
5
6 /**
7 * Tracks the currently focused node, and which widgets are currently "active".
8 * Access via require(["dijit/focus"], function(focus){ ... }).
9 *
10 * A widget is considered active if it or a descendant widget has focus,
11 * or if a non-focusable node of this widget or a descendant was recently clicked.
12 *
13 * Call focus.watch("curNode", callback) to track the current focused DOMNode,
14 * or focus.watch("activeStack", callback) to track the currently focused stack of widgets.
15 *
16 * Call focus.on("widget-blur", func) or focus.on("widget-focus", ...) to monitor when
17 * when widgets become active/inactive
18 *
19 * Finally, focus(node) will focus a node, suppressing errors if the node doesn't exist.
20 */
21 interface FocusManager {
22 /**
23 * Currently focused item on screen
24 */
25 curNode: Element;
26
27 /**
28 * List of currently active widgets (focused widget and it's ancestors)
29 */
30 activeStack: _WidgetBase[];
31
32 /**
33 * Registers listeners on the specified iframe so that any click
34 * or focus event on that iframe (or anything in it) is reported
35 * as a focus/click event on the `<iframe>` itself.
36 *
37 * @param iframe Currently only used by editor.
38 * @returns Handle with remove() method to deregister.
39 */
40 registerIframe(iframe: Element): Handle;
41
42 /**
43 * Registers listeners on the specified window (either the main
44 * window or an iframe's window) to detect when the user has clicked somewhere
45 * or focused somewhere.
46 *
47 * Users should call registerIframe() instead of this method.
48 *
49 * @param targetWindow If specified this is the window associated with the iframe,
50 * i.e. iframe.contentWindow.
51 * @param effectiveNode If specified, report any focus events inside targetWindow as
52 * an event on effectiveNode, rather than on evt.target.
53 *
54 * @returns Handle with remove() method to deregister.
55 */
56 registerWin(targetWindow?: Window, effectiveNode?: Element): Handle;
57 }
58
59 }
60
61 declare const focus: focus.FocusManager;
62 export = focus; No newline at end of file
@@ -0,0 +1,37
1 import { _WidgetBaseConstructor } from "../_WidgetBase";
2 import _ButtonMixin = require("./_ButtonMixin");
3 import _FormWidget = require("./_FormWidget");
4
5 interface Button extends _FormWidget, _ButtonMixin {
6 /**
7 * Set this to true to hide the label text and display only the icon.
8 * (If showLabel=false then iconClass must be specified.)
9 * Especially useful for toolbars.
10 * If showLabel=true, the label will become the title (a.k.a. tooltip/hint)
11 */
12 showLabel: boolean;
13
14 /**
15 * Class to apply to DOMNode in button to make it display an icon
16 */
17 iconClass: string;
18
19 baseClass: string;
20 templateString: string;
21 postCreate(): void;
22 setLabel(content: string): void;
23 onLabelSet(e: DocumentEvent): void;
24
25 onClick(e: DocumentEvent): boolean;
26
27 set(name: 'showLabel', value: boolean): this;
28 set(name: 'value', value: string): this;
29 set(name: 'name', value: string): this;
30 set(name: 'label', value: string): this;
31 set(name: string, value: any): this;
32 set(values: Object): this;
33 }
34
35 type ButtonConstructor = _WidgetBaseConstructor<Button>;
36 declare const Button: ButtonConstructor;
37 export = Button;
@@ -0,0 +1,45
1 import _WidgetBase = require("../_WidgetBase");
2 import _Container = require("../_Container");
3 import _HasDropDown = require("../_HasDropDown");
4 import { _WidgetBaseConstructor } from "../_WidgetBase";
5 import { NodeOrString } from "dojo/interfaces";
6 import Button = require("./Button");
7
8 interface DropDownButton<T extends _WidgetBase> extends Button, _Container, _HasDropDown<T> {
9 baseClass: string;
10 templateString: string;
11
12 /**
13 * Overrides _TemplatedMixin#_fillContent().
14 * My inner HTML possibly contains both the button label and/or a drop down widget, like
15 * <DropDownButton> <span>push me</span> <Menu> ... </Menu> </DropDownButton>
16 */
17 _fillContent(): void;
18 startup(): void;
19
20 /**
21 * Returns whether or not we are loaded - if our dropdown has an href,
22 * then we want to check that.
23 */
24 isLoaded(): boolean;
25
26 /**
27 * Default implementation assumes that drop down already exists,
28 * but hasn't loaded it's data (ex: ContentPane w/href).
29 * App must override if the drop down is lazy-created.
30 */
31 loadDropDown(callback: () => void): void;
32
33 /**
34 * Overridden so that focus is handled by the _HasDropDown mixin, not by
35 * the _FormWidget mixin.
36 */
37 isFocusable(): boolean;
38 }
39
40 interface DropDownButtonConstructor<T extends _WidgetBase = _WidgetBase> extends _WidgetBaseConstructor<DropDownButton<T>> {
41 new <T extends _WidgetBase>(params: Object, srcNodeRef: NodeOrString): DropDownButton<T>;
42 }
43
44 declare const DropDownButton: DropDownButtonConstructor;
45 export = DropDownButton;
@@ -0,0 +1,25
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 interface _ButtonMixin {
4 /**
5 * A mixin to add a thin standard API wrapper to a normal HTML button
6 */
7 label: string;
8
9 /**
10 * Type of button (submit, reset, button, checkbox, radio)
11 */
12 type: string;
13 postCreate(): void;
14
15 /**
16 * Callback for when button is clicked.
17 * If type="submit", return true to perform submit, or false to cancel it.
18 */
19 onClick(e: DocumentEvent): boolean;
20 onSetLabel(e: DocumentEvent): void;
21 }
22
23 type _ButtonMixinConstructor = DeclareConstructor<_ButtonMixin>;
24 declare const _ButtonMixin: _ButtonMixinConstructor;
25 export = _ButtonMixin;
@@ -0,0 +1,80
1 import _WidgetBase = require("dijit/_WidgetBase");
2 import _FormWidget = require("./_FormWidget");
3 import { DeclareConstructor } from "dojo/_base/declare";
4
5 interface OnValidStateChange {
6 (isValid?: boolean): void;
7 }
8
9 interface _FormMixin {
10
11 /**
12 * Will be "Error" if one or more of the child widgets has an invalid value,
13 * "Incomplete" if not all of the required child widgets are filled in. Otherwise, "",
14 * which indicates that the form is ready to be submitted.
15 */
16 state: '' | 'Error' | 'Incomplete';
17
18 /**
19 * Returns all form widget descendants, searching through non-form child widgets like BorderContainer
20 */
21 _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[];
22
23 reset(): void;
24
25 /**
26 * returns if the form is valid - same as isValid - but
27 * provides a few additional (ui-specific) features:
28 *
29 * 1. it will highlight any sub-widgets that are not valid
30 * 2. it will call focus() on the first invalid sub-widget
31 */
32 validate(): boolean;
33
34 setValues(val: any): _FormMixin;
35 getValues(): any;
36
37 /**
38 * Returns true if all of the widgets are valid.
39 * Deprecated, will be removed in 2.0. Use get("state") instead.
40 */
41 isValid(): boolean;
42
43 /**
44 * Stub function to connect to if you want to do something
45 * (like disable/enable a submit button) when the valid
46 * state changes on the form as a whole.
47 *
48 * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead.
49 */
50 onValidStateChange: OnValidStateChange;
51
52 /**
53 * Compute what this.state should be based on state of children
54 */
55 _getState(): '' | 'Error' | 'Incomplete';
56
57 /**
58 * Deprecated method. Applications no longer need to call this. Remove for 2.0.
59 */
60 disconnectChildren(): void;
61
62 /**
63 * You can call this function directly, ex. in the event that you
64 * programmatically add a widget to the form *after* the form has been
65 * initialized.
66 */
67 connectChildren(inStartup?: boolean): void;
68
69 /**
70 * Called when child's value or disabled state changes
71 */
72 _onChildChange(attr?: string): void;
73
74 startup(): void;
75 destroy(preserveDom?: boolean): void;
76 }
77
78 type _FormMixinConstructor = DeclareConstructor<_FormMixin>;
79 declare const _FormMixin: _FormMixinConstructor;
80 export = _FormMixin;
@@ -0,0 +1,19
1 import _Widget = require("../_Widget");
2 import _TemplatedMixin = require("../_TemplatedMixin");
3 import _CssStateMixin = require("../_CssStateMixin");
4 import { _WidgetBaseConstructor } from "../_WidgetBase";
5 import _FormWidgetMixin = require("./_FormWidgetMixin");
6
7 interface _FormWidget extends _Widget, _TemplatedMixin, _CssStateMixin, _FormWidgetMixin {
8 setDisabled(disabled: boolean): void;
9 setValue(value: string): void;
10 postMixInProperties(): void;
11
12 set(name: 'value', value: string): this;
13 set(name: string, value: any): this;
14 set(values: Object): this;
15 }
16
17 type _FormWidgetConstructor = _WidgetBaseConstructor<_FormWidget>;
18 declare const _FormWidget: _FormWidgetConstructor;
19 export = _FormWidget; No newline at end of file
@@ -0,0 +1,84
1 import { DeclareConstructor } from "dojo/_base/declare";
2
3 interface _FormWidgetMixin {
4 /**
5 * Name used when submitting form; same as "name" attribute or plain HTML elements
6 */
7 name: string;
8
9 /**
10 * Corresponds to the native HTML `<input>` element's attribute.
11 */
12 alt: string;
13
14 /**
15 * Corresponds to the native HTML `<input>` element's attribute.
16 */
17 value: any;
18
19 /**
20 * Corresponds to the native HTML `<input>` element's attribute.
21 */
22 type: string;
23
24 /**
25 * Apply aria-label in markup to the widget's focusNode
26 */
27 'aria-label': string;
28
29 /**
30 * Order fields are traversed when user hits the tab key
31 */
32 tabIndex: number;
33
34 /**
35 * Should this widget respond to user input?
36 * In markup, this is specified as "disabled='disabled'", or just "disabled".
37 */
38 disabled: boolean;
39
40 /**
41 * Fires onChange for each value change or only on demand
42 */
43 intermediateChanges: boolean;
44
45 /**
46 * On focus, should this widget scroll into view?
47 */
48 scrollOnFocus: boolean;
49
50 /**
51 * Tells if this widget is focusable or not. Used internally by dijit.
52 */
53 isFocusable(): boolean;
54
55 /**
56 * Put focus on this widget
57 */
58 focus(): void;
59
60 /**
61 * Compare 2 values (as returned by get('value') for this widget).
62 */
63 compare(val1: any, val2: any): number;
64
65 /**
66 * Callback when this widget's value is changed.
67 */
68 onChange(value: string): void;
69
70 /**
71 * Overrides _Widget.create()
72 */
73 create(params?: any, srcNodeRef?: HTMLElement): void;
74
75 destroy(preserveDom?: boolean): void;
76
77 set(name: 'disabled', value: boolean): this;
78 set(name: string, value: any): this;
79 set(values: Object): this;
80 }
81
82 type _FormWidgetMixinConstructor = DeclareConstructor<_FormWidgetMixin>;
83 declare const _FormWidgetMixin: _FormWidgetMixinConstructor;
84 export = _FormWidgetMixin;
@@ -0,0 +1,189
1 import { _WidgetBaseConstructor } from "dijit/_WidgetBase";
2 import { Deferred } from "dojo/Deferred";
3 import { ContentSetterContent } from "dojo/html";
4 import { GenericConstructor } from "dojo/interfaces";
5 import { DojoRequestPromise, XhrBaseOptions } from "dojo/request";
6 import _Widget = require("dijit/_Widget");
7 import _Container = require("dijit/_Container");
8 import _ContentPaneResizeMixin = require("./_ContentPaneResizeMixin");
9
10 interface ContentPane extends _Widget, _Container, _ContentPaneResizeMixin {
11
12 /**
13 * The href of the content that displays now
14 * Set this at construction if you want to load data externally when th
15 * pane is shown. (Set preload=true to load it immediately.
16 * Changing href after creation doesn't have any effect; Use set('href', ...);
17 */
18 href: string;
19
20 /**
21 * The innerHTML of the ContentPane
22 * Note that the initialization parameter / argument to set("content", ...
23 * can be a String, DomNode, Nodelist, or _Widget.
24 */
25 content: ContentSetterContent | _Widget;
26
27 /**
28 * Extract visible content from inside of `<body> .... </body>`
29 * I.e., strip `<html>` and `<head>` (and it's contents) from the href
30 */
31 extractContent: boolean;
32
33 /**
34 * Parse content and create the widgets, if any.
35 */
36 parseOnLoad: boolean;
37
38 /**
39 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo
40 * will search for data-dojo-type (or dojoType). For backwards compatibilit
41 * reasons defaults to dojo._scopeName (which is "dojo" except whe
42 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
43 */
44 parserScope: string;
45
46 /**
47 * Prevent caching of data from href's by appending a timestamp to the href.
48 */
49 preventCache: boolean;
50
51 /**
52 * Force load of data on initialization even if pane is hidden.
53 */
54 preload: boolean;
55
56 /**
57 * Refresh (re-download) content when pane goes from hidden to shown
58 */
59 refreshOnShow: boolean;
60
61 /**
62 * Message that shows while downloading
63 */
64 loadingMessage: string;
65
66 /**
67 * Message that shows if an error occurs
68 */
69 errorMessage: string;
70
71 /**
72 * True if the ContentPane has data in it, either specifie
73 * during initialization (via href or inline content), or se
74 * via set('content', ...) / set('href', ...
75 * False if it doesn't have any content, or if ContentPane i
76 * still in the process of downloading href.
77 */
78 isLoaded: boolean;
79
80 baseClass: string;
81
82 /**
83 * Function that should grab the content specified via href.
84 */
85 ioMethod<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
86
87 /**
88 * Parameters to pass to xhrGet() request, for example:
89 * | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="href: './bar', ioArgs: {timeout: 500}">
90 */
91 ioArgs: { [arg: string]: string | number };
92
93 /**
94 * This is the `dojo.Deferred` returned by set('href', ...) and refresh()
95 * Calling onLoadDeferred.then() registers you
96 * callback to be called only once, when the prior set('href', ...) call o
97 * the initial href parameter to the constructor finishes loading
98 * This is different than an onLoad() handler which gets called any time any hre
99 * or content is loaded.
100 */
101 onLoadDeferred: Deferred<any>;
102
103 /**
104 * Flag to parser that I'll parse my contents, so it shouldn't.
105 */
106 stopParser: boolean;
107
108 /**
109 * Flag from the parser that this ContentPane is inside a templat
110 * so the contents are pre-parsed.
111 */
112 template: boolean;
113
114 markupFactory<T>(params: any, node: HTMLElement, ctor: GenericConstructor<T>): T;
115 postMixInProperties(): void;
116 buildRendering(): void;
117
118 /**
119 * Call startup() on all children including non _Widget ones like dojo/dnd/Source objects
120 */
121 startup(): void;
122
123 /**
124 * Deprecated. Use set('href', ...) instead.
125 */
126 setHref(href: string | URL): ContentPane;
127
128 /**
129 * Deprecated. Use set('content', ...) instead.
130 */
131 setContent(data: ContentSetterContent): ContentPane;
132
133 /**
134 * Cancels an in-flight download of content
135 */
136 cancel(): void;
137
138 /**
139 * [Re]download contents of href and display
140 */
141 refresh(): Deferred<any>;
142
143 /**
144 * Destroy all the widgets inside the ContentPane and empty containerNode
145 */
146 destroyDescendants(preserveDom?: boolean): void;
147
148 /**
149 * Event hook, is called after everything is loaded and widgetified
150 */
151 onLoad(data?: any): void;
152
153 /**
154 * Event hook, is called before old content is cleared
155 */
156 onUnload(): void;
157
158 /**
159 * Called before download starts.
160 */
161 onDownloadStart(): string;
162
163 /**
164 * Called on DOM faults, require faults etc. in content.
165 * In order to display an error message in the pane, return
166 * the error message from this method, as an HTML string.
167 * By default (if this method is not overriden), it returns
168 * nothing, so the error message is just printed to the console.
169 */
170 onContentError(error: Error): void;
171
172 /**
173 * Called when download error occurs.
174 * In order to display an error message in the pane, return
175 * the error message from this method, as an HTML string.
176 * Default behavior (if this method is not overriden) is to display
177 * the error message inside the pane.
178 */
179 onDownloadError(error: Error): void;
180
181 /**
182 * Called when download is finished.
183 */
184 onDownloadEnd(): void;
185 }
186
187 type ContentPaneConstructor = _WidgetBaseConstructor<ContentPane>;
188 declare const ContentPane: ContentPaneConstructor;
189 export = ContentPane;
@@ -0,0 +1,37
1 import { DomGeometryBox, DomGeometryWidthHeight } from "dojo/dom-geometry";
2
3 import { _WidgetBaseConstructor } from "dijit/_WidgetBase";
4
5 interface _ContentPaneResizeMixin {
6
7 /**
8 * - false - don't adjust size of children
9 * - true - if there is a single visible child widget, set it's size to however big the ContentPane is
10 */
11 doLayout: boolean;
12
13 /**
14 * Indicates that this widget will call resize() on it's child widgets
15 * when they become visible.
16 */
17 isLayoutContainer: boolean;
18
19 /**
20 * See `dijit/layout/_LayoutWidget.startup()` for description.
21 * Although ContentPane doesn't extend _LayoutWidget, it does implement
22 * the same API.
23 */
24 startup(): void;
25
26 /**
27 * See `dijit/layout/_LayoutWidget.resize()` for description.
28 * Although ContentPane doesn't extend _LayoutWidget, it does implement
29 * the same API.
30 */
31 resize(changeSize?: DomGeometryBox, resultSize?: DomGeometryWidthHeight): void;
32 }
33
34 type _ContentPaneResizeMixinConstructor = _WidgetBaseConstructor<_ContentPaneResizeMixin>;
35
36 declare const _ContentPaneResizeMixin: _ContentPaneResizeMixinConstructor;
37 export = _ContentPaneResizeMixin;
@@ -0,0 +1,2
1 import dojo = require("dojo/_base/kernel");
2 export = dojo.dijit; No newline at end of file
@@ -0,0 +1,7
1 {
2 "name": "@types/dijit",
3 "version": "1.0.1-rc1",
4 "dependencies": {
5 "@types/dojo": "^1.0.0"
6 }
7 } No newline at end of file
@@ -0,0 +1,55
1 declare namespace place {
2 interface PlacePosition {
3 x: number;
4 y: number;
5 }
6
7 interface PlaceWidthHeight {
8 w: number;
9 h: number;
10 }
11
12 interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
13
14 type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
15
16 type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
17
18 interface PlaceChoice {
19 corner: PlaceCorner;
20 pos: PlacePosition;
21 aroundCorner?: PlaceCorner;
22 }
23
24 interface PlaceLocation extends PlaceRectangle {
25 corner: PlaceCorner;
26 aroundCorner: PlaceCorner;
27 overflow: number;
28 spaceAvailable: PlaceWidthHeight;
29 }
30
31 interface LayoutNodeFunction {
32 (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
33 }
34
35 interface Place {
36 /**
37 * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
38 * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
39 * where node is fully visible, or the corner where it's most visible.
40 *
41 * Node is assumed to be absolutely or relatively positioned.
42 */
43 at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
44
45 /**
46 * Position node adjacent or kitty-corner to anchor
47 * such that it's fully visible in viewport.
48 */
49 around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
50 }
51
52 }
53
54 declare const place: place.Place;
55 export = place;
@@ -0,0 +1,130
1 import _WidgetBase = require("./_WidgetBase");
2 import { PlacePosition, PlaceLocation } from "./place";
3
4 interface PopupOpenArgs {
5 /**
6 * widget to display
7 */
8 popup?: _WidgetBase;
9
10 /**
11 * the button etc. that is displaying this popup
12 */
13 parent?: _WidgetBase;
14
15 /**
16 * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
17 */
18 around?: HTMLElement;
19
20 /**
21 * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
22 */
23 x?: number;
24
25 /**
26 * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
27 */
28 y?: number;
29
30 /**
31 * When the around parameter is specified, orient should be a list of positions to try
32 */
33 orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; };
34
35 /**
36 * callback when user has canceled the popup by:
37 *
38 * 1. hitting ESC or
39 * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
40 * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
41 */
42 onCancel?: () => void;
43
44 /**
45 * callback whenever this popup is closed
46 */
47 onClose?: () => void;
48
49 /**
50 * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
51 */
52 onExecute?: () => void;
53
54 /**
55 * adding a buffer around the opening position. This is only useful when around is not set.
56 */
57 padding?: PlacePosition;
58
59 /**
60 * The max height for the popup. Any popup taller than this will have scrollbars.
61 * Set to Infinity for no max height. Default is to limit height to available space in viewport,
62 * above or below the aroundNode or specified x/y position.
63 */
64 maxHeight?: number;
65 }
66
67 interface PopupManager {
68 /**
69 * Stack of currently popped up widgets.
70 * (someone opened _stack[0], and then it opened _stack[1], etc.)
71 */
72 _stack: _WidgetBase[];
73
74 /**
75 * Z-index of the first popup. (If first popup opens other
76 * popups they get a higher z-index.)
77 */
78 _beginZIndex: number;
79
80 _idGen: number;
81
82 /**
83 * If screen has been scrolled, reposition all the popups in the stack.
84 * Then set timer to check again later.
85 */
86 _repositionAll(): void;
87
88 /**
89 * Initialization for widgets that will be used as popups.
90 * Puts widget inside a wrapper DIV (if not already in one),
91 * and returns pointer to that wrapper DIV.
92 */
93 _createWrapper(widget: _WidgetBase): HTMLDivElement;
94
95 /**
96 * Moves the popup widget off-screen.
97 * Do not use this method to hide popups when not in use, because
98 * that will create an accessibility issue: the offscreen popup is
99 * still in the tabbing order.
100 */
101 moveOffScreen(widget: _WidgetBase): HTMLDivElement;
102
103 /**
104 * Hide this popup widget (until it is ready to be shown).
105 * Initialization for widgets that will be used as popups
106 *
107 * Also puts widget inside a wrapper DIV (if not already in one)
108 *
109 * If popup widget needs to layout it should
110 * do so when it is made visible, and popup._onShow() is called.
111 */
112 hide(widget: _WidgetBase): void;
113
114 /**
115 * Compute the closest ancestor popup that's *not* a child of another popup.
116 * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
117 */
118 getTopPopup(): _WidgetBase;
119
120 /**
121 * Popup the widget at the specified position
122 */
123 open(args: PopupOpenArgs): PlaceLocation;
124
125 /**
126 * Close specified popup and any popups that it parented.
127 * If no popup is specified, closes all popups.
128 */
129 close(popup?: _WidgetBase): void;
130 }
@@ -0,0 +1,55
1 import _WidgetBase = require("./_WidgetBase");
2
3 interface Registry {
4 /**
5 * Number of registered widgets
6 */
7 length: number;
8
9 /**
10 * Add a widget to the registry. If a duplicate ID is detected, a error is thrown.
11 */
12 add(widget: _WidgetBase): void;
13
14 /**
15 * Remove a widget from the registry. Does not destroy the widget; simply
16 * removes the reference.
17 */
18 remove(id: string): void;
19
20 /**
21 * Find a widget by it's id.
22 * If passed a widget then just returns the widget.
23 */
24 byId(id: string | _WidgetBase): _WidgetBase;
25
26 /**
27 * Returns the widget corresponding to the given DOMNode
28 */
29 byNode(node: Element | Node): _WidgetBase;
30
31 /**
32 * Convert registry into a true Array
33 */
34 toArray(): _WidgetBase[];
35
36 /**
37 * Generates a unique id for a given widgetType
38 */
39 getUniqueId(widgetType: string): string;
40
41 /**
42 * Search subtree under root returning widgets found.
43 * Doesn't search for nested widgets (ie, widgets inside other widgets).
44 */
45 findWidgets(root: Node, skipNode?: Node): _WidgetBase[];
46
47 /**
48 * Returns the widget whose DOM tree contains the specified DOMNode, or null if
49 * the node is not contained within the DOM tree of any widget
50 */
51 getEnclosingWidget(node: Element | Node): _WidgetBase;
52 }
53
54 declare const registry: Registry;
55 export = registry;
@@ -0,0 +1,28
1 interface AdapterRegistry {
2 /**
3 * register a check function to determine if the wrap function or
4 * object gets selected
5 */
6 register(name: string, check: (...args: any[]) => boolean, wrap: Function, directReturn?: boolean, override?: boolean): void;
7
8 /**
9 * Find an adapter for the given arguments. If no suitable adapter
10 * is found, throws an exception. match() accepts any number of
11 * arguments, all of which are passed to all matching functions
12 * from the registered pairs.
13 */
14 match(...args: any[]): any;
15
16 /**
17 * Remove a named adapter from the registry
18 */
19 unregister(name: string): boolean;
20 }
21
22 interface AdapterRegistryConstructor {
23 new (returnWrappers?: boolean): AdapterRegistry;
24 prototype: AdapterRegistry;
25 }
26
27 declare const AdapterRegistry: AdapterRegistryConstructor;
28 export = AdapterRegistry;
@@ -0,0 +1,76
1 import { PromiseCallback, DojoPromise, PromiseErrback, PromiseProgback } from "./promise/Promise";
2
3 declare namespace dojoDeferred {
4
5 interface Deferred<T> {
6
7 /**
8 * The public promise object that clients can add callbacks to.
9 */
10 promise: DojoPromise<T>;
11
12 /**
13 * Checks whether the deferred has been resolved.
14 */
15 isResolved(): boolean;
16
17 /**
18 * Checks whether the deferred has been rejected.
19 */
20 isRejected(): boolean;
21
22 /**
23 * Checks whether the deferred has been resolved or rejected.
24 */
25 isFulfilled(): boolean;
26
27 /**
28 * Checks whether the deferred has been canceled.
29 */
30 isCanceled(): boolean;
31
32 /**
33 * Emit a progress update on the deferred.
34 */
35 progress(update: any, strict?: boolean): DojoPromise<T>;
36
37 /**
38 * Resolve the deferred.
39 */
40 resolve(value?: T, strict?: boolean): DojoPromise<T>;
41
42 /**
43 * Reject the deferred.
44 */
45 reject(error?: any, strict?: boolean): DojoPromise<T>;
46
47 /**
48 * Add new callbacks to the deferred.
49 */
50 then<U>(callback?: PromiseCallback<T, U>, errback?: PromiseErrback<U>, progback?: PromiseProgback): DojoPromise<U>;
51
52 /**
53 * Inform the deferred it may cancel its asynchronous operation.
54 */
55 cancel(reason?: any, strict?: boolean): any;
56
57 /**
58 * Returns `[object Deferred]`.
59 */
60 toString(): string;
61 }
62
63 interface DeferredConstructor {
64 /**
65 * Creates a new deferred. This API is preferred over
66 * `dojo/_base/Deferred`.
67 */
68 new <T>(canceller?: (reason: any) => void): Deferred<T>;
69 prototype: Deferred<any>;
70 }
71
72 }
73
74 type dojoDeferred<T> = dojoDeferred.Deferred<T>;
75 declare const dojoDeferred: dojoDeferred.DeferredConstructor;
76 export = dojoDeferred;
@@ -0,0 +1,18
1 import { Deferred } from "./Deferred";
2
3 interface DeferredList<T> extends Deferred<T[]> {
4 /**
5 * Gathers the results of the deferreds for packaging
6 * as the parameters to the Deferred Lists' callback
7 */
8 gatherResults<T>(deferredList: DeferredList<any>): DeferredList<T>;
9 }
10
11 interface DeferredListConstructor {
12 /**
13 * Deprecated, use dojo/promise/all instead.
14 * Provides event handling for a group of Deferred objects.
15 */
16 new <T>(list: T[], fireOnOneCallback?: boolean, fireOnOneErrback?: boolean, consumeErrors?: boolean, canceller?: (reason: any) => void): DeferredList<T>;
17 prototype: DeferredList<any>;
18 } No newline at end of file
@@ -0,0 +1,16
1 import { Handle } from "./interfaces";
2
3 import { DeclareConstructor } from "./_base/declare";
4 import { ExtensionEvent } from "./on";
5
6 interface Evented {
7 on(type: string | ExtensionEvent, listener: EventListener | Function): Handle;
8 emit(type: string | ExtensionEvent, ...events: any[]): boolean;
9 }
10
11 interface EventedConstructor extends DeclareConstructor<Evented> {
12 new (params?: Object): Evented;
13 }
14
15 declare const Evented: EventedConstructor;
16 export = Evented;
@@ -0,0 +1,50
1 import { DeclareConstructor } from "./_base/declare";
2 import { Handle, WatchHandle } from "./interfaces";
3
4 interface Stateful {
5 /**
6 * Used across all instances a hash to cache attribute names and their getter
7 * and setter names.
8 */
9 _attrPairNames: { [attr: string]: string };
10
11 /**
12 * Helper function for get() and set().
13 * Caches attribute name values so we don't do the string ops every time.
14 */
15 _getAttrNames(name: string): string;
16
17 /**
18 * Automatic setting of params during construction
19 */
20 postscript(params?: Object): void;
21
22 /**
23 * Get a property on a Stateful instance.
24 */
25 get(name: string): any;
26
27 /**
28 * Set a property on a Stateful instance
29 */
30 set(name: string, value: any): this;
31 set(name: Object): this;
32
33 /**
34 * Internal helper for directly changing an attribute value.
35 */
36 _changeAttrValue(name: string, value: any): this;
37
38 /**
39 * Watches a property for changes
40 */
41 watch(callback: (prop: string, oldValue: any, newValue: any) => void): WatchHandle;
42 watch(name: string, callback: (prop: string, oldValue: any, newValue: any) => void): WatchHandle;
43 }
44
45 interface StatefulConstructor extends DeclareConstructor<Stateful> {
46 new (params?: Object): Stateful;
47 }
48
49 declare const Stateful: StatefulConstructor;
50 export = Stateful;
@@ -0,0 +1,269
1 /* dojo/_base/Color */
2
3 declare namespace dojoColor {
4 type ColorValue = [number, number, number];
5 type ColorValueAlpha = [number, number, number, number];
6
7 interface ColorObject {
8 r: number;
9 g: number;
10 b: number;
11 a?: number;
12 }
13
14 interface ColorNamed {
15 'black': ColorValue;
16 'silver': ColorValue;
17 'gray': ColorValue;
18 'white': ColorValue;
19 'maroon': ColorValue;
20 'red': ColorValue;
21 'purple': ColorValue;
22 'fuchsia': ColorValue;
23 'green': ColorValue;
24 'lime': ColorValue;
25 'olive': ColorValue;
26 'yellow': ColorValue;
27 'navy': ColorValue;
28 'blue': ColorValue;
29 'teal': ColorValue;
30 'aqua': ColorValue;
31 'transparent': [number, number, number, number];
32 }
33
34 interface Color {
35 r: number;
36 g: number;
37 b: number;
38 a: number;
39 _set(r: number, g: number, b: number, a: number): void;
40
41 /** Takes a named string, hex string, array of rgb or rgba values,
42 * an object with r, g, b, and a properties, or another `Color` object
43 * and sets this color instance to that value.
44 */
45 setColor(color: ColorValue | ColorValueAlpha | ColorObject | string): Color;
46
47 /**
48 * Ensures the object has correct attributes
49 */
50 sanitize(): Color;
51
52 /**
53 * Returns 3 component array of rgb values
54 */
55 toRgb(): ColorValue;
56
57 /**
58 * Returns a 4 component array of rgba values from the color represented by
59 * this object.
60 */
61 toRgba(): ColorValueAlpha;
62
63 /**
64 * Returns a CSS color string in hexadecimal representation
65 */
66 toHex(): string;
67
68 /**
69 * Returns a css color string in rgb(a) representation
70 */
71 toCss(includeAlpha?: boolean): string;
72
73 /**
74 * Returns a visual representation of the color
75 */
76 toString(): string;
77 }
78
79 interface ColorConstructor {
80 new(color: ColorValue | ColorValueAlpha | ColorObject | string): Color;
81 prototype: Color;
82
83 /**
84 * Dictionary list of all CSS named colors, by name. Values are 3-item arrays with corresponding RG and B values.
85 */
86 named: ColorNamed;
87
88 /**
89 * Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend,
90 * can reuse a previously allocated Color object for the result
91 */
92 blendColors(start: Color, end: Color, weight: number, obj?: Color): Color;
93
94 /**
95 * Returns a `Color` instance from a string of the form
96 * "rgb(...)" or "rgba(...)". Optionally accepts a `Color`
97 * object to update with the parsed value and return instead of
98 * creating a new object.
99 */
100 fromRgb(color: string, obj?: Color): Color;
101
102 /**
103 * Converts a hex string with a '#' prefix to a color object.
104 * Supports 12-bit #rgb shorthand. Optionally accepts a
105 * `Color` object to update with the parsed value.
106 */
107 fromHex(color: string, obj?: Color): Color;
108
109 /**
110 * Builds a `Color` from a 3 or 4 element array, mapping each
111 * element in sequence to the rgb(a) values of the color.
112 */
113 fromArray(color: ColorValue | ColorValueAlpha, obj?: Color): Color;
114
115 /**
116 * Parses `str` for a color value. Accepts hex, rgb, and rgba
117 * style color values.
118 */
119 fromString(str: string, obj?: Color): Color;
120 }
121
122 /* dojo/colors */
123
124 interface ColorNamed {
125 'aliceblue': ColorValue;
126 'antiquewhite': ColorValue;
127 'aquamarine': ColorValue;
128 'azure': ColorValue;
129 'beige': ColorValue;
130 'bisque': ColorValue;
131 'blanchedalmond': ColorValue;
132 'blueviolet': ColorValue;
133 'brown': ColorValue;
134 'burlywood': ColorValue;
135 'cadetblue': ColorValue;
136 'chartreuse': ColorValue;
137 'chocolate': ColorValue;
138 'coral': ColorValue;
139 'cornflowerblue': ColorValue;
140 'cornsilk': ColorValue;
141 'crimson': ColorValue;
142 'cyan': ColorValue;
143 'darkblue': ColorValue;
144 'darkcyan': ColorValue;
145 'darkgoldenrod': ColorValue;
146 'darkgray': ColorValue;
147 'darkgreen': ColorValue;
148 'darkgrey': ColorValue;
149 'darkkhaki': ColorValue;
150 'darkmagenta': ColorValue;
151 'darkolivegreen': ColorValue;
152 'darkorange': ColorValue;
153 'darkorchid': ColorValue;
154 'darkred': ColorValue;
155 'darksalmon': ColorValue;
156 'darkseagreen': ColorValue;
157 'darkslateblue': ColorValue;
158 'darkslategray': ColorValue;
159 'darkslategrey': ColorValue;
160 'darkturquoise': ColorValue;
161 'darkviolet': ColorValue;
162 'deeppink': ColorValue;
163 'deepskyblue': ColorValue;
164 'dimgray': ColorValue;
165 'dimgrey': ColorValue;
166 'dodgerblue': ColorValue;
167 'firebrick': ColorValue;
168 'floralwhite': ColorValue;
169 'forestgreen': ColorValue;
170 'gainsboro': ColorValue;
171 'ghostwhite': ColorValue;
172 'gold': ColorValue;
173 'goldenrod': ColorValue;
174 'greenyellow': ColorValue;
175 'grey': ColorValue;
176 'honeydew': ColorValue;
177 'hotpink': ColorValue;
178 'indianred': ColorValue;
179 'indigo': ColorValue;
180 'ivory': ColorValue;
181 'khaki': ColorValue;
182 'lavender': ColorValue;
183 'lavenderblush': ColorValue;
184 'lawngreen': ColorValue;
185 'lemonchiffon': ColorValue;
186 'lightblue': ColorValue;
187 'lightcoral': ColorValue;
188 'lightcyan': ColorValue;
189 'lightgoldenrodyellow': ColorValue;
190 'lightgray': ColorValue;
191 'lightgreen': ColorValue;
192 'lightgrey': ColorValue;
193 'lightpink': ColorValue;
194 'lightsalmon': ColorValue;
195 'lightseagreen': ColorValue;
196 'lightskyblue': ColorValue;
197 'lightslategray': ColorValue;
198 'lightslategrey': ColorValue;
199 'lightsteelblue': ColorValue;
200 'lightyellow': ColorValue;
201 'limegreen': ColorValue;
202 'linen': ColorValue;
203 'magenta': ColorValue;
204 'mediumaquamarine': ColorValue;
205 'mediumblue': ColorValue;
206 'mediumorchid': ColorValue;
207 'mediumpurple': ColorValue;
208 'mediumseagreen': ColorValue;
209 'mediumslateblue': ColorValue;
210 'mediumspringgreen': ColorValue;
211 'mediumturquoise': ColorValue;
212 'mediumvioletred': ColorValue;
213 'midnightblue': ColorValue;
214 'mintcream': ColorValue;
215 'mistyrose': ColorValue;
216 'moccasin': ColorValue;
217 'navajowhite': ColorValue;
218 'oldlace': ColorValue;
219 'olivedrab': ColorValue;
220 'orange': ColorValue;
221 'orangered': ColorValue;
222 'orchid': ColorValue;
223 'palegoldenrod': ColorValue;
224 'palegreen': ColorValue;
225 'paleturquoise': ColorValue;
226 'palevioletred': ColorValue;
227 'papayawhip': ColorValue;
228 'peachpuff': ColorValue;
229 'peru': ColorValue;
230 'pink': ColorValue;
231 'plum': ColorValue;
232 'powderblue': ColorValue;
233 'rosybrown': ColorValue;
234 'royalblue': ColorValue;
235 'saddlebrown': ColorValue;
236 'salmon': ColorValue;
237 'sandybrown': ColorValue;
238 'seagreen': ColorValue;
239 'seashell': ColorValue;
240 'sienna': ColorValue;
241 'skyblue': ColorValue;
242 'slateblue': ColorValue;
243 'slategray': ColorValue;
244 'slategrey': ColorValue;
245 'snow': ColorValue;
246 'springgreen': ColorValue;
247 'steelblue': ColorValue;
248 'tan': ColorValue;
249 'thistle': ColorValue;
250 'tomato': ColorValue;
251 'turquoise': ColorValue;
252 'violet': ColorValue;
253 'wheat': ColorValue;
254 'whitesmoke': ColorValue;
255 'yellowgreen': ColorValue;
256 }
257
258 interface ColorConstructor {
259 /**
260 * creates a greyscale color with an optional alpha
261 */
262 makeGrey(g: number, a?: number): Color;
263 }
264
265 }
266
267 type dojoColor = dojoColor.Color;
268 declare const dojoColor: dojoColor.ColorConstructor;
269 export = dojoColor;
@@ -0,0 +1,100
1 import DojoPromise = require("../promise/Promise");
2 import { PromiseCallback, PromiseErrback, PromiseProgback } from "../promise/Promise";
3
4 /* dojo/_base/Deferred */
5
6 interface Deferred<T> {
7
8 promise: DojoPromise<T>;
9
10 /**
11 * Checks whether the deferred has been resolved.
12 */
13 isResolved(): boolean;
14
15 /**
16 * Checks whether the deferred has been rejected.
17 */
18 isRejected(): boolean;
19
20 /**
21 * Checks whether the deferred has been resolved or rejected.
22 */
23 isFulfilled(): boolean;
24
25 /**
26 * Checks whether the deferred has been canceled.
27 */
28 isCanceled(): boolean;
29
30 /**
31 * Emit a progress update on the deferred.
32 */
33 progress(update: any, strict?: boolean): DojoPromise<T>;
34
35 /**
36 * Resolve the deferred.
37 */
38 resolve(value?: T, strict?: boolean): DojoPromise<T>;
39
40 /**
41 * Reject the deferred.
42 */
43 reject(error?: any, strict?: boolean): DojoPromise<T>;
44
45 /**
46 * The results of the Deferred
47 */
48 results: [T, any];
49
50 /**
51 * Adds callback and error callback for this deferred instance.
52 */
53 addCallbacks<U1, U2 = never>(callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>): Deferred<U1 | U2>;
54
55 /**
56 * Add new callbacks to the deferred.
57 */
58 then<U1, U2 = never>(callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>, progback?: PromiseProgback): DojoPromise<U1 | U2>;
59
60 /**
61 * Cancels the asynchronous operation
62 */
63 cancel(): void;
64
65 /**
66 * Adds successful callback for this deferred instance.
67 */
68 addCallback<U>(callback: PromiseCallback<T, U>): Deferred<U>;
69
70 /**
71 * Adds error callback for this deferred instance.
72 */
73 addErrback<U>(errback: PromiseErrback<U>): Deferred<U>;
74
75 /**
76 * Add handler as both successful callback and error callback for this deferred instance.
77 */
78 addBoth<U>(callback?: PromiseErrback<U>): Deferred<U>;
79
80 fired: number;
81 }
82
83 interface DeferredConstructor {
84 /**
85 * Deprecated. This module defines the legacy dojo/_base/Deferred API.
86 * New code should use dojo/Deferred instead.
87 */
88 new <T>(canceller?: (reason: any) => void): Deferred<T>;
89
90 prototype: Deferred<any>;
91
92 /**
93 * Transparently applies callbacks to values and/or promises.
94 */
95 when<T>(valueOrPromise: any): Deferred<T>;
96 when<T, U1, U2 = never>(valueOrPromise: any, callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>, progback?: PromiseProgback): Deferred<U1 | U2>;
97 }
98
99 declare const Deferred: DeferredConstructor;
100 export = Deferred; No newline at end of file
@@ -0,0 +1,90
1 import { NodeOrString } from "../interfaces";
2 import { CoordBox } from "./html";
3 import { NodeList as DojoNodeList, NodeListConstructor as DojoNodeListConstructor } from "../query";
4
5 declare module "../query" {
6 interface NodeList<T extends Node> {
7 /**
8 * Attach event handlers to every item of the NodeList. Uses dojo.connect()
9 * so event properties are normalized.
10 */
11 connect(method: string, objOrFunc: EventListener | string): this;
12 connect(method: string, objOrFunc: Object, funcName: string): this;
13
14 /**
15 * Deprecated: Use position() for border-box x/y/w/h
16 * or marginBox() for margin-box w/h/l/t.
17 * Returns the box objects of all elements in a node list as
18 * an Array (*not* a NodeList). Acts like `domGeom.coords`, though assumes
19 * the node passed is each node in this list.
20 */
21 coords(node: NodeOrString, includeScroll?: boolean): CoordBox[];
22
23 onblur(method: string, objOrFunc: EventListener | string): this;
24 onblur(method: string, objOrFunc: Object, funcName: string): this;
25
26 onfocus(method: string, objOrFunc: EventListener | string): this;
27 onfocus(method: string, objOrFunc: Object, funcName: string): this;
28
29 onchange(method: string, objOrFunc: EventListener | string): this;
30 onchange(method: string, objOrFunc: Object, funcName: string): this;
31
32 onclick(method: string, objOrFunc: EventListener | string): this;
33 onclick(method: string, objOrFunc: Object, funcName: string): this;
34
35 onerror(method: string, objOrFunc: EventListener | string): this;
36 onerror(method: string, objOrFunc: Object, funcName: string): this;
37
38 onkeydown(method: string, objOrFunc: EventListener | string): this;
39 onkeydown(method: string, objOrFunc: Object, funcName: string): this;
40
41 onkeypress(method: string, objOrFunc: EventListener | string): this;
42 onkeypress(method: string, objOrFunc: Object, funcName: string): this;
43
44 onkeyup(method: string, objOrFunc: EventListener | string): this;
45 onkeyup(method: string, objOrFunc: Object, funcName: string): this;
46
47 onload(method: string, objOrFunc: EventListener | string): this;
48 onload(method: string, objOrFunc: Object, funcName: string): this;
49
50 ondown(method: string, objOrFunc: EventListener | string): this;
51 ondown(method: string, objOrFunc: Object, funcName: string): this;
52
53 onmouseenter(method: string, objOrFunc: EventListener | string): this;
54 onmouseenter(method: string, objOrFunc: Object, funcName: string): this;
55
56 onmouseleave(method: string, objOrFunc: EventListener | string): this;
57 onmouseleave(method: string, objOrFunc: Object, funcName: string): this;
58
59 onmousemove(method: string, objOrFunc: EventListener | string): this;
60 onmousemove(method: string, objOrFunc: Object, funcName: string): this;
61
62 onmouseout(method: string, objOrFunc: EventListener | string): this;
63 onmouseout(method: string, objOrFunc: Object, funcName: string): this;
64
65 onmouseover(method: string, objOrFunc: EventListener | string): this;
66 onmouseover(method: string, objOrFunc: Object, funcName: string): this;
67
68 onmouseup(method: string, objOrFunc: EventListener | string): this;
69 onmouseup(method: string, objOrFunc: Object, funcName: string): this;
70
71 onsubmit(method: string, objOrFunc: EventListener | string): this;
72 onsubmit(method: string, objOrFunc: Object, funcName: string): this;
73 }
74
75 interface NodeListConstructor {
76 // "blur", "focus", "change", "click", "error", "keydown", "keypress",
77 // "keyup", "load", "mousedown", "mouseenter", "mouseleave", "mousemove",
78 // "mouseout", "mouseover", "mouseup", "submit"
79 events: string[];
80 }
81 }
82
83 declare module "./kernel" {
84 interface Dojo {
85 NodeList: DojoNodeListConstructor
86 }
87 }
88
89 declare const DojoNodeList: DojoNodeListConstructor;
90 export = DojoNodeList;
@@ -0,0 +1,55
1 import { GenericConstructor } from "../interfaces";
2
3 /* dojo/_base/array */
4 interface DojoArray {
5 /**
6 * Determines whether or not every item in arr satisfies the condition implemented by callback.
7 * @param {T[] | string} arr the array to iterate on. If a string, operates on individual characters.
8 * @param {Function | string} callback a function is invoked with three arguments: item, index, and
9 * array and returns true if the condition is met.
10 * @param {object} thisObj may be used to scope the call to callback
11 */
12 every<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
13
14 /**
15 * Determines whether or not any item in arr satisfies the condition implemented by callback.
16 */
17 some<T>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): boolean;
18
19 /**
20 * locates the last index of the provided value in the passed array. If the value is not found, -1
21 * is returned.
22 * @param {boolean} findLast Makes indexOf() work like lastIndexOf(). Used internally; not meant
23 * for external usage.
24 */
25 indexOf<T>(arr: T[], value: T, fromIndex?: number, findLast?: boolean): number;
26
27 /**
28 * locates the first index of the provided value in the passed array. If the value is not found,
29 * -1 is returned.
30 */
31 lastIndexOf<T>(arr: T[], value: T, fromIndex?: number): number;
32
33 /**
34 * locates the last index of the provided value in the passed array. If the value is not found,
35 * -1 is returned.
36 */
37 forEach<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => void), thisObj?: Object): void;
38
39 /**
40 * for every item in arr, callback is invoked. Return values are ignored. If you want to break
41 * out of the loop, consider using array.every() or array.some().
42 */
43 map<T, U>(arr: T[] | string, callback: string | ((item: T, idx: number, arr: T[]) => U), thisObj?: Object, Ctr?: GenericConstructor<U[]>): U[];
44
45 /**
46 * Returns a new Array with those items from arr that match the condition implemented by
47 * callback.
48 */
49 filter<T>(arr: T[], callback: string | ((item: T, idx: number, arr: T[]) => boolean), thisObj?: Object): T[];
50
51 clearCache(): void;
52 }
53
54 declare const dojoArray: DojoArray;
55 export = dojoArray;
@@ -0,0 +1,13
1 import "../ready";
2 import dojo = require("./kernel");
3 import "./connect"; // until we decide if connect is going back into non-browser environments
4 import "./unload";
5 import "./window";
6 import "./event";
7 import "./html";
8 import "./NodeList";
9 import"../query";
10 import "./xhr";
11 import "./fx";
12
13 export = dojo; No newline at end of file
@@ -0,0 +1,151
1 import { ColorValue, ColorValueAlpha } from "./Color";
2 import { HasCache } from "../has";
3 interface Config {
4 /** Defaults to `false`. If set to `true`, ensures that Dojo provides
5 * extended debugging feedback via Firebug. If Firebug is not available
6 * on your platform, setting `isDebug` to `true` will force Dojo to
7 * pull in (and display) the version of Firebug Lite which is
8 * integrated into the Dojo distribution, thereby always providing a
9 * debugging/logging console when `isDebug` is enabled. Note that
10 * Firebug's `console.*` methods are ALWAYS defined by Dojo. If
11 * `isDebug` is false and you are on a platform without Firebug, these
12 * methods will be defined as no-ops.
13 */
14 isDebug: boolean;
15
16 /**
17 * The locale to assume for loading localized resources in this page,
18 * specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
19 * Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
20 * See the documentation for `dojo.i18n` and `dojo.requireLocalization`
21 * for details on loading localized resources. If no locale is specified,
22 * Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
23 * or `navigator.language` properties.
24 */
25 locale: string;
26
27 /**
28 * No default value. Specifies additional locales whose
29 * resources should also be loaded alongside the default locale when
30 * calls to `dojo.requireLocalization()` are processed.
31 */
32 extraLocale: string[];
33
34 /**
35 * The directory in which `dojo.js` is located. Under normal
36 * conditions, Dojo auto-detects the correct location from which it
37 * was loaded. You may need to manually configure `baseUrl` in cases
38 * where you have renamed `dojo.js` or in which `<base>` tags confuse
39 * some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
40 * either the value of `djConfig.baseUrl` if one is provided or the
41 * auto-detected root if not. Other modules are located relative to
42 * this path. The path should end in a slash.
43 */
44 baseUrl: string;
45
46 /**
47 * A map of module names to paths relative to `dojo.baseUrl`. The
48 * key/value pairs correspond directly to the arguments which
49 * `dojo.registerModulePath` accepts. Specifying
50 * `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
51 * of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
52 * modules may be configured via `djConfig.modulePaths`.
53 */
54 modulePaths: { [mid: string]: string };
55
56 /**
57 * Adds a callback via dojo/ready. Useful when Dojo is added after
58 * the page loads and djConfig.afterOnLoad is true. Supports the same
59 * arguments as dojo/ready. When using a function reference, use
60 * `djConfig.addOnLoad = function(){};`. For object with function name use
61 * `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
62 * function reference use
63 * `djConfig.addOnLoad = [myObject, function(){}];`
64 */
65 addOnLoad: () => void | [any, string];
66
67 /**
68 * Run the parser after the page is loaded
69 */
70 parseOnLoad: boolean;
71
72 /**
73 * An array of module names to be loaded immediately after dojo.js has been included
74 * in a page.
75 */
76 require: string[];
77
78 /**
79 * Default duration, in milliseconds, for wipe and fade animations within dijits.
80 * Assigned to dijit.defaultDuration.
81 */
82 defaultDuration: number;
83
84 /**
85 * Used by some modules to configure an empty iframe. Used by dojo/io/iframe and
86 * dojo/back, and dijit/popup support in IE where an iframe is needed to make sure native
87 * controls do not bleed through the popups. Normally this configuration variable
88 * does not need to be set, except when using cross-domain/CDN Dojo builds.
89 * Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
90 * to the path on your domain your copy of blank.html.
91 */
92 dojoBlankHtmlUrl: string;
93
94 /**
95 * Set this to true to enable publishing of topics for the different phases of
96 * IO operations. Publishing is done via dojo/topic.publish(). See dojo/main.__IoPublish for a list
97 * of topics that are published.
98 */
99 ioPublish: boolean;
100
101 /**
102 * If set to a value that evaluates to true such as a string or array and
103 * isDebug is true and Firebug is not available or running, then it bypasses
104 * the creation of Firebug Lite allowing you to define your own console object.
105 */
106 useCustomLogger: any;
107
108 /**
109 * Array containing the r, g, b components used as transparent color in dojo.Color;
110 * if undefined, ColorValue (white) will be used.
111 */
112 transparentColor: ColorValue | ColorValueAlpha;
113
114 /**
115 * Defines dependencies to be used before the loader has been loaded.
116 * When provided, they cause the loader to execute require(deps, callback)
117 * once it has finished loading. Should be used with callback.
118 */
119 deps: () => string[] | string[];
120
121 /**
122 * Defines the cached has API variables
123 */
124 hasCache: HasCache;
125
126 /**
127 * Defines a callback to be used when dependencies are defined before
128 * the loader has been loaded. When provided, they cause the loader to
129 * execute require(deps, callback) once it has finished loading.
130 */
131 callback: (...args: any[]) => void;
132
133 /**
134 * Whether deferred instrumentation should be loaded or included
135 * in builds.
136 */
137 deferredInstrumentation: boolean;
138
139 /**
140 * Whether the deferred instrumentation should be used.
141 *
142 * * `"report-rejections"`: report each rejection as it occurs.
143 * * `true` or `1` or `"report-unhandled-rejections"`: wait 1 second
144 * in an attempt to detect unhandled rejections.
145 */
146 useDeferredInstrumentation: string | boolean | number;
147 }
148
149 type dojoConfig = Config;
150 declare const dojoConfig: Config;
151 export = dojoConfig; No newline at end of file
@@ -0,0 +1,49
1 import { Handle } from "../interfaces";
2
3 interface Connect {
4 /**
5 * TODO: Type this better
6 */
7 _keypress(object: any, listener: EventListener): Handle;
8
9 /**
10 * `dojo.connect` is a deprecated event handling and delegation method in
11 * Dojo. It allows one function to "listen in" on the execution of
12 * any other, triggering the second whenever the first is called. Many
13 * listeners may be attached to a function, and source functions may
14 * be either regular function calls or DOM events.
15 */
16 connect(obj: any, event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
17 connect(event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
18
19 /**
20 * Remove a link created by dojo.connect.
21 */
22 disconnect(handle: Handle): void;
23
24 /**
25 * Attach a listener to a named topic. The listener function is invoked whenever the
26 * named topic is published (see: dojo.publish).
27 * Returns a handle which is needed to unsubscribe this listener.
28 */
29 subscribe(topic: string, context: any, method: EventListener): Handle;
30
31 /**
32 * Invoke all listener method subscribed to topic.
33 */
34 publish(topic: string, args: any[]): boolean;
35
36 /**
37 * Ensure that every time obj.event() is called, a message is published
38 * on the topic. Returns a handle which can be passed to
39 * dojo.disconnect() to disable subsequent automatic publication on
40 * the topic.
41 */
42 connectPublisher(topic: string, obj: any, method: string): Handle;
43 connectPublisher(topic: string, method: EventListener): Handle;
44
45 /**
46 * Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
47 */
48 isCopyKey(e: Event): boolean;
49 } No newline at end of file
@@ -0,0 +1,140
1 declare namespace declare {
2 /* dojo/_base/declare */
3
4 /**
5 * dojo/_base/declare() returns a constructor `C`. `new C()` returns an Object with the following
6 * methods, in addition to the methods and properties specified via the arguments passed to declare().
7 */
8 interface DeclareCreatedObject {
9 declaredClass: string;
10
11 /**
12 * Calls a super method.
13 *
14 * This method is used inside method of classes produced with
15 * declare() to call a super method (next in the chain). It is
16 * used for manually controlled chaining. Consider using the regular
17 * chaining, because it is faster. Use "this.inherited()" only in
18 * complex cases.
19 *
20 * This method cannot me called from automatically chained
21 * constructors including the case of a special (legacy)
22 * constructor chaining. It cannot be called from chained methods.
23 *
24 * If "this.inherited()" cannot find the next-in-chain method, it
25 * does nothing and returns "undefined". The last method in chain
26 * can be a default method implemented in Object, which will be
27 * called last.
28 *
29 * If "name" is specified, it is assumed that the method that
30 * received "args" is the parent method for this call. It is looked
31 * up in the chain list and if it is found the next-in-chain method
32 * is called. If it is not found, the first-in-chain method is
33 * called.
34 *
35 * If "name" is not specified, it will be derived from the calling
36 * method (using a methoid property "nom").
37 */
38 inherited<U>(args: IArguments, newArgs?: any[]): U;
39 inherited(args: IArguments, newArgs?: true): Function | void;
40 inherited<U>(name: string, args: IArguments, newArgs?: any[]): U;
41 inherited(name: string, args: IArguments, newArgs?: true): Function | void;
42
43 /**
44 * Returns a super method.
45 *
46 * This method is a convenience method for "this.inherited()".
47 * It uses the same algorithm but instead of executing a super
48 * method, it returns it, or "undefined" if not found.
49 */
50 getInherited(args: IArguments): Function | void;
51 getInherited(name: string, args: IArguments): Function | void;
52
53 /**
54 * Checks the inheritance chain to see if it is inherited from this class.
55 *
56 * This method is used with instances of classes produced with
57 * declare() to determine of they support a certain interface or
58 * not. It models "instanceof" operator.
59 */
60 isInstanceOf(cls: any): boolean;
61 }
62
63 interface DeclareConstructor<T> {
64 new(...args: any[]): T & DeclareCreatedObject;
65 prototype: T;
66
67 /**
68 * Adds all properties and methods of source to constructor's
69 * prototype, making them available to all instances created with
70 * constructor. This method is specific to constructors created with
71 * declare().
72 *
73 * Adds source properties to the constructor's prototype. It can
74 * override existing properties.
75 *
76 * This method is similar to dojo.extend function, but it is specific
77 * to constructors produced by declare(). It is implemented
78 * using dojo.safeMixin, and it skips a constructor property,
79 * and properly decorates copied functions.
80 */
81 extend<U>(source: U): DeclareConstructor<T & U>;
82
83 /**
84 * Create a subclass of the declared class from a list of base classes.
85 *
86 * Create a constructor using a compact notation for inheritance and
87 * prototype extension.
88 *
89 * Mixin ancestors provide a type of multiple inheritance.
90 * Prototypes of mixin ancestors are copied to the new class:
91 * changes to mixin prototypes will not affect classes to which
92 * they have been mixed in.
93 */
94 createSubclass<U, V, X>(mixins: [DeclareConstructor<U>, DeclareConstructor<V>], props: X): DeclareConstructor<T & U & V & X>;
95 createSubclass<U, V>(mixins: [DeclareConstructor<U>], props: V): DeclareConstructor<T & U & V>;
96 createSubclass<U, V>(mixins: DeclareConstructor<U>, props: V): DeclareConstructor<T & U & V>;
97 createSubclass<U>(mixins: [DeclareConstructor<U>]): DeclareConstructor<T & U>;
98 createSubclass<U>(mixins: DeclareConstructor<U>): DeclareConstructor<T & U>;
99 createSubclass<U>(mixins: any, props: U): DeclareConstructor<T & U>;
100 }
101
102 /**
103 * Create a feature-rich constructor from compact notation.
104 */
105 interface Declare {
106 <A, B, C, D>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>]): DeclareConstructor<A & B & C & D>;
107 <A, B, C>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>]): DeclareConstructor<A & B & C>;
108 <A, B>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>]): DeclareConstructor<A & B>;
109 <A>(superClass: DeclareConstructor<A> | [DeclareConstructor<A>]): DeclareConstructor<A>;
110
111 <A, B, C, D, E>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>], props: E): DeclareConstructor<A & B & C & D & E>;
112 <A, B, C, D>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>], props: D): DeclareConstructor<A & B & C & D>;
113 <A, B, C>(superClass: [DeclareConstructor<A>, DeclareConstructor<B>], props: C): DeclareConstructor<A & B & C>;
114 <A, B>(superClass: DeclareConstructor<A> | [DeclareConstructor<A>], props: B): DeclareConstructor<A & B>;
115
116 <A, B, C, D>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>]): DeclareConstructor<A & B & C & D>;
117 <A, B, C>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>]): DeclareConstructor<A & B & C>;
118 <A, B>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>]): DeclareConstructor<A & B>;
119 <A>(className: string, superClass: DeclareConstructor<A> | [DeclareConstructor<A>]): DeclareConstructor<A>;
120
121 <A, B, C, D, E>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>, DeclareConstructor<D>], props: E): DeclareConstructor<A & B & C & D & E>;
122 <A, B, C, D>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>, DeclareConstructor<C>], props: D): DeclareConstructor<A & B & C & D>;
123 <A, B, C>(className: string, superClass: [DeclareConstructor<A>, DeclareConstructor<B>], props: C): DeclareConstructor<A & B & C>;
124 <A, B>(className: string, superClass: DeclareConstructor<A> | [DeclareConstructor<A>], props: B): DeclareConstructor<A & B>;
125
126 <A>(className: string, superClass: any, props: A): DeclareConstructor<A>;
127 (className: string, superClass: any): DeclareConstructor<any>;
128 <A>(superClass: any, props: A): DeclareConstructor<A>;
129 (superClass: any): DeclareConstructor<any>;
130
131 /**
132 * Mix in properties skipping a constructor and decorating functions
133 * like it is done by declare().
134 */
135 safeMixin<A, B>(target: A, source: B): A & B;
136 }
137 }
138
139 declare const declare: declare.Declare;
140 export = declare;
@@ -0,0 +1,22
1 /* dojo/_base/event */
2
3 /**
4 * This module defines dojo DOM event API. Usually you should use dojo/on, and evt.stopPropagation() +
5 * evt.preventDefault(), rather than this module.
6 */
7 interface EventModule {
8 /**
9 * normalizes properties on the event object including event
10 * bubbling methods, keystroke normalization, and x/y positions
11 */
12 fix(evt: Event, sender: Element): Event;
13
14 /**
15 * prevents propagation and clobbers the default action of the
16 * passed event
17 */
18 stop(evt: Event): void;
19 }
20
21 declare const dojoEvent: EventModule;
22 export = dojoEvent;
@@ -0,0 +1,218
1 import Evented = require("../Evented");
2
3 declare namespace fx {
4 /* dojo/_base/fx */
5
6 interface Line {
7 /**
8 * Returns the point on the line
9 * @param {number} n a floating point number greater than 0 and less than 1
10 */
11 getValue(n: number): number;
12 }
13
14 /**
15 * Object used to generate values from a start value to an end value
16 */
17 interface LineConstructor {
18 new(start: number, end: number): Line;
19 }
20
21 interface EasingFunction {
22 (n?: number): number;
23 }
24
25 interface Animation extends Evented {
26 /**
27 * The time in milliseconds the animation will take to run
28 */
29 duration: number;
30
31 /**
32 * A two element array of start and end values, or a `_Line` instance to be
33 * used in the Animation.
34 */
35 curve: Line | [number, number];
36
37 /**
38 * A Function to adjust the acceleration (or deceleration) of the progress
39 * across a _Line
40 */
41 easing?: EasingFunction;
42
43 /**
44 * The number of times to loop the animation
45 */
46 repeat: number;
47
48 /**
49 * the time in milliseconds to wait before advancing to next frame
50 * (used as a fps timer: 1000/rate = fps)
51 */
52 rate: number;
53
54 /**
55 * The time in milliseconds to wait before starting animation after it
56 * has been .play()'ed
57 */
58 delay?: number;
59
60 /**
61 * Synthetic event fired before a Animation begins playing (synchronous)
62 */
63 beforeBegin?: Event;
64
65 /**
66 * Synthetic event fired as a Animation begins playing (useful?)
67 */
68 onBegin?: Event;
69
70 /**
71 * Synthetic event fired at each interval of the Animation
72 */
73 onAnimate?: Event;
74
75 /**
76 * Synthetic event fired after the final frame of the Animation
77 */
78 onEnd?: Event;
79
80 /**
81 * Synthetic event fired any time the Animation is play()'ed
82 */
83 onPlay?: Event;
84
85 /**
86 * Synthetic event fired when the Animation is paused
87 */
88 onPause?: Event;
89
90 /**
91 * Synthetic event fires when the Animation is stopped
92 */
93 onStop?: Event;
94
95 _precent: number;
96 _startRepeatCount: number;
97 _getStep(): number;
98
99 /**
100 * Convenience function. Fire event "evt" and pass it the
101 * arguments specified in "args".
102 */
103 _fire(evt: Event, args?: any[]): this;
104
105 /**
106 * Start the animation.
107 */
108 play(delay?: number, gotoStart?: boolean): this;
109
110 _play(gotoStart?: boolean): this;
111
112 /**
113 * Pauses a running animation.
114 */
115 pause(): this;
116
117 /**
118 * Sets the progress of the animation.
119 */
120 gotoPercent(precent: number, andPlay?: boolean): this;
121
122 /**
123 * Stops a running animation.
124 */
125 stop(gotoEnd?: boolean): Animation;
126
127 /**
128 * cleanup the animation
129 */
130 destroy(): void;
131
132 /**
133 * Returns a string token representation of the status of
134 * the animation, one of: "paused", "playing", "stopped"
135 */
136 status(): string;
137
138 _cycle(): Animation;
139 _clearTimer(): void;
140 _startTimer(): void;
141 _stopTimer(): void;
142 }
143
144 /**
145 * A generic animation class that fires callbacks into its handlers
146 * object at various states.
147 */
148 interface AnimationConstructor {
149 new(args: any): Animation;
150 prototype: Animation;
151 }
152
153 interface AnimationCallback {
154 (node: HTMLElement): void;
155 }
156
157 interface FadeArguments {
158 node: HTMLElement | string;
159 duration?: number;
160 easing?: EasingFunction;
161
162 start?: Function;
163 end?: Function;
164 }
165
166 interface AnimationArgumentsProperties {
167 [name: string]: any;
168 }
169
170 interface AnimationArguments extends FadeArguments {
171 properties?: AnimationArgumentsProperties;
172 onEnd?: AnimationCallback;
173 }
174
175 interface Fx {
176 _Line: LineConstructor;
177
178 Animation: AnimationConstructor;
179
180 _fade(args: any): Animation;
181
182 /**
183 * Returns an animation that will fade node defined in 'args' from
184 * its current opacity to fully opaque.
185 */
186 fadeIn(args: FadeArguments): Animation;
187
188 /**
189 * Returns an animation that will fade node defined in 'args'
190 * from its current opacity to fully transparent.
191 */
192 fadeOut(args: FadeArguments): Animation;
193
194 _defaultEasing(n?: number): number;
195
196 /**
197 * Returns an animation that will transition the properties of
198 * node defined in `args` depending how they are defined in
199 * `args.properties`
200 */
201 animateProperty(args: AnimationArguments): Animation;
202
203 /**
204 * A simpler interface to `animateProperty()`, also returns
205 * an instance of `Animation` but begins the animation
206 * immediately, unlike nearly every other Dojo animation API.
207 */
208 anim(
209 node: HTMLElement | string,
210 properties: { [name: string]: any },
211 duration?: number,
212 easing?: Function,
213 onEnd?: AnimationCallback,
214 delay?: number): Animation;
215 }
216 }
217 declare const fx: fx.Fx;
218 export = fx;
@@ -0,0 +1,312
1 // TODO: extension
2 import { NodeOrString, ElementOrString, NodeFragmentOrString, GenericObject } from "../interfaces";
3 import dojo = require("./kernel");
4 import { DomGeometryBox, Point, DomGeometryBoxExtents, DomGeometryWidthHeight, DomGeometryXYBox } from "../dom-geometry";
5 import { DomComputedStyle } from "../dom-style";
6
7 declare module "./kernel" {
8 interface CoordBox extends DomGeometryBox, Point { }
9
10 interface Dojo {
11 /**
12 * Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
13 * if not found. Internally if `id` is not a string then `id` returned.
14 */
15 byId(id: string, doc?: Document): Element;
16
17 /**
18 * Returns true if node is a descendant of ancestor
19 */
20 isDescendant(node: NodeOrString, ancestor: NodeOrString): boolean;
21
22 /**
23 * Enable or disable selection on a node
24 */
25 setSelectable(node: ElementOrString, selectable?: boolean): void;
26
27 /**
28 * Returns true if the requested attribute is specified on the
29 * given element, and false otherwise.
30 */
31 hasAttr(node: NodeOrString, name: string): boolean;
32
33 /**
34 * Gets an attribute on an HTML element.
35 * Because sometimes this uses node.getAttribute, it should be a string,
36 * but it can also get any other attribute on a node, therefore it is unsafe
37 * to type just a string.
38 */
39 getAttr(node: ElementOrString, name: string): any;
40
41 /**
42 * Sets an attribute on an HTML element.
43 */
44 setAttr(node: ElementOrString, name: string, value: any): Element;
45 setAttr(node: ElementOrString, map: Object): Element;
46
47 /**
48 * Removes an attribute from an HTML element.
49 */
50 removeAttr(node: NodeOrString, name: string): void;
51
52 /**
53 * Returns an effective value of a property or an attribute.
54 */
55 getNodeProp(node: NodeOrString, name: string): any;
56
57 /**
58 * Gets or sets an attribute on an HTML element.
59 */
60 attr(node: NodeOrString, name: string): any;
61 attr(node: NodeOrString, map: Object): Element;
62 attr(node: NodeOrString, name: string, value: any): Element;
63
64 /**
65 * Returns whether or not the specified classes are a portion of the
66 * class list currently applied to the node.
67 */
68 containsClass(node: NodeOrString, classStr: string): boolean;
69
70 /**
71 * Adds the specified classes to the end of the class list on the
72 * passed node. Will not re-apply duplicate classes.
73 */
74 addClass(node: NodeOrString, classStr: string | string[]): void;
75
76 /**
77 * Removes the specified classes from node. No `contains()`
78 * check is required.
79 */
80 removeClass(node: NodeOrString, classStr?: string | string[]): void;
81
82 /**
83 * Replaces one or more classes on a node if not present.
84 * Operates more quickly than calling dojo.removeClass and dojo.addClass
85 */
86 replaceClass(node: NodeOrString, addClassStr: string | string[], removeClassStr?: string | string[]): void;
87
88 /**
89 * Adds a class to node if not present, or removes if present.
90 * Pass a boolean condition if you want to explicitly add or remove.
91 * Returns the condition that was specified directly or indirectly.
92 */
93 toggleClass(node: NodeOrString, classStr: string | string[], condition?: boolean): boolean;
94
95 /**
96 * instantiates an HTML fragment returning the corresponding DOM.
97 */
98 toDom(frag: string, doc?: Document): DocumentFragment | Node;
99
100 _toDom(frag: string, doc?: Document): DocumentFragment | Node;
101
102 /**
103 * Attempt to insert node into the DOM, choosing from various positioning options.
104 * Returns the first argument resolved to a DOM node.
105 */
106 place(node: NodeFragmentOrString, refNode: NodeOrString, position?: string /* PosString */ | number): HTMLElement;
107
108 /**
109 * Create an element, allowing for optional attribute decoration
110 * and placement.
111 */
112 create(tag: NodeOrString, attrs?: GenericObject, refNode?: NodeOrString, pos?: string /* PosString */ | number): HTMLElement;
113
114 /**
115 * safely removes all children of the node.
116 */
117 empty(node: NodeOrString): void;
118
119 /**
120 * Removes a node from its parent, clobbering it and all of its
121 * children.
122 */
123 destroy(node: NodeOrString): void;
124
125 _destroyElement(node: NodeOrString): void;
126
127 /**
128 * Returns object with special values specifically useful for node
129 * fitting.
130 */
131 getPadExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
132
133 _getPadExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
134
135 /**
136 * returns an object with properties useful for noting the border
137 * dimensions.
138 */
139 getBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
140
141 _getBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
142
143 /**
144 * Returns object with properties useful for box fitting with
145 * regards to padding.
146 */
147 getPadBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
148
149 _getPadBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
150
151 /**
152 * returns object with properties useful for box fitting with
153 * regards to box margins (i.e., the outer-box).
154 * - l/t = marginLeft, marginTop, respectively
155 * - w = total width, margin inclusive
156 * - h = total height, margin inclusive
157 * The w/h are used for calculating boxes.
158 * Normally application code will not need to invoke this
159 * directly, and will use the ...box... functions instead.
160 */
161 getMarginExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
162
163 _getMarginExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
164
165 /**
166 * returns an object that encodes the width, height, left and top
167 * positions of the node's margin box.
168 */
169 getMarginBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
170
171 _getMarginBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
172
173 /**
174 * Returns an object that encodes the width, height, left and top
175 * positions of the node's content box, irrespective of the
176 * current box model.
177 */
178 getContentBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
179
180 _getContentBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
181
182 /**
183 * Sets the size of the node's contents, irrespective of margins,
184 * padding, or borders.
185 */
186 setContentSize(node: Element, box: DomGeometryWidthHeight, computedStyle?: DomComputedStyle): void;
187
188 /**
189 * sets the size of the node's margin box and placement
190 * (left/top), irrespective of box model. Think of it as a
191 * passthrough to setBox that handles box-model vagaries for
192 * you.
193 */
194 setMarginBox(node: Element, box: DomGeometryBox, computedStyle?: DomComputedStyle): void;
195
196 /**
197 * Returns true if the current language is left-to-right, and false otherwise.
198 */
199 isBodyLtr(doc?: Document): boolean;
200
201 _isBodyLtr(doc?: Document): boolean;
202
203 /**
204 * Returns an object with {node, x, y} with corresponding offsets.
205 */
206 docScroll(doc?: Document): Point;
207
208 _docScroll(doc?: Document): Point;
209
210 /**
211 * Deprecated method previously used for IE6-IE7. Now, just returns `{x:0, y:0}`.
212 */
213 getIeDocumentElementOffset(doc: Document): Point;
214
215 _getIeDocumentElementOffset(doc: Document): Point;
216
217 /**
218 * In RTL direction, scrollLeft should be a negative value, but IE
219 * returns a positive one. All codes using documentElement.scrollLeft
220 * must call this function to fix this error, otherwise the position
221 * will offset to right when there is a horizontal scrollbar.
222 */
223 fixIeBiDiScrollLeft(scrollLeft: number, doc?: Document): number;
224
225 _fixIeBiDiScrollLeft(scrollLeft: number, doc?: Document): number;
226
227 /**
228 * Gets the position and size of the passed element relative to
229 * the viewport (if includeScroll==false), or relative to the
230 * document root (if includeScroll==true).
231 */
232 position(node: Element, includeScroll?: boolean): DomGeometryXYBox;
233
234 /**
235 * returns an object that encodes the width and height of
236 * the node's margin box
237 */
238 getMarginSize(node: Element, computedStyle?: DomComputedStyle): DomGeometryWidthHeight;
239
240 _getMarginSize(node: Element, computedStyle?: DomComputedStyle): DomGeometryWidthHeight;
241
242 /**
243 * Getter/setter for the margin-box of node.
244 */
245 marginBox(node: Element): DomGeometryBox;
246 marginBox(node: Element, box: DomGeometryBox): void;
247
248 /**
249 * Getter/setter for the content-box of node.
250 */
251 contentBox(node: Element): DomGeometryBox;
252 contentBox(node: Element, box: DomGeometryWidthHeight): void;
253
254 /**
255 * Deprecated: Use position() for border-box x/y/w/h
256 * or marginBox() for margin-box w/h/l/t.
257 */
258 coords(node: NodeOrString, includeScroll?: boolean): CoordBox;
259
260 /**
261 * Gets a property on an HTML element.
262 */
263 getProp(node: ElementOrString, name: string): any;
264
265 /**
266 * Sets a property on an HTML element.
267 */
268 setProp(node: ElementOrString, name: string | Object, value?: any): Element;
269
270 /**
271 * Gets or sets a property on an HTML element.
272 */
273 prop(node: ElementOrString, name: string): string;
274 prop(node: ElementOrString, name: Object): Element;
275 prop(node: ElementOrString, name: string, value: any): Element;
276
277 /**
278 * Returns a "computed style" object.
279 */
280 getComputedStyle(node: Node): DomComputedStyle;
281
282 /**
283 * Accesses styles on a node.
284 */
285 getStyle(node: ElementOrString): DomComputedStyle;
286 getStyle(node: ElementOrString, name: string): string | number;
287
288 /**
289 * Sets styles on a node.
290 */
291 setStyle(node: ElementOrString, name: string | DomComputedStyle, value?: string): DomComputedStyle;
292
293 /**
294 * converts style value to pixels on IE or return a numeric value.
295 */
296 toPixelValue(element: Element, value: string): number;
297
298 __toPixelValue(element: Element, value: string): number;
299
300 /**
301 * Accesses styles on a node. If 2 arguments are
302 * passed, acts as a getter. If 3 arguments are passed, acts
303 * as a setter.
304 */
305 style(node: ElementOrString): DomComputedStyle;
306 style(node: ElementOrString, name: string): string | number;
307 style(node: ElementOrString, name: DomComputedStyle): DomComputedStyle;
308 style(node: ElementOrString, name: string, value: string): DomComputedStyle;
309 }
310 }
311
312 export = dojo;
@@ -0,0 +1,19
1 /* dojo/_base/json */
2 import dojo = require("./kernel");
3
4 declare module "./kernel" {
5 interface Dojo {
6 /**
7 * Parses a JavaScript expression and returns a JavaScript value.
8 */
9 fromJson(js: string): any;
10
11 _escapeString(value: any, replacer?: (key: string, value: any) => any | any[], space?: string | number): string;
12
13 toJsonIndentStr: string;
14
15 toJson(it: any, prettyPrint?: boolean): string;
16 }
17 }
18
19 export = dojo;
@@ -0,0 +1,75
1 /* dojo/_base/kernel */
2 import Config = require('./config');
3
4 declare namespace dojo {
5 interface Dijit {
6
7 }
8 interface Dojox {
9
10 }
11
12 interface Dojo {
13 config: Config;
14 global: any;
15
16 // TODO: dojot, dojox
17 dijit: Dijit;
18 dojox: Dojox;
19
20 /**
21 * a map from a name used in a legacy module to the (global variable name, object addressed by that name)
22 * always map dojo, dijit, and dojox
23 */
24 scopeMap: {
25 [scope: string]: [string, any];
26 dojo: [string, Dojo];
27 dijit: [string, Dijit];
28 dojox: [string, Dojox];
29 };
30
31 baseUrl: string;
32 isAsync: boolean;
33 locale: string;
34 version: {
35 major: number;
36 minor: number;
37 patch: number;
38 flag: string;
39 revision: number;
40 toString(): string;
41 };
42
43 /**
44 * A legacy method created for use exclusively by internal Dojo methods. Do not use this method
45 * directly unless you understand its possibly-different implications on the platforms your are targeting.
46 */
47 eval(scriptText: string): any;
48
49 exit(exitcode?: number): void;
50
51 /**
52 * Log a debug message to indicate that a behavior has been
53 * deprecated.
54 */
55 deprecated(behaviour: string, extra?: string, removal?: string): void;
56
57 /**
58 * Marks code as experimental.
59 */
60 experimental(moduleName: string, extra?: string): void;
61
62 /**
63 * Returns a URL relative to a module.
64 */
65 moduleUrl(module: string, url?: string): any;
66
67 /**
68 * for backward compatibility with layers built with 1.6 tooling
69 */
70 _hasResource: any;
71 }
72 }
73
74 declare const dojo: dojo.Dojo;
75 export = dojo;
@@ -0,0 +1,143
1 import { GenericConstructor, GenericObject } from "../interfaces";
2
3 declare namespace dojoLang {
4 /* dojo/_base/lang */
5
6 interface ReplaceCallback {
7 (match: string, name: string, offset: number, tmpl: string): string;
8 }
9
10 interface Lang {
11 /**
12 * Lists property names that must be explicitly processed during for-in iteration
13 * in environments that have has("bug-for-in-skips-shadowed") true.
14 */
15 _extraNames: string[];
16
17 /**
18 * Copies/adds all properties of one or more sources to dest; returns dest.
19 */
20 _mixin<T, U>(dest: T, source: U, copyFunc?: (s: any) => any): T & U;
21
22 /**
23 * Copies/adds all properties of one or more sources to dest; returns dest.
24 */
25 mixin<T, U>(dest: T, sources: U): T & U;
26 mixin<T, U, V>(dest: T, source1: U, source2: V): T & U & V;
27 mixin<T, U, V, W>(dest: T, source1: U, source2: V, source3: W): T & U & V & W;
28 mixin<T, U, V, W, X>(dest: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X;
29 mixin<T, U, V, W, X, Y>(dest: T, source1: U, source2: V, source3: W, source4: X, source5: Y): T & U & V & W & X & Y;
30 mixin<T, U, V, W, X, Y, Z>(dest: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z;
31 mixin<T, U>(dest: T, ...sources: U[]): T & U;
32
33 /**
34 * Set a property from a dot-separated string, such as "A.B.C"
35 */
36 setObject(name: string, value: any, context?: any): any;
37
38 /**
39 * Get a property from a dot-separated string, such as "A.B.C"
40 */
41 getObject<T>(name: string, create?: boolean, context?: any): T;
42
43 /**
44 * determine if an object supports a given method
45 */
46 exists(name: string, obj?: any): boolean;
47
48 /**
49 * Return true if it is a String
50 */
51 isString(it: any): it is string;
52
53 /**
54 * Return true if it is an Array.
55 */
56 isArray(it: any): it is any[];
57
58 /**
59 * Return true if it is a Function
60 */
61 isFunction(it: any): it is Function;
62
63 /**
64 * Returns true if it is a JavaScript object (or an Array, a Function
65 * or null)
66 */
67 isObject(it: any): it is { [id: string]: any; };
68
69 /**
70 * similar to isArray() but more permissive
71 */
72 isArrayLike(it: any): boolean;
73
74 /**
75 * Returns true if it is a built-in function or some other kind of
76 * oddball that *should* report as a function but doesn't
77 */
78 isAlien(it: any): boolean;
79
80 /**
81 * Adds all properties and methods of props to constructor's
82 * prototype, making them available to all instances created with
83 * constructor.
84 */
85 extend<T, U>(ctor: GenericConstructor<T>, props: U): GenericConstructor<T & U>;
86
87 _hitchArgs<T extends Function>(scope: any, method: T): T;
88
89 /**
90 * Returns a function that will only ever execute in the given scope.
91 * This allows for easy use of object member functions
92 * in callbacks and other places in which the "this" keyword may
93 * otherwise not reference the expected scope.
94 * Any number of default positional arguments may be passed as parameters
95 * beyond "method".
96 * Each of these values will be used to "placehold" (similar to curry)
97 * for the hitched function.
98 */
99 hitch(method: string): Function;
100 hitch<T extends Function>(method: T): T;
101 hitch<T extends Function>(scope: any, method: T): T;
102 hitch<T extends Function>(scope: any, method: string | Function, ...args: any[]): T;
103
104 /**
105 * Returns a new object which "looks" to obj for properties which it
106 * does not have a value for. Optionally takes a bag of properties to
107 * seed the returned object with initially.
108 */
109 delegate<T, U>(obj: T, props?: U): T & U;
110
111 /**
112 * Converts an array-like object (i.e. arguments, DOMCollection) to an
113 * array. Returns a new Array with the elements of obj.
114 */
115 _toArray(obj: any, offset?: number, startWith?: any[]): any[];
116
117 /**
118 * similar to hitch() except that the scope object is left to be
119 * whatever the execution context eventually becomes.
120 */
121 partial<U extends Function>(method: Function | string, ...args: any[]): U;
122
123 /**
124 * Clones objects (including DOM nodes) and all children.
125 * Warning: do not clone cyclic structures.
126 */
127 clone<T>(src: T): T;
128
129 /**
130 * Trims whitespace from both sides of the string
131 */
132 trim(str: string): string;
133
134 /**
135 * Performs parameterized substitutions on a string. Throws an
136 * exception if any parameter is unmatched.
137 */
138 replace(tmpl: string, map: GenericObject | ReplaceCallback, pattern?: RegExp): string;
139 }
140 }
141
142 declare const dojoLang: dojoLang.Lang;
143 export = dojoLang;
@@ -0,0 +1,9
1 interface Loader {
2 extractLegacyApiApplications(text: string, noCommentText?: string): any;
3 require(mid: string, require: any, loaded: (...modules: any[]) => void): void;
4 loadInit(mid: string, require: any, loaded: (...modules: any[]) => void): void;
5 }
6
7 type dojoLoader = Loader;
8 declare const dojoLoader: Loader;
9 export = dojoLoader; No newline at end of file
@@ -0,0 +1,4
1 import query = require("../query");
2 import "./NodeList";
3
4 export = query; No newline at end of file
@@ -0,0 +1,95
1 import dojo = require("./kernel");
2
3 declare module "./kernel" {
4
5 interface Dojo {
6 /**
7 * True if the client is a web-browser
8 */
9 isBrowser: boolean;
10
11 /**
12 * Version as a Number if client is FireFox. undefined otherwise. Corresponds to
13 * major detected FireFox version (1.5, 2, 3, etc.)
14 */
15 isFF: number;
16
17 /**
18 * Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to
19 * major detected IE version (6, 7, 8, etc.)
20 */
21 isIE: number;
22
23 /**
24 * Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major
25 * detected version.
26 */
27 isKhtml: number;
28
29 /**
30 * Version as a Number if client is a WebKit-derived browser (Konqueror,
31 * Safari, Chrome, etc.). undefined otherwise.
32 */
33 isWebKit: number;
34
35 /**
36 * Version as a Number if client is a Mozilla-based browser (Firefox,
37 * SeaMonkey). undefined otherwise. Corresponds to major detected version.
38 */
39 isMozilla: number;
40
41 /**
42 * Version as a Number if client is a Mozilla-based browser (Firefox,
43 * SeaMonkey). undefined otherwise. Corresponds to major detected version.
44 */
45 isMoz: number;
46
47 /**
48 * Version as a Number if client is Opera. undefined otherwise. Corresponds to
49 * major detected version.
50 */
51 isOpera: number;
52
53 /**
54 * Version as a Number if client is Safari or iPhone. undefined otherwise.
55 */
56 isSafari: number;
57
58 /**
59 * Version as a Number if client is Chrome browser. undefined otherwise.
60 */
61 isChrome: number;
62
63 /**
64 * True if the client runs on Mac
65 */
66 isMac: number;
67
68 /**
69 * Version as a Number if client is iPhone, iPod, or iPad. undefined otherwise.
70 */
71 isIos: number;
72
73 /**
74 * Version as a Number if client is android browser. undefined otherwise.
75 */
76 isAndroid: number;
77
78 /**
79 * True if client is Wii
80 */
81 isWii: boolean;
82
83 /**
84 * Page is in quirks mode.
85 */
86 isQuirks: boolean;
87
88 /**
89 * True if client is Adobe Air
90 */
91 isAir: boolean;
92 }
93 }
94
95 export = dojo;
@@ -0,0 +1,34
1 import { GenericObject } from "../interfaces";
2
3 interface Unload {
4 /**
5 * Registers a function to be triggered when window.onunload fires.
6 * Deprecated, use on(window, "unload", lang.hitch(obj, functionName)) instead.
7 */
8 addOnWindowUnload(obj: GenericObject | Function, functionName?: string | Function): void;
9
10 /**
11 * Registers a function to be triggered when the page unloads.
12 * Deprecated, use on(window, "beforeunload", lang.hitch(obj, functionName))
13 */
14 addOnUnload(obj: GenericObject | Function, functionName?: string | Function): void;
15 }
16
17 declare module "./kernel" {
18 interface Dojo {
19 /**
20 * Registers a function to be triggered when window.onunload fires.
21 * Deprecated, use on(window, "unload", lang.hitch(obj, functionName)) instead.
22 */
23 addOnWindowUnload(obj: GenericObject | Function, functionName?: string | Function): void;
24
25 /**
26 * Registers a function to be triggered when the page unloads.
27 * Deprecated, use on(window, "beforeunload", lang.hitch(obj, functionName))
28 */
29 addOnUnload(obj: GenericObject | Function, functionName?: string | Function): void;
30 }
31 }
32
33 declare const Unload: Unload;
34 export = Unload; No newline at end of file
@@ -0,0 +1,27
1 interface Url {
2 uri: string;
3 scheme: string;
4 authority: string;
5 path: string;
6 query: string;
7 fragment: string;
8 user?: string;
9 password?: string;
10 host?: string;
11 port?: string;
12 toString(): string;
13 }
14
15 interface UrlConstructor {
16 new (...args: any[]): Url;
17 prototype: Url;
18 }
19
20 declare module "./kernel" {
21 interface Dojo {
22 _Url: UrlConstructor
23 }
24 }
25
26 declare const Url: UrlConstructor;
27 export = Url;
@@ -0,0 +1,84
1 import { GenericFunction, GenericObject } from "../interfaces";
2
3 interface DojoWindow {
4 /**
5 * Alias for the current window. 'global' can be modified
6 * for temporary context shifting. See also withGlobal().
7 */
8 global: any;
9
10 /**
11 * Alias for the current document. 'doc' can be modified
12 * for temporary context shifting. See also withDoc().
13 */
14 doc: Document;
15
16 /**
17 * Return the body element of the specified document or of dojo/_base/window::doc.
18 */
19 body(doc?: Document): HTMLBodyElement;
20
21 /**
22 * changes the behavior of many core Dojo functions that deal with
23 * namespace and DOM lookup, changing them to work in a new global
24 * context (e.g., an iframe). The varibles dojo.global and dojo.doc
25 * are modified as a result of calling this function and the result of
26 * `dojo.body()` likewise differs.
27 */
28 setContext(globalObject: GenericObject, globalDocument: Document): void;
29
30 /**
31 * Invoke callback with globalObject as dojo.global and
32 * globalObject.document as dojo.doc.
33 */
34 withGlobal<T>(globalObject: GenericObject, callback: GenericFunction<T>, thisObject?: Object, cbArguments?: any[]): T;
35
36 /**
37 * Invoke callback with documentObject as dojo/_base/window::doc.
38 */
39 withDoc<T>(documentObject: Document, callback: GenericFunction<T>, thisObject?: Object, cbArguments?: any[]): T;
40 }
41
42 declare module "./kernel" {
43 interface Dojo {
44 /**
45 * Alias for the current window. 'global' can be modified
46 * for temporary context shifting. See also withGlobal().
47 */
48 global: any;
49
50 /**
51 * Alias for the current document. 'doc' can be modified
52 * for temporary context shifting. See also withDoc().
53 */
54 doc: Document;
55
56 /**
57 * Return the body element of the specified document or of dojo/_base/window::doc.
58 */
59 body(doc?: Document): HTMLBodyElement;
60
61 /**
62 * changes the behavior of many core Dojo functions that deal with
63 * namespace and DOM lookup, changing them to work in a new global
64 * context (e.g., an iframe). The varibles dojo.global and dojo.doc
65 * are modified as a result of calling this function and the result of
66 * `dojo.body()` likewise differs.
67 */
68 setContext(globalObject: GenericObject, globalDocument: Document): void;
69
70 /**
71 * Invoke callback with globalObject as dojo.global and
72 * globalObject.document as dojo.doc.
73 */
74 withGlobal<T>(globalObject: GenericObject, callback: GenericFunction<T>, thisObject?: Object, cbArguments?: any[]): T;
75
76 /**
77 * Invoke callback with documentObject as dojo/_base/window::doc.
78 */
79 withDoc<T>(documentObject: Document, callback: GenericFunction<T>, thisObject?: Object, cbArguments?: any[]): T;
80 }
81 }
82
83 declare const dojoWindow: DojoWindow;
84 export = dojoWindow; No newline at end of file
@@ -0,0 +1,288
1 import { GenericObject } from "../interfaces";
2 import DojoPromise = require("../promise/Promise");
3 import { XhrBaseOptions, DojoRequestPromise } from "../request";
4 import Deferred = require("./Deferred");
5
6 declare namespace xhr {
7 interface IoArgs {
8 /**
9 * URL to server endpoint.
10 */
11 url: string;
12
13 /**
14 * Contains properties with string values. These
15 * properties will be serialized as name1=value2 and
16 * passed in the request.
17 */
18 content?: GenericObject;
19
20 /**
21 * Milliseconds to wait for the response. If this time
22 * passes, the then error callbacks are called.
23 */
24 timeout?: number;
25
26 /**
27 * DOM node for a form. Used to extract the form values
28 * and send to the server.
29 */
30 form?: HTMLFormElement;
31
32 /**
33 * Default is false. If true, then a
34 * "dojo.preventCache" parameter is sent in the requesa
35 * with a value that changes with each requesa
36 * (timestamp). Useful only with GET-type requests.
37 */
38 preventCache?: boolean;
39
40 /**
41 * Acceptable values depend on the type of IO
42 * transport (see specific IO calls for more information).
43 */
44 handleAs?: string;
45
46 /**
47 * Sets the raw body for an HTTP request. If this is used, then the content
48 * property is ignored. This is mostly useful for HTTP methods that have
49 * a body to their requests, like PUT or POST. This property can be used instead
50 * of postData and putData for dojo/_base/xhr.rawXhrPost and dojo/_base/xhr.rawXhrPut respectively.
51 */
52 rawBody?: string;
53
54 /**
55 * Set this explicitly to false to prevent publishing of topics related to
56 * IO operations. Otherwise, if djConfig.ioPublish is set to true, topics
57 * will be published via dojo/topic.publish() for different phases of an IO operation.
58 * See dojo/main.__IoPublish for a list of topics that are published.
59 */
60 ioPublish?: boolean;
61
62 /**
63 * This function will be
64 * called on a successful HTTP response code.
65 */
66 load?: (response: any, ioArgs: IoCallbackArgs) => void;
67
68 /**
69 * This function will
70 * be called when the request fails due to a network or server error, the url
71 * is invalid, etc. It will also be called if the load or handle callback throws an
72 * exception, unless djConfig.debugAtAllCosts is true. This allows deployed applications
73 * to continue to run even when a logic error happens in the callback, while making
74 * it easier to troubleshoot while in debug mode.
75 */
76 error?: (response: any, ioArgs: IoCallbackArgs) => void;
77
78 /**
79 * This function will
80 * be called at the end of every request, whether or not an error occurs.
81 */
82 handle?: (loadOrError: string, response: any, ioArgs: IoCallbackArgs) => void;
83 }
84
85 interface IoCallbackArgs {
86 /**
87 * the original object argument to the IO call.
88 */
89 args: GenericObject;
90
91 /**
92 * For XMLHttpRequest calls only, the
93 * XMLHttpRequest object that was used for the
94 * request.
95 */
96 xhr: XMLHttpRequest;
97
98 /**
99 * The final URL used for the call. Many times it
100 * will be different than the original args.url
101 * value.
102 */
103 url: string;
104
105 /**
106 * For non-GET requests, the
107 * name1=value1&name2=value2 parameters sent up in
108 * the request.
109 */
110 query: string;
111
112 /**
113 * The final indicator on how the response will be
114 * handled.
115 */
116 handleAs: string;
117
118 /**
119 * For dojo/io/script calls only, the internal
120 * script ID used for the request.
121 */
122 id?: string;
123
124 /**
125 * For dojo/io/script calls only, indicates
126 * whether the script tag that represents the
127 * request can be deleted after callbacks have
128 * been called. Used internally to know when
129 * cleanup can happen on JSONP-type requests.
130 */
131 canDelete?: boolean;
132
133 /**
134 * For dojo/io/script calls only: holds the JSON
135 * response for JSONP-type requests. Used
136 * internally to hold on to the JSON responses.
137 * You should not need to access it directly --
138 * the same object should be passed to the success
139 * callbacks directly.
140 */
141 json?: GenericObject;
142 }
143
144 interface XhrArgs extends IoArgs {
145 /**
146 * Acceptable values are: text (default), json, json-comment-optional,
147 * json-comment-filtered, javascript, xml. See `dojo/_base/xhr.contentHandlers`
148 */
149 handleAs?: string;
150
151 /**
152 * false is default. Indicates whether the request should
153 * be a synchronous (blocking) request.
154 */
155 sync?: boolean;
156
157 /**
158 * Additional HTTP headers to send in the request.
159 */
160 headers?: GenericObject;
161
162 /**
163 * false is default. Indicates whether a request should be
164 * allowed to fail (and therefore no console error message in
165 * the event of a failure)
166 */
167 failOk?: boolean;
168
169 /**
170 * "application/x-www-form-urlencoded" is default. Set to false to
171 * prevent a Content-Type header from being sent, or to a string
172 * to send a different Content-Type.
173 */
174 contentType: boolean | string;
175 }
176
177 interface ContentHandlers {
178 'text': (xhr: { responseText: string }) => string;
179 'json': (xhr: { responseText: string }) => GenericObject;
180 'json-comment-filtered': (xhr: { responseText: string }) => GenericObject;
181 'javascript': (xhr: { responseText: string }) => any;
182 'xml': (xhr: { responseXML: string }) => Document;
183 'json-comment-optional': (xhr: { responseText: string }) => GenericObject;
184 [type: string]: (xhr: { responseText: string, responseXML: string }) => any;
185 }
186
187 interface Xhr {
188 (method: string, args: XhrArgs, hasBody?: boolean): Deferred<any>;
189
190 /**
191 * does the work of portably generating a new XMLHTTPRequest object.
192 */
193 _xhrObj(): XMLHttpRequest | ActiveXObject;
194
195 /**
196 * Serialize a form field to a JavaScript object.
197 */
198 fieldToObject(inputNode: HTMLElement | string): GenericObject;
199
200 /**
201 * Serialize a form node to a JavaScript object.
202 */
203 formToObject(fromNode: HTMLFormElement | string): GenericObject;
204
205 /**
206 * takes a name/value mapping object and returns a string representing
207 * a URL-encoded version of that object.
208 */
209 objectToQuery(map: GenericObject): string;
210
211 /**
212 * Returns a URL-encoded string representing the form passed as either a
213 * node or string ID identifying the form to serialize
214 */
215 formToQuery(fromNode: HTMLFormElement | string): string;
216
217 /**
218 * Create a serialized JSON string from a form node or string
219 * ID identifying the form to serialize
220 */
221 formToJson(formNode: HTMLFormElement | string): string;
222
223 /**
224 * Create an object representing a de-serialized query section of a
225 * URL. Query keys with multiple values are returned in an array.
226 */
227 queryToObject(str: string): GenericObject;
228
229 /**
230 * A map of available XHR transport handle types. Name matches the
231 * `handleAs` attribute passed to XHR calls.
232 */
233 contentHandlers: ContentHandlers;
234
235 _ioCancelAll(): void;
236
237 /**
238 * If dojo.publish is available, publish topics
239 * about the start of a request queue and/or the
240 * the beginning of request.
241 *
242 * Used by IO transports. An IO transport should
243 * call this method before making the network connection.
244 */
245 _ioNotifyStart<T>(dfd: DojoPromise<T>): void;
246
247 /**
248 * Watches the io request represented by dfd to see if it completes.
249 */
250 _ioWatch<T>(dfd: DojoPromise<T>, validCheck: Function, ioCheck: Function, resHandle: Function): void;
251
252 /**
253 * Adds query params discovered by the io deferred construction to the URL.
254 * Only use this for operations which are fundamentally GET-type operations.
255 */
256 _ioAddQueryToUrl(ioArgs: IoCallbackArgs): void;
257
258 /**
259 * sets up the Deferred and ioArgs property on the Deferred so it
260 * can be used in an io call.
261 */
262 _ioSetArgs(args: IoArgs, canceller: Function, okHandler: Function, errHandler: Function): Deferred<any>;
263
264 _isDocumentOk(x: Document): boolean;
265
266 _getText(url: string): string;
267
268 /**
269 * Send an HTTP GET request using the default transport for the current platform.
270 */
271 get<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
272
273 /**
274 * Send an HTTP POST request using the default transport for the current platform.
275 */
276 post<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
277
278 /**
279 * Send an HTTP PUT request using the default transport for the current platform.
280 */
281 put<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
282
283 /**
284 * Send an HTTP DELETE request using the default transport for the current platform.
285 */
286 del<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
287 }
288 } No newline at end of file
@@ -0,0 +1,47
1 import { GenericFunction, GenericObject, Handle } from "./interfaces";
2
3 interface AfterAdvice<T> {
4 (result: T, ...args: any[]): T;
5 }
6
7 interface AroundAdvice<T> {
8 (origFn: GenericFunction<T>): (...args: any[]) => T;
9 }
10
11 interface BeforeAdvice {
12 (...args: any[]): any[] | void;
13 }
14
15 /**
16 * The "before" export of the aspect module is a function that can be used to attach
17 * "before" advice to a method. This function will be executed before the original attach
18 * is executed. This function will be called with the arguments used to call the mattach
19 * This function may optionally return an array as the new arguments to use tattach
20 * the original method (or the previous, next-to-execute before advice, if one exattach
21 * If the before method doesn't return anything (returns undefined) the original argattach
22 * will be presattach
23 * If there are multiple "before" advisors, they are executed in the reverse order they were registered.
24 */
25 export declare function before<T>(target: GenericObject, methodName: string, advice: BeforeAdvice | Function): Handle;
26
27 /**
28 * The "around" export of the aspect module is a function that can be used to attach
29 * "around" advice to a method. The advisor function is immediately executeattach
30 * the around() is called, is passed a single argument that is a function that attach
31 * called to continue execution of the original method (or the next around advattach
32 * The advisor function should return a function, and this function will be called whattach
33 * the method is called. It will be called with the arguments used to call the mattach
34 * Whatever this function returns will be returned as the result of the method call (unless after advise changes it).
35 */
36 export declare function around<T>(target: GenericObject, methodName: string, advice: AroundAdvice<T> | Function): Handle;
37
38 /**
39 * The "after" export of the aspect module is a function that can be used to attach
40 * "after" advice to a method. This function will be executed after the original method
41 * is executed. By default the function will be called with a single argument, the return
42 * value of the original method, or the the return value of the last executed advice (if a previous one exists).
43 * The fourth (optional) argument can be set to true to so the function receives the original
44 * arguments (from when the original method was called) rather than the return value.
45 * If there are multiple "after" advisors, they are executed in the order they were registered.
46 */
47 export declare function after<T>(target: GenericObject, methodName: string, advice: AfterAdvice<T> | Function, receiveArguments?: boolean): Handle;
@@ -0,0 +1,49
1 import { GenericFunction } from "./interfaces";
2
3 interface BackArgs {
4 back?: GenericFunction<void>;
5 forward?: GenericFunction<void>;
6 changeUrl?: boolean | string;
7 }
8
9
10 export declare function getHash(): string;
11 export declare function setHash(h: string): void;
12
13 /**
14 * private method. Do not call this directly.
15 */
16 export declare function goBack(): void;
17
18 /**
19 * private method. Do not call this directly.
20 */
21 export declare function goForward(): void;
22
23 /**
24 * Initializes the undo stack. This must be called from a <script>
25 * block that lives inside the `<body>` tag to prevent bugs on IE.
26 * Only call this method before the page's DOM is finished loading. Otherwise
27 * it will not work. Be careful with xdomain loading or djConfig.debugAtAllCosts scenarios,
28 * in order for this method to work, dojo/back will need to be part of a build layer.
29 */
30 export declare function init(): void;
31
32 /**
33 * Sets the state object and back callback for the very first page
34 * that is loaded.
35 * It is recommended that you call this method as part of an event
36 * listener that is registered via dojo/ready.
37 */
38 export declare function setInitialState(args: BackArgs): void;
39
40 /**
41 * adds a state object (args) to the history list.
42 */
43 export declare function addToHistory(args: BackArgs): void;
44
45 /**
46 * private method. Do not call this directly.
47 */
48 export declare function _iframeLoaded(evt: Event, ifrLoc: Location): void;
49
@@ -0,0 +1,13
1 export declare const _behaviors: { [selector: string]: any };
2
3 /**
4 * Add the specified behavior to the list of behaviors, ignoring existing
5 * matches.
6 */
7 export declare function add(behaviorObject: { [selector: string]: any }): void;
8
9 /**
10 * Applies all currently registered behaviors to the document.
11 */
12 export declare function apply(): void;
13
@@ -0,0 +1,19
1 interface CookieProps {
2 expires?: Date | string | number;
3 path?: string;
4 domain?: string;
5 secure?: boolean;
6 }
7
8 interface Cookie {
9 /* Get or set a cookie. */
10 (name: string, value?: string, props?: CookieProps): string;
11
12 /**
13 * Use to determine if the current browser supports cookies or not.
14 */
15 isSupported(): boolean;
16 }
17
18 declare const cookie: Cookie;
19 export = cookie;
@@ -0,0 +1,76
1 import { NumberFormatOptions, NumberParseOptions, NumberRegexpOptions } from "./number";
2
3 export interface CurrencyFormatOptions extends NumberFormatOptions {
4
5 /**
6 * Should not be set. Value is assumed to be "currency".
7 */
8 type?: string;
9
10 /**
11 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
12 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
13 */
14 symbol?: string;
15
16 /**
17 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
18 * For use with dojo.currency only.
19 */
20 currency?: string;
21
22 /**
23 * number of decimal places to show. Default is defined based on which currency is used.
24 */
25 places?: number;
26 }
27
28 export interface CurrencyParseOptions extends NumberParseOptions {
29
30 /**
31 * Should not be set. Value is assumed to be "currency".
32 */
33 type?: string;
34
35 /**
36 * localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
37 * A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
38 */
39 symbol?: string;
40
41 /**
42 * an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
43 * For use with dojo.currency only.
44 */
45 currency?: string;
46
47 /**
48 * number of decimal places to show. Default is defined based on which currency is used.
49 */
50 places?: number;
51
52 /**
53 * Whether to include the fractional portion, where the number of decimal places are implied by the currency
54 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
55 * By default for currencies, it the fractional portion is optional.
56 */
57 factional?: boolean | [boolean, boolean];
58 }
59
60 export declare function _mixInDefaults(options: NumberFormatOptions): CurrencyFormatOptions;
61
62 /**
63 * Format a Number as a currency, using locale-specific settings
64 */
65 export declare function format(value: number, options?: CurrencyFormatOptions): string;
66
67 /**
68 * Builds the regular needed to parse a currency value
69 */
70 export declare function regexp(options?: NumberRegexpOptions): string;
71
72 /**
73 * Convert a properly formatted currency string to a primitive Number,
74 * using locale-specific settings.
75 */
76 export declare function parse(expression: string, options?: CurrencyParseOptions): number;
@@ -0,0 +1,10
1 interface Debounce {
2 /**
3 * Create a function that will only execute after `wait` milliseconds
4 */
5 <T extends Function>(cb: T, wait: number): T;
6 <T extends Function>(cb: Function, wait: number, ...args: any[]): T;
7 }
8
9 declare const debounce: Debounce;
10 export = debounce; No newline at end of file
@@ -0,0 +1,36
1 import { NodeOrString, ElementOrString, GenericObject } from "./interfaces";
2
3 interface DomAttr {
4 /**
5 * Returns true if the requested attribute is specified on the
6 * given element, and false otherwise.
7 */
8 has(node: NodeOrString, name: string): boolean;
9
10 /**
11 * Gets an attribute on an HTML element.
12 * Because sometimes this uses node.getAttribute, it should be a string,
13 * but it can also get any other attribute on a node, therefore it is unsafe
14 * to type just a string.
15 */
16 get(node: ElementOrString, name: string): any;
17
18 /**
19 * Sets an attribute on an HTML element.
20 */
21 set(node: ElementOrString, name: string, value: any): Element;
22 set(node: ElementOrString, map: GenericObject): Element;
23
24 /**
25 * Removes an attribute from an HTML element.
26 */
27 remove(node: NodeOrString, name: string): void;
28
29 /**
30 * Returns an effective value of a property or an attribute.
31 */
32 getNodeProp(node: NodeOrString, name: string): any;
33 }
34
35 declare const domAttr: DomAttr;
36 export = domAttr;
@@ -0,0 +1,38
1 import { NodeOrString } from "./interfaces";
2
3 interface DomClass {
4
5 /**
6 * Returns whether or not the specified classes are a portion of the
7 * class list currently applied to the node.
8 */
9 contains(node: NodeOrString, classStr: string): boolean;
10
11 /**
12 * Adds the specified classes to the end of the class list on the
13 * passed node. Will not re-apply duplicate classes.
14 */
15 add(node: NodeOrString, classStr: string | string[]): void;
16
17 /**
18 * Removes the specified classes from node. No `contains()`
19 * check is required.
20 */
21 remove(node: NodeOrString, classStr?: string | string[]): void;
22
23 /**
24 * Replaces one or more classes on a node if not present.
25 * Operates more quickly than calling dojo.removeClass and dojo.addClass
26 */
27 replace(node: NodeOrString, addClassStr: string | string[], removeClassStr?: string | string[]): void;
28
29 /**
30 * Adds a class to node if not present, or removes if present.
31 * Pass a boolean condition if you want to explicitly add or remove.
32 * Returns the condition that was specified directly or indirectly.
33 */
34 toggle(node: NodeOrString, classStr: string | string[], condition?: boolean): boolean;
35 }
36
37 declare const domClass: DomClass;
38 export = domClass;
@@ -0,0 +1,35
1 import { NodeOrString, NodeFragmentOrString, GenericObject } from "./interfaces";
2
3 interface DomConstruct {
4
5 /**
6 * instantiates an HTML fragment returning the corresponding DOM.
7 */
8 toDom(frag: string, doc?: Document): DocumentFragment | Node;
9
10 /**
11 * Attempt to insert node into the DOM, choosing from various positioning options.
12 * Returns the first argument resolved to a DOM node.
13 */
14 place(node: NodeFragmentOrString, refNode: NodeOrString, position?: string /* PosString */ | number): HTMLElement;
15
16 /**
17 * Create an element, allowing for optional attribute decoration
18 * and placement.
19 */
20 create(tag: NodeOrString, attrs?: GenericObject, refNode?: NodeOrString, pos?: string /* PosString */ | number): HTMLElement;
21
22 /**
23 * safely removes all children of the node.
24 */
25 empty(node: NodeOrString): void;
26
27 /**
28 * Removes a node from its parent, clobbering it and all of its
29 * children.
30 */
31 destroy(node: NodeOrString): void;
32 }
33
34 declare const domConstruct: DomConstruct;
35 export = domConstruct;
@@ -0,0 +1,28
1 import { NodeOrString, GenericObject } from "./interfaces";
2
3 interface DomForm {
4 /**
5 * Serialize a form field to a JavaScript object.
6 */
7 fieldToObject(inputNode: NodeOrString): GenericObject;
8
9 /**
10 * Serialize a form node to a JavaScript object.
11 */
12 toObject(fromNode: HTMLFormElement | string): GenericObject;
13
14 /**
15 * Returns a URL-encoded string representing the form passed as either a
16 * node or string ID identifying the form to serialize
17 */
18 toQuery(fromNode: HTMLFormElement | string): string;
19
20 /**
21 * Create a serialized JSON string from a form node or string
22 * ID identifying the form to serialize
23 */
24 toJson(formNode: HTMLFormElement | string, prettyPrint?: boolean): string;
25 }
26
27 declare const domForm: DomForm;
28 export = domForm; No newline at end of file
@@ -0,0 +1,133
1 import { DomComputedStyle } from "./dom-style";
2
3 declare namespace domGeometry {
4
5 interface DomGeometryWidthHeight {
6 w?: number;
7 h?: number;
8 }
9
10 interface DomGeometryBox extends DomGeometryWidthHeight {
11 l?: number;
12 t?: number;
13 }
14
15 interface DomGeometryBoxExtents extends DomGeometryBox {
16 r?: number;
17 b?: number;
18 }
19
20 interface Point {
21 x: number;
22 y: number;
23 }
24
25 interface DomGeometryXYBox extends DomGeometryWidthHeight, Point {
26 }
27
28 interface DomGeometry {
29 boxModel: string; /* TODO: string literal 'border-box' | 'content-box' */
30
31 /**
32 * Returns object with special values specifically useful for node
33 * fitting.
34 */
35 getPadExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
36
37 /**
38 * returns an object with properties useful for noting the border
39 * dimensions.
40 */
41 getBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
42
43 /**
44 * Returns object with properties useful for box fitting with
45 * regards to padding.
46 */
47 getPadBorderExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
48
49 /**
50 * returns object with properties useful for box fitting with
51 * regards to box margins (i.e., the outer-box).
52 * - l/t = marginLeft, marginTop, respectively
53 * - w = total width, margin inclusive
54 * - h = total height, margin inclusive
55 * The w/h are used for calculating boxes.
56 * Normally application code will not need to invoke this
57 * directly, and will use the ...box... functions instead.
58 */
59 getMarginExtents(node: Element, computedStyle?: DomComputedStyle): DomGeometryBoxExtents;
60
61 /**
62 * returns an object that encodes the width, height, left and top
63 * positions of the node's margin box.
64 */
65 getMarginBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
66
67 /**
68 * Returns an object that encodes the width, height, left and top
69 * positions of the node's content box, irrespective of the
70 * current box model.
71 */
72 getContentBox(node: Element, computedStyle?: DomComputedStyle): DomGeometryBox;
73
74 /**
75 * Sets the size of the node's contents, irrespective of margins,
76 * padding, or borders.
77 */
78 setContentSize(node: Element, box: DomGeometryWidthHeight, computedStyle?: DomComputedStyle): void;
79
80 /**
81 * sets the size of the node's margin box and placement
82 * (left/top), irrespective of box model. Think of it as a
83 * passthrough to setBox that handles box-model vagaries for
84 * you.
85 */
86 setMarginBox(node: Element, box: DomGeometryBox, computedStyle?: DomComputedStyle): void;
87
88 /**
89 * Returns true if the current language is left-to-right, and false otherwise.
90 */
91 isBodyLtr(doc?: Document): boolean;
92
93 /**
94 * Returns an object with {node, x, y} with corresponding offsets.
95 */
96 docScroll(doc?: Document): Point;
97
98 /**
99 * Deprecated method previously used for IE6-IE7. Now, just returns `{x:0, y:0}`.
100 */
101 getIeDocumentElementOffset(doc: Document): Point;
102
103 /**
104 * In RTL direction, scrollLeft should be a negative value, but IE
105 * returns a positive one. All codes using documentElement.scrollLeft
106 * must call this function to fix this error, otherwise the position
107 * will offset to right when there is a horizontal scrollbar.
108 */
109 fixIeBiDiScrollLeft(scrollLeft: number, doc?: Document): number;
110
111 /**
112 * Gets the position and size of the passed element relative to
113 * the viewport (if includeScroll==false), or relative to the
114 * document root (if includeScroll==true).
115 */
116 position(node: Element, includeScroll?: boolean): DomGeometryXYBox;
117
118 /**
119 * returns an object that encodes the width and height of
120 * the node's margin box
121 */
122 getMarginSize(node: Element, computedStyle?: DomComputedStyle): DomGeometryWidthHeight;
123
124 /**
125 * Normalizes the geometry of a DOM event, normalizing the pageX, pageY,
126 * offsetX, offsetY, layerX, and layerX properties
127 */
128 normalizeEvent(event: Event): void;
129 }
130 }
131
132 declare const domGeometry: domGeometry.DomGeometry;
133 export = domGeometry;
@@ -0,0 +1,16
1 import { ElementOrString, GenericObject } from "./interfaces";
2
3 interface DomProp {
4 /**
5 * Gets a property on an HTML element.
6 */
7 get(node: ElementOrString, name: string): any;
8
9 /**
10 * Sets a property on an HTML element.
11 */
12 set(node: ElementOrString, name: string | GenericObject, value?: any): Element;
13 }
14
15 declare const domProp: DomProp;
16 export = domProp;
@@ -0,0 +1,37
1 import { ElementOrString } from "./interfaces";
2
3 declare namespace domStyle {
4 interface DomComputedStyle {
5 position?: string;
6 width?: string;
7 height?: string;
8 [id: string]: any;
9 }
10
11 interface DomStyle {
12 /**
13 * Returns a "computed style" object.
14 */
15 getComputedStyle(node: Node): DomComputedStyle;
16
17 /**
18 * Accesses styles on a node.
19 */
20 get(node: ElementOrString): DomComputedStyle;
21 get(node: ElementOrString, name: string): string | number;
22
23 /**
24 * Sets styles on a node.
25 */
26 set(node: ElementOrString, name: DomComputedStyle): DomComputedStyle;
27 set(node: ElementOrString, name: string, value: string | number): DomComputedStyle;
28
29 /**
30 * converts style value to pixels on IE or return a numeric value.
31 */
32 toPixelValue(element: Element, value: string): number;
33 }
34 }
35
36 declare const domStyle: domStyle.DomStyle;
37 export = domStyle; No newline at end of file
@@ -0,0 +1,22
1 import { NodeOrString, ElementOrString } from "./interfaces";
2
3 interface Dom {
4 /**
5 * Returns DOM node with matching `id` attribute or falsy value (ex: null or undefined)
6 * if not found. Internally if `id` is not a string then `id` returned.
7 */
8 byId<E extends Element>(id: string | E, doc?: Document): E;
9
10 /**
11 * Returns true if node is a descendant of ancestor
12 */
13 isDescendant(node: NodeOrString, ancestor: NodeOrString): boolean;
14
15 /**
16 * Enable or disable selection on a node
17 */
18 setSelectable(node: ElementOrString, selectable?: boolean): void;
19 }
20
21 declare const dom: Dom;
22 export = dom;
@@ -0,0 +1,61
1 declare namespace has {
2 interface HasCache {
3 [feature: string]: any;
4 }
5
6 interface HasTestFunction {
7 /* TypeScript has no way of referring to the global scope see Microsoft/TypeScript#983 */
8 (global?: any, doc?: Document, element?: Element): any;
9 }
10
11 interface Has {
12 /**
13 * Return the current value of the named feature.
14 * @param {string | number} name The name (if a string) or identifier (if an integer) of the feature to test.
15 */
16 (name: string | number): any;
17 (name: 'host-browser'): boolean;
18 (name: 'host-node'): any;
19 (name: 'host-rhino'): boolean;
20 (name: 'dom'): boolean;
21 (name: 'dojo-dom-ready-api'): 1;
22 (name: 'dojo-sniff'): 1;
23 // if host-browser is true
24 (name: 'dom-addeventlistener'): void | boolean;
25 (name: 'touch'): void | boolean;
26 (name: 'touch-events'): void | boolean;
27 (name: 'pointer-events'): void | boolean;
28 (name: 'MSPointer'): void | boolean;
29 (name: 'device-width'): void | number;
30 (name: 'dom-attributes-explicit'): void | boolean;
31 (name: 'dom-attributes-specified-flag'): void | boolean;
32 // dojo/_base/browser
33 (name: 'config-selectorEngine'): string;
34
35 cache: HasCache;
36
37 /**
38 * Register a new feature test for some named feature.
39 */
40 add(name: string | number, test: HasTestFunction, now?: boolean, force?: boolean): any;
41 add<T extends (Object | string | number | boolean | null | void)>(name: string | number, test: T, now?: boolean, force?: boolean): any;
42
43 /**
44 * Deletes the contents of the element passed to test functions.
45 */
46 clearElement(element: HTMLElement): HTMLElement;
47
48 /**
49 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
50 */
51 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
52
53 /**
54 * Conditional loading of AMD modules based on a has feature test value.
55 */
56 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
57 }
58 }
59
60 declare const has: has.Has;
61 export = has;
@@ -0,0 +1,1
1 export declare function hash(hash?: string, replace?: boolean): string;
@@ -0,0 +1,156
1 import { PromiseOrValue, NodeOrString } from "./interfaces";
2 import Deferred = require("./_base/Deferred");
3 import { DeclareConstructor } from "./_base/declare";
4
5 declare namespace dojoHtml {
6 type ContentSetterContent = string | Node | ArrayLike<Node>;
7
8 interface ContentSetterParams {
9 node?: NodeOrString;
10 content?: ContentSetterContent;
11 id?: string;
12 cleanContent?: boolean;
13 extractContent?: boolean;
14 parseContent?: boolean;
15 parserScope?: boolean;
16 startup?: boolean;
17 onBegin?: Function;
18 onEnd?: Function;
19 tearDown?: Function;
20 onContentError?: Function;
21 onExecError?: Function;
22 }
23
24 interface ContentSetter {
25
26 /**
27 * An node which will be the parent element that we set content into
28 */
29 node: NodeOrString;
30
31 /**
32 * The content to be placed in the node. Can be an HTML string, a node reference, or a enumerable list of nodes
33 */
34 content: ContentSetterContent;
35
36 /**
37 * Usually only used internally, and auto-generated with each instance
38 */
39 id: string;
40
41 /**
42 * Should the content be treated as a full html document,
43 * and the real content stripped of <html>, <body> wrapper before injection
44 */
45 cleanContent: boolean;
46
47 /**
48 * Should the content be treated as a full html document,
49 * and the real content stripped of `<html> <body>` wrapper before injection
50 */
51 extractContent: boolean;
52
53 /**
54 * Should the node by passed to the parser after the new content is set
55 */
56 parseContent: boolean;
57
58 /**
59 * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo,
60 * will search for data-dojo-type (or dojoType). For backwards compatibility
61 * reasons defaults to dojo._scopeName (which is "dojo" except when
62 * multi-version support is used, when it will be something like dojo16, dojo20, etc.)
63 */
64 parserScope: string;
65
66 /**
67 * Start the child widgets after parsing them. Only obeyed if parseContent is true.
68 */
69 startup: boolean;
70
71 /**
72 * front-end to the set-content sequence
73 */
74 set(cont?: ContentSetterContent, params?: ContentSetterParams): Promise<Node> | Node;
75
76 /**
77 * sets the content on the node
78 */
79 setContent(): void;
80
81 /**
82 * cleanly empty out existing content
83 */
84 empty(): void;
85
86 /**
87 * Called after instantiation, but before set();
88 * It allows modification of any of the object properties -
89 * including the node and content provided - before the set operation actually takes place
90 */
91 onBegin(): Node;
92
93 /**
94 * Called after set(), when the new content has been pushed into the node
95 * It provides an opportunity for post-processing before handing back the node to the caller
96 * This default implementation checks a parseContent flag to optionally run the dojo parser over the new content
97 */
98 onEnd(): Node;
99
100 /**
101 * manually reset the Setter instance if its being re-used for example for another set()
102 */
103 tearDown(): void;
104
105 onContentError(): string;
106 onExecError(): string;
107 _mixin(params: ContentSetterParams): void;
108 parseDeferred: Deferred<any[]>;
109
110 /**
111 * runs the dojo parser over the node contents, storing any results in this.parseResults
112 */
113 _parse(): void;
114
115 /**
116 * shows user the string that is returned by on[type]Error
117 * override/implement on[type]Error and return your own string to customize
118 */
119 _onError(type: string, err: Error, consoleText?: string): void;
120 }
121
122 interface ContentSetterConstructor extends DeclareConstructor<ContentSetter> {
123 new(params?: ContentSetterParams, node?: NodeOrString): ContentSetter;
124 }
125
126 interface Html {
127 /**
128 * removes !DOCTYPE and title elements from the html string.
129 *
130 * khtml is picky about dom faults, you can't attach a style or `<title>` node as child of body
131 * must go into head, so we need to cut out those tags
132 */
133 _secureForInnerHtml(cont: string): string;
134
135 /**
136 * Deprecated, should use dojo/dom-constuct.empty() directly, remove in 2.0.
137 */
138 _emptyNode(node: NodeOrString): void;
139
140 /**
141 * inserts the given content into the given node
142 */
143 _setNodeContent<T extends Node>(node: Node, cont: string | Node | ArrayLike<T>): Node;
144
145 _ContentSetter: ContentSetterConstructor;
146
147 /**
148 * inserts (replaces) the given content into the given node. dojo/dom-construct.place(cont, node, "only")
149 * may be a better choice for simple HTML insertion.
150 */
151 set(node: Node, cont?: ContentSetterContent, params?: ContentSetterParams): PromiseOrValue<Node>;
152 }
153 }
154
155 declare const dojoHtml: dojoHtml.Html;
156 export = dojoHtml;
@@ -0,0 +1,22
1 interface I18n {
2 getLocalization(moduleName: string, bundleName: string, locale?: string): any;
3
4 dynamic: boolean;
5
6 /**
7 * Resolves id into a module id based on possibly-nested tenary expression that branches on has feature test value(s).
8 */
9 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
10
11 /**
12 * Conditional loading of AMD modules based on a has feature test value.
13 */
14 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
15
16 cache: { [bundle: string]: any };
17
18 getL10nName(moduleName: string, bundleName: string, locale?: string): string;
19 }
20
21 declare const i18n: I18n;
22 export = i18n;
@@ -0,0 +1,58
1 export type NodeOrString = Node | string;
2
3 export type ElementOrString = Element | string;
4
5 export type NodeFragmentOrString = NodeOrString | DocumentFragment;
6
7 export type PromiseOrValue<T> = T | PromiseLike<T>;
8
9 export type PromiseObjectOrArray = { [name: string]: PromiseOrValue<any> } | PromiseOrValue<any>[];
10
11 export type PromiseTypedObjectOrArray<T> = { [name: string]: PromiseOrValue<T> } | PromiseOrValue<T>[];
12
13 export interface GenericConstructor<T> {
14 new(...args: any[]): T;
15 prototype: T;
16 }
17
18 export interface GenericObject {
19 [id: string]: any;
20 }
21
22 export interface GenericFunction<T> {
23 (...args: any[]): T;
24 }
25
26 export interface Handle {
27 remove(): void;
28 }
29
30 export interface WatchHandle extends Handle {
31 unwatch(): void;
32 }
33
34 export interface EventListener {
35 (evt: any): void;
36 }
37
38 export interface BuildProfile {
39 resourceTags: { [tag: string]: (filename: string, mid?: string) => boolean; };
40 }
41
42 export interface Package {
43 location?: string;
44 main?: string;
45 name?: string;
46 }
47
48 export interface ModuleMap extends ModuleMapItem {
49 [sourceMid: string]: ModuleMapReplacement;
50 }
51
52 export interface ModuleMapItem {
53 [mid: string]: /* ModuleMapReplacement | ModuleMap */ any;
54 }
55
56 export interface ModuleMapReplacement extends ModuleMapItem {
57 [findMid: string]: /* replaceMid */ string;
58 } No newline at end of file
@@ -0,0 +1,9
1 /**
2 * Parses a [JSON](http://json.org) string to return a JavaScript object.
3 */
4 export declare function parse(str: string, strict?: boolean): any;
5
6 /**
7 * Returns a [JSON](http://json.org) serialization of an object.
8 */
9 export declare function stringify(value: any, replacer?: (key: string, value: any) => any | any[], space?: string | number): string;
@@ -0,0 +1,69
1 interface Keys {
2 BACKSPACE: number;
3 TAB: number;
4 CLEAR: number;
5 ENTER: number;
6 SHIFT: number;
7 CTRL: number;
8 ALT: number;
9 META: number;
10 PAUSE: number;
11 CAPS_LOCK: number;
12 ESCAPE: number;
13 SPACE: number;
14 PAGE_UP: number;
15 PAGE_DOWN: number;
16 END: number;
17 HOME: number;
18 LEFT_ARROW: number;
19 UP_ARROW: number;
20 RIGHT_ARROW: number;
21 DOWN_ARROW: number;
22 INSERT: number;
23 DELETE: number;
24 HELP: number;
25 LEFT_WINDOW: number;
26 RIGHT_WINDOW: number;
27 SELECT: number;
28 NUMPAD_0: number;
29 NUMPAD_1: number;
30 NUMPAD_2: number;
31 NUMPAD_3: number;
32 NUMPAD_4: number;
33 NUMPAD_5: number;
34 NUMPAD_6: number;
35 NUMPAD_7: number;
36 NUMPAD_8: number;
37 NUMPAD_9: number;
38 NUMPAD_MULTIPLY: number;
39 NUMPAD_PLUS: number;
40 NUMPAD_ENTER: number;
41 NUMPAD_MINUS: number;
42 NUMPAD_PERIOD: number;
43 NUMPAD_DIVIDE: number;
44 F1: number;
45 F2: number;
46 F3: number;
47 F4: number;
48 F5: number;
49 F6: number;
50 F7: number;
51 F8: number;
52 F9: number;
53 F10: number;
54 F11: number;
55 F12: number;
56 F13: number;
57 F14: number;
58 F15: number;
59 NUM_LOCK: number;
60 SCROLL_LOCK: number;
61 UP_DPAD: number;
62 DOWN_DPAD: number;
63 LEFT_DPAD: number;
64 RIGHT_DPAD: number;
65 copyKey: number;
66 }
67
68 declare const keys: Keys;
69 export = keys;
@@ -0,0 +1,241
1 export interface NumberFormatOptions {
2
3 /**
4 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
5 * with this string. Default value is based on locale. Overriding this property will defeat
6 * localization. Literal characters in patterns are not supported.
7 */
8 pattern?: string;
9
10 /**
11 * choose a format type based on the locale from the following:
12 * decimal, scientific (not yet supported), percent, currency. decimal by default.
13 */
14 type?: string;
15
16 /**
17 * fixed number of decimal places to show. This overrides any
18 * information in the provided pattern.
19 */
20 places?: number;
21
22 /**
23 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
24 * means do not round.
25 */
26 round?: number;
27
28 /**
29 * override the locale used to determine formatting rules
30 */
31 locale?: string;
32
33 /**
34 * If false, show no decimal places, overriding places and pattern settings.
35 */
36 factional?: boolean | [boolean, boolean];
37 }
38
39 export interface NumberFormatAbsoluteOptions {
40 /**
41 * the decimal separator
42 */
43 decimal?: string;
44
45 /**
46 * the group separator
47 */
48 group?: string;
49
50 /**
51 * number of decimal places. the range "n,m" will format to m places.
52 */
53 places?: number | string;
54
55 /**
56 * 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
57 * means don't round.
58 */
59 round?: number;
60 }
61
62 export interface NumberRegexpOptions {
63
64 /**
65 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
66 * with this string. Default value is based on locale. Overriding this property will defeat
67 * localization.
68 */
69 pattern?: string;
70
71 /**
72 * choose a format type based on the locale from the following:
73 * decimal, scientific (not yet supported), percent, currency. decimal by default.
74 */
75 type?: string;
76
77 /**
78 * override the locale used to determine formatting rules
79 */
80 locacle?: string;
81
82 /**
83 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
84 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
85 */
86 strict?: boolean;
87
88 /**
89 * number of decimal places to accept: Infinity, a positive number, or
90 * a range "n,m". Defined by pattern or Infinity if pattern not provided.
91 */
92 places?: number | string;
93 }
94
95 export interface NumberParseOptions {
96
97 /**
98 * override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
99 * with this string. Default value is based on locale. Overriding this property will defeat
100 * localization. Literal characters in patterns are not supported.
101 */
102 pattern?: string;
103
104 /**
105 * choose a format type based on the locale from the following:
106 * decimal, scientific (not yet supported), percent, currency. decimal by default.
107 */
108 type?: string;
109
110 /**
111 * override the locale used to determine formatting rules
112 */
113 locale?: string;
114
115 /**
116 * strict parsing, false by default. Strict parsing requires input as produced by the format() method.
117 * Non-strict is more permissive, e.g. flexible on white space, omitting thousands separators
118 */
119 strict?: boolean;
120
121 /**
122 * Whether to include the fractional portion, where the number of decimal places are implied by pattern
123 * or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
124 */
125 factional?: boolean | [boolean, boolean];
126 }
127
128 export interface RealNumberRegexpFlags {
129
130 /**
131 * The integer number of decimal places or a range given as "n,m". If
132 * not given, the decimal part is optional and the number of places is
133 * unlimited.
134 */
135 places?: number;
136
137 /**
138 * A string for the character used as the decimal point. Default
139 * is ".".
140 */
141 decimal?: string;
142
143 /**
144 * Whether decimal places are used. Can be true, false, or [true,
145 * false]. Default is [true, false] which means optional.
146 */
147 factional?: boolean | [boolean, boolean];
148
149 /**
150 * Express in exponential notation. Can be true, false, or [true,
151 * false]. Default is [true, false], (i.e. will match if the
152 * exponential part is present are not).
153 */
154 exponent?: boolean | [boolean, boolean];
155
156 /**
157 * The leading plus-or-minus sign on the exponent. Can be true,
158 * false, or [true, false]. Default is [true, false], (i.e. will
159 * match if it is signed or unsigned). flags in regexp.integer can be
160 * applied.
161 */
162 eSigned?: boolean | [boolean, boolean];
163 }
164
165 export interface IntegerRegexpFlags {
166
167 /**
168 * The leading plus-or-minus sign. Can be true, false, or `[true,false]`.
169 * Default is `[true, false]`, (i.e. will match if it is signed
170 * or unsigned).
171 */
172 signed?: boolean;
173
174 /**
175 * The character used as the thousands separator. Default is no
176 * separator. For more than one symbol use an array, e.g. `[",", ""]`,
177 * makes ',' optional.
178 */
179 separator?: string;
180
181 /**
182 * group size between separators
183 */
184 groupSize?: number;
185
186 /**
187 * second grouping, where separators 2..n have a different interval than the first separator (for India)
188 */
189 groupSize2?: number;
190 }
191
192 /**
193 * Format a Number as a String, using locale-specific settings
194 */
195 export declare function format(value: number, options?: NumberFormatOptions): string;
196
197 /**
198 * not precise, but good enough
199 */
200 export declare const _numberPatternRE: RegExp;
201
202 /**
203 * Apply pattern to format value as a string using options. Gives no
204 * consideration to local customs.
205 */
206 export declare function _applyPattern(value: number, pattern: string, options?: NumberFormatOptions): string;
207
208 /**
209 * Rounds to the nearest value with the given number of decimal places, away from zero
210 */
211 export declare function round(value: number, places?: number, increment?: number): number;
212
213 /**
214 * Apply numeric pattern to absolute value using options. Gives no
215 * consideration to local customs.
216 */
217 export declare function _formatAbsolute(value: number, pattern: string, options?: NumberFormatAbsoluteOptions): string;
218
219 /**
220 * Builds the regular needed to parse a number
221 */
222 export declare function regexp(options?: NumberRegexpOptions): string;
223
224 export declare function _parseInfo(options?: any): { regexp: string, group: string, decimal: string, factor: number };
225
226 /**
227 * Convert a properly formatted string to a primitive Number, using
228 * locale-specific settings.
229 */
230 export declare function parse(expression: string, options?: NumberParseOptions): number;
231
232 /**
233 * Builds a regular expression to match a real number in exponential
234 * notation
235 */
236 export declare function _realNumberRegexp(flags: RealNumberRegexpFlags): string;
237
238 /**
239 * Builds a regular expression that matches an integer
240 */
241 export declare function _integerRegexp(flags: IntegerRegexpFlags): string;
@@ -0,0 +1,71
1 import { GenericObject, Handle } from "./interfaces";
2
3 declare namespace dojoOn {
4
5 interface ExtensionEvent {
6 (target: Element | GenericObject, listener: EventListener): Handle;
7 }
8
9 interface PauseHandle extends Handle {
10 pause(): void;
11 resume(): void;
12 }
13
14 interface MatchesTarget {
15 matches(node: Element, selector: string, context?: any): any[];
16 [id: string]: any;
17 }
18
19 interface On {
20 /**
21 * A function that provides core event listening functionality. With this function
22 * you can provide a target, event type, and listener to be notified of
23 * future matching events that are fired.
24 */
25 (target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
26
27 /**
28 * This function acts the same as on(), but with pausable functionality. The
29 * returned signal object has pause() and resume() functions. Calling the
30 * pause() method will cause the listener to not be called for future events.
31 */
32 pausable(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
33
34 /**
35 * This function acts the same as on(), but will only call the listener once. The
36 * listener will be called for the first
37 * event that takes place and then listener will automatically be removed.
38 */
39 once(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix?: boolean): Handle;
40
41 parse(target: Element | GenericObject, type: string | ExtensionEvent, listener: EventListener | Function, dontFix: boolean, matchesTarget: Element | GenericObject): Handle;
42
43 /**
44 * Check if a node match the current selector within the constraint of a context
45 */
46 matches(node: Element, selector: string, context: Element, children: boolean, matchesTarget?: MatchesTarget): Element | boolean;
47
48 /**
49 * Creates a new extension event with event delegation. This is based on
50 * the provided event type (can be extension event) that
51 * only calls the listener when the CSS selector matches the target of the event.
52 *
53 * The application must require() an appropriate level of dojo/query to handle the selector.
54 */
55 selector(selector: string, type: string | ExtensionEvent, children?: boolean): ExtensionEvent;
56
57 /**
58 * Fires an event on the target object.
59 */
60 emit(target: Element | GenericObject, type: string | ExtensionEvent, event?: any): boolean;
61
62 /**
63 * normalizes properties on the event object including event
64 * bubbling methods, keystroke normalization, and x/y positions
65 */
66 _fixEvent(evt: any, sender: any): any;
67 }
68 }
69
70 declare const dojoOn: dojoOn.On;
71 export = dojoOn;
@@ -0,0 +1,4
1 {
2 "name": "@types/dojo",
3 "version": "1.0.1-rc1"
4 } No newline at end of file
@@ -0,0 +1,83
1 import { PromiseOrValue, GenericConstructor } from "./interfaces";
2 import DojoPromise = require("./promise/Promise");
3
4 declare namespace dojoParser {
5 interface ParserOptions { }
6
7 interface ParserObjects {
8 ctor?: GenericConstructor<any>;
9 types?: string[];
10 node: Node;
11 scripts?: HTMLScriptElement[];
12 inherited?: { [prop: string]: any; };
13 }
14
15 interface InstancesArray extends Array<any>, DojoPromise<any> {}
16
17 interface Parser {
18 /**
19 * Clear cached data. Used mainly for benchmarking.
20 */
21 _clearCache(): void;
22
23 /**
24 * Convert a `<script type="dojo/method" args="a, b, c"> ... </script>`
25 * into a function
26 */
27 _functionFromScript(node: HTMLScriptElement, attrData: string): Function;
28
29 /**
30 * Takes array of nodes, and turns them into class instances and
31 * potentially calls a startup method to allow them to connect with
32 * any children.
33 */
34 instantiate(nodes: Node[], mixin?: Object, options?: ParserOptions): any[];
35
36 /**
37 * Takes array of objects representing nodes, and turns them into class instances and
38 * potentially calls a startup method to allow them to connect with
39 * any children.
40 */
41 _instantiate(nodes: ParserObjects[], mixin?: Object, options?: ParserOptions, returnPromise?: boolean): PromiseOrValue<any[]>;
42
43 /**
44 * Calls new ctor(params, node), where params is the hash of parameters specified on the node,
45 * excluding data-dojo-type and data-dojo-mixins. Does not call startup().
46 */
47 construct<T>(
48 ctor: GenericConstructor<T>,
49 node: Node, mixin?: Object,
50 options?: ParserOptions,
51 scripts?: HTMLScriptElement[],
52 inherited?: { [prop: string]: any; }
53 ): PromiseOrValue<T>;
54
55 /**
56 * Scan a DOM tree and return an array of objects representing the DOMNodes
57 * that need to be turned into widgets.
58 */
59 scan(root?: Node, options?: ParserOptions): DojoPromise<ParserObjects[]>;
60
61 /**
62 * Helper for _scanAMD(). Takes a `<script type=dojo/require>bar: "acme/bar", ...</script>` node,
63 * calls require() to load the specified modules and (asynchronously) assign them to the specified global
64 * variables, and returns a Promise for when that operation completes.
65 *
66 * In the example above, it is effectively doing a require(["acme/bar", ...], function(a){ bar = a; }).
67 */
68 _require(script: HTMLScriptElement, options: ParserOptions): DojoPromise<any>;
69
70 /**
71 * Scans the DOM for any declarative requires and returns their values.
72 */
73 _scanAmd(root?: Node, options?: ParserOptions): DojoPromise<boolean>;
74
75 /**
76 * Scan the DOM for class instances, and instantiate them.
77 */
78 parse(rootNode?: Node, options?: ParserOptions): InstancesArray;
79 }
80 }
81
82 declare const dojoParser: dojoParser.Parser;
83 export = dojoParser;
@@ -0,0 +1,68
1 declare namespace DojoPromise {
2 interface Thenable<T> extends PromiseLike<T> {
3 /**
4 * Add new callbacks to the promise.
5 */
6 then<U1, U2>(callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>, progback?: PromiseProgback): Thenable<U1 | U2>;
7 }
8
9 type PromiseCallback<T, U> = ((value: T) => U | PromiseLike<U>) | undefined | null;
10
11 type PromiseErrback<U> = PromiseCallback<any, U>;
12
13 type PromiseProgback = (progress: any) => void;
14
15 interface DojoPromise<T> extends Thenable<T> {
16
17 /**
18 * Inform the deferred it may cancel its asynchronous operation.
19 */
20 cancel(reason?: any, strict?: boolean): any;
21
22 /**
23 * Checks whether the promise has been resolved.
24 */
25 isResolved(): boolean;
26
27 /**
28 * Checks whether the promise has been rejected.
29 */
30 isRejected(): boolean;
31
32 /**
33 * Checks whether the promise has been resolved or rejected.
34 */
35 isFulfilled(): boolean;
36
37 /**
38 * Checks whether the promise has been canceled.
39 */
40 isCanceled(): boolean;
41
42 /**
43 * Add a callback to be invoked when the promise is resolved
44 * or rejected.
45 */
46 always<U>(callbackOrErrback: PromiseCallback<any, U>): DojoPromise<U>;
47
48 /**
49 * Add new errbacks to the promise.
50 */
51 otherwise<U>(errback: PromiseErrback<U>): DojoPromise<U>;
52
53 trace(): this;
54 traceRejected(): this;
55 toString(): string;
56 }
57
58 interface DojoPromiseConstructor {
59 /**
60 * The public interface to a deferred.
61 */
62 new <T>(): DojoPromise<T>;
63 }
64 }
65
66 type DojoPromise<T> = DojoPromise.DojoPromise<T>;
67 declare const DojoPromise: DojoPromise.DojoPromiseConstructor;
68 export = DojoPromise;
@@ -0,0 +1,24
1 import { PromiseOrValue } from "../interfaces";
2
3 declare namespace promiseAll {
4
5
6 interface All {
7 /**
8 * Takes multiple promises and returns a new promise that is fulfilled
9 * when all promises have been resolved or one has been rejected.
10 * @param objectOrArray The promise will be fulfilled with a list of results if invoked with an
11 * array, or an object of results when passed an object (using the same
12 * keys). If passed neither an object or array it is resolved with an
13 * undefined value.
14 */
15 <T>(array: PromiseOrValue<T>[]): PromiseOrValue<T[]>;
16 <T>(object: { [name: string]: PromiseOrValue<T> }): PromiseLike<{ [name: string]: T }>;
17 (array: PromiseOrValue<any>[]): PromiseOrValue<any[]>;
18 (object: { [name: string]: PromiseOrValue<any> }): PromiseLike<{ [name: string]: any }>;
19 }
20 }
21
22 declare const promiseAll: promiseAll.All;
23 export = promiseAll;
24
@@ -0,0 +1,15
1 import { PromiseTypedObjectOrArray, PromiseObjectOrArray } from "../interfaces";
2
3 interface First {
4 /**
5 * Takes multiple promises and returns a new promise that is fulfilled
6 * when the first of these promises is fulfilled.
7 * @param objectOrArray The promises are taken from the array or object values. If no value
8 * is passed, the returned promise is resolved with an undefined value.
9 */
10 <T>(objectOrArray?: PromiseTypedObjectOrArray<T>): Promise<T>;
11 (objectOrArray?: PromiseObjectOrArray): Promise<any>;
12 }
13
14 declare const First: First;
15 export = First;
@@ -0,0 +1,11
1 import { DeferredConstructor } from "../Deferred";
2
3 interface Instrumentation {
4 /**
5 * Initialize instrumentation for the Deferred class.
6 */
7 (Deferred: DeferredConstructor): void;
8 }
9
10 declare const Instrumentation: Instrumentation;
11 export = Instrumentation; No newline at end of file
@@ -0,0 +1,11
1 import { Handle } from "../interfaces";
2
3 interface Tracer {
4 /**
5 * Subscribe to traces.
6 */
7 on(type: string /* TracerEvent */, listener: EventListener): Handle;
8 }
9
10 declare const Tracer: Tracer;
11 export = Tracer;
@@ -0,0 +1,186
1 import { NodeOrString, Handle, GenericConstructor } from "./interfaces";
2
3 declare namespace dojoQuery {
4 /* dojo/query */
5
6 interface NodeListFilterCallback<T extends Node> {
7 (item: T, idx: number, nodeList: this): boolean;
8 }
9
10 type NodeListFilter<T extends Node> = string | NodeListFilterCallback<T>;
11
12 interface NodeList<T extends Node> extends ArrayLike<T> {
13 /**
14 * decorate an array to make it look like a `dojo/NodeList`.
15 */
16 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
17
18 _NodeListCtor: NodeListConstructor;
19 toString(): string;
20
21 /**
22 * private function to hold to a parent NodeList. end() to return the parent NodeList.
23 */
24 _stash(parent: Node): this;
25
26 /**
27 * Listen for events on the nodes in the NodeList.
28 */
29 on(eventName: string, listener: EventListener): Handle[];
30
31 /**
32 * Ends use of the current `NodeList` by returning the previous NodeList
33 * that generated the current NodeList.
34 */
35 end<U extends Node>(): NodeList<U>;
36
37 /**
38 * Returns a new NodeList, maintaining this one in place
39 */
40 slice(begin: number, end?: number): this;
41
42 /**
43 * Returns a new NodeList, manipulating this NodeList based on
44 * the arguments passed, potentially splicing in new elements
45 * at an offset, optionally deleting elements
46 */
47 splice(index: number, howmany?: number, ...items: T[]): this;
48
49 /**
50 * see `dojo/_base/array.indexOf()`. The primary difference is that the acted-on
51 * array is implicitly this NodeList
52 */
53 indexOf(value: T, fromIndex?: number, findLast?: boolean): number;
54
55 /**
56 * see `dojo/_base/array.lastIndexOf()`. The primary difference is that the
57 * acted-on array is implicitly this NodeList
58 */
59 lastIndexOf(value: T, fromIndex?: number): number;
60
61 /**
62 * see `dojo/_base/array.every()` and the [Array.every
63 * docs](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every).
64 * Takes the same structure of arguments and returns as
65 * dojo/_base/array.every() with the caveat that the passed array is
66 * implicitly this NodeList
67 */
68 every(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
69
70 /**
71 * Takes the same structure of arguments and returns as
72 * `dojo/_base/array.some()` with the caveat that the passed array as
73 * implicitly this NodeList. See `dojo/_base/array.some()` and Mozillaas
74 * [Array.soas
75 * documentation](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some).
76 */
77 some(callback: (item: T, idx: number, nodeList: this) => boolean | string, thisObj?: Object): boolean;
78
79 /**
80 * Returns a new NodeList comprised of items in this NodeList
81 * as well as items passed in as parameters
82 */
83 concat(...items: T[]): this;
84
85 /**
86 * see `dojo/_base/array.map()`. The primary difference is that the acted-on
87 * array is implicitly this NodeList and the return is a
88 * NodeList (a subclass of Array)
89 */
90 map<U extends Node>(func: (item: T, idx: number, nodeList: this) => U, obj?: Object): NodeList<U>;
91
92 /**
93 * see `dojo/_base/array.forEach()`. The primary difference is that the acted-on
94 * array is implicitly this NodeList. If you want the option to break out
95 * of the forEach loop, use every() or some() instead.
96 */
97 forEach(callback: (item: T, idx: number, nodeList: this) => void, thisObj?: Object): this;
98
99 /**
100 * "masks" the built-in javascript filter() method (supported
101 * in Dojo via `dojo/_base/array.filter`) to support passing a simple
102 * string filter in addition to supporting filtering function
103 * objects.
104 */
105 filter<U extends Node>(filter: NodeListFilter<T>, thisObj?: Object): NodeList<U>;
106
107 /**
108 * Create a new instance of a specified class, using the
109 * specified properties and each node in the NodeList as a
110 * srcNodeRef.
111 */
112 instantiate(declaredClass: string | GenericConstructor<any>, properties?: Object): this;
113
114 /**
115 * Returns a new NodeList comprised of items in this NodeList
116 * at the given index or indices.
117 */
118 at(...indices: number[]): this;
119
120 }
121
122 interface NodeListConstructor {
123 new <T extends Node>(array: number | Array<T>): NodeList<T>;
124 new <T extends Node>(...args: T[]): NodeList<T>;
125 <T extends Node>(array: number | Array<T>): NodeList<T>;
126 <T extends Node>(...args: T[]): NodeList<T>;
127
128 prototype: NodeList<any>;
129
130 /**
131 * decorate an array to make it look like a `dojo/NodeList`.
132 */
133 _wrap<U extends Node, V extends Node>(a: U[], parent?: NodeList<V>, NodeListCtor?: NodeListConstructor): NodeList<U>;
134
135 /**
136 * adapts a single node function to be used in the map-type
137 * actions. The return is a new array of values, as via `dojo/_base/array.map`
138 */
139 _adaptAsMap<T extends Node, U extends Node>(f: (node: T) => U, o?: Object): NodeList<U>;
140
141 /**
142 * adapts a single node function to be used in the forEach-type
143 * actions. The initial object is returned from the specialized
144 * function.
145 */
146 _adaptAsForEach<T extends Node>(f: (node: T) => void, o?: Object): this;
147
148 /**
149 * adapts a single node function to be used in the filter-type actions
150 */
151 _adaptAsFilter<T extends Node>(f: (node: T) => boolean, o?: Object): this;
152
153 /**
154 * adapts a single node function to be used in the map-type
155 * actions, behaves like forEach() or map() depending on arguments
156 */
157 _adaptWithCondition<T extends Node, U extends Node>(f: (node: T) => U | void, g: (...args: any[]) => boolean, o?: Object): NodeList<U> | this;
158 }
159
160 interface Query {
161 /**
162 * Returns nodes which match the given CSS selector, searching the
163 * entire document by default but optionally taking a node to scope
164 * the search by. Returns an instance of NodeList.
165 */
166 <T extends Node>(query: string, root?: NodeOrString): NodeList<T>;
167
168 /**
169 * Test to see if a node matches a selector
170 */
171 matches(node: Node, selector: string, root?: NodeOrString): boolean;
172
173 /**
174 * Filters an array of nodes. Note that this does not guarantee to return a NodeList, just an array.
175 */
176 filter<T extends Node>(nodes: NodeList<T> | T[], select: string, root?: NodeOrString): T[] | NodeList<T>;
177
178 /**
179 * can be used as AMD plugin to conditionally load new query engine
180 */
181 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
182 }
183 }
184
185 declare const dojoQuery: dojoQuery.Query;
186 export = dojoQuery; No newline at end of file
@@ -0,0 +1,11
1 /**
2 * Add a function to execute on DOM content loaded and all requested modules have arrived and been evaluated.
3 * In most cases, the `domReady` plug-in should suffice and this method should not be needed.
4 *
5 * When called in a non-browser environment, just checks that all requested modules have arrived and been
6 * evaluated.
7 */
8 export declare function ready(callback: Function): void;
9 export declare function ready(context: Object, callback: Function | string): void;
10 export declare function ready(priority: number, callback: Function): void;
11 export declare function ready(priority: number, context: Object, callback: Function | string): void;
@@ -0,0 +1,436
1 import { GenericObject, Handle } from "./interfaces";
2 import { DojoPromise } from "./promise/Promise";
3 import { Deferred } from "./Deferred";
4
5 declare namespace dojoRequest {
6
7 /* dojo/request */
8
9 interface DojoRequestPromise<T> extends DojoPromise<T> {
10 response: DojoPromise<Response<T>>;
11 }
12
13 interface BaseOptions {
14 /**
15 * Query parameters to append to the URL.
16 */
17 query?: string | { [name: string]: any };
18
19 /**
20 * Data to transfer. This is ignored for GET and DELETE
21 * requests.
22 */
23 data?: string | { [name: string]: any };
24
25 /**
26 * Whether to append a cache-busting parameter to the URL.
27 */
28 preventCache?: boolean;
29
30 /**
31 * Milliseconds to wait for the response. If this time
32 * passes, the then the promise is rejected.
33 */
34 timeout?: number;
35
36 /**
37 * How to handle the response from the server. Default is
38 * 'text'. Other values are 'json', 'javascript', and 'xml'.
39 */
40 handleAs?: string;
41 }
42
43 interface MethodOptions {
44 /**
45 * The HTTP method to use to make the request. Must be
46 * uppercase.
47 */
48 method?: string;
49 }
50
51 interface RequestOptions extends BaseOptions, MethodOptions { }
52
53 interface Request {
54 /**
55 * Send a request using the default transport for the current platform.
56 */
57 <T>(url: string, options?: RequestOptions): DojoRequestPromise<T>;
58
59 /**
60 * Send an HTTP GET request using the default transport for the current platform.
61 */
62 get<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
63
64 /**
65 * Send an HTTP POST request using the default transport for the current platform.
66 */
67 post<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
68
69 /**
70 * Send an HTTP PUT request using the default transport for the current platform.
71 */
72 put<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
73
74 /**
75 * Send an HTTP DELETE request using the default transport for the current platform.
76 */
77 del<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
78 }
79
80 /* dojo/request/default */
81
82 interface Default {
83
84 getPlatformId(): string; /* './xhr' | './node' */ /* TODO: Uncomment for TS 1.8 */
85
86 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
87 }
88
89 /* dojo/request/handlers */
90
91 interface Handlers {
92 <T>(response: Response<any>): Response<T>;
93 register(name: string, handler: (response: Response<any>) => Response<any>): void;
94 }
95
96 /* dojo/request/iframe */
97
98 interface IFrameBaseOptions extends BaseOptions {
99 form?: HTMLFormElement;
100 data?: string | Object;
101 }
102
103 interface IFrameOptions extends IFrameBaseOptions, MethodOptions { }
104
105 interface IFrame {
106 <T>(url: string, options: IFrameOptions, returnDeferred: boolean): RequestDeferred<T>;
107 <T>(url: string, options?: IFrameOptions): DojoRequestPromise<T>;
108
109 create(name: string, onloadstr?: string, uri?: string): HTMLIFrameElement;
110 doc(iframenode: HTMLIFrameElement): Document;
111 setSrc(_iframe: HTMLIFrameElement, src: string, replace?: boolean): void;
112
113 _iframeName: string;
114 _notifyStart: Function;
115 _dfdQueue: RequestDeferred<any>[];
116 _currentDfd: RequestDeferred<any>;
117 _fireNextRequest(): void;
118
119 /**
120 * Send an HTTP GET request using the default transport for the current platform.
121 */
122 get<T>(url: string, options?: IFrameBaseOptions): DojoRequestPromise<T>;
123
124 /**
125 * Send an HTTP POST request using the default transport for the current platform.
126 */
127 post<T>(url: string, options?: IFrameBaseOptions): DojoRequestPromise<T>;
128 }
129
130 /* dojo/request/node */
131
132 interface NodeRequestBaseOptions extends BaseOptions {
133 socketPath?: string;
134 headers?: { [header: string]: string };
135 agent?: string;
136 pfx?: any;
137 key?: string;
138 passphrase?: string;
139 cert?: any;
140 ca?: any;
141 ciphers?: string;
142 rejectUnauthorized?: boolean;
143 path?: string;
144 auth?: string;
145 username?: string;
146 password?: string;
147 socketOptions?: { timeout: number, noDelay: number, keepAlive: number };
148 }
149
150 interface NodeRequestOptions extends NodeRequestBaseOptions, MethodOptions { }
151
152 interface Node {
153 <T>(url: string, options?: NodeRequestOptions): DojoRequestPromise<T>;
154
155 /**
156 * Send an HTTP GET request using the default transport for the current platform.
157 */
158 get<T>(url: string, options?: NodeRequestBaseOptions): DojoRequestPromise<T>;
159
160 /**
161 * Send an HTTP POST request using the default transport for the current platform.
162 */
163 post<T>(url: string, options?: NodeRequestBaseOptions): DojoRequestPromise<T>;
164
165 /**
166 * Send an HTTP PUT request using the default transport for the current platform.
167 */
168 put<T>(url: string, options?: NodeRequestBaseOptions): DojoRequestPromise<T>;
169
170 /**
171 * Send an HTTP DELETE request using the default transport for the current platform.
172 */
173 del<T>(url: string, options?: NodeRequestBaseOptions): DojoRequestPromise<T>;
174 }
175
176 /* dojo/request/notify */
177
178 /* TODO: Type in TS 1.8 */
179 /* type NotifyType = 'start' | 'send' | 'load' | 'error' | 'done' | 'stop'; */
180
181 interface Notify {
182 /**
183 * Register a listener to be notified when an event
184 * in dojo/request happens.
185 */
186 (type: string /* NotifyType */, listener: (event: any) => void): Handle;
187
188 emit(type: string, event: any, cancel: boolean): any;
189 }
190
191 /* dojo/request/registry */
192
193 interface RegistryOptions extends BaseOptions, MethodOptions { }
194
195 interface RegistryFunction {
196 (url: string, options?: RequestOptions): boolean;
197 }
198
199 interface Provider<T> {
200 (url: string, options?: RequestOptions): DojoRequestPromise<T>;
201 }
202
203 type RegisterUrlType = string | RegExp | RegistryFunction;
204
205 interface Registry {
206 <T>(url: string, options?: RegistryOptions): DojoRequestPromise<T>;
207
208 register<T>(url: RegisterUrlType, provider: Provider<T>, first?: boolean): Handle;
209
210 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
211
212 /**
213 * Send an HTTP GET request using the default transport for the current platform.
214 */
215 get<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
216
217 /**
218 * Send an HTTP POST request using the default transport for the current platform.
219 */
220 post<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
221
222 /**
223 * Send an HTTP PUT request using the default transport for the current platform.
224 */
225 put<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
226
227 /**
228 * Send an HTTP DELETE request using the default transport for the current platform.
229 */
230 del<T>(url: string, options?: BaseOptions): DojoRequestPromise<T>;
231 }
232
233 /* dojo/request/script */
234
235 interface ScriptBaseOptions extends BaseOptions {
236
237 /**
238 * The URL parameter name that indicates the JSONP callback string.
239 * For instance, when using Yahoo JSONP calls it is normally,
240 * jsonp: "callback". For AOL JSONP calls it is normally
241 * jsonp: "c".
242 */
243 jsonp?: string;
244
245 /**
246 * A string of JavaScript that when evaluated like so:
247 * "typeof(" + checkString + ") != 'undefined'"
248 * being true means that the script fetched has been loaded.
249 * Do not use this if doing a JSONP type of call (use `jsonp` instead).
250 */
251 checkString?: string;
252
253 /**
254 * The Document object of a child iframe. If this is passed in, the script
255 * will be attached to that document. This can be helpful in some comet long-polling
256 * scenarios with Firefox and Opera.
257 */
258 frameDoc?: Document;
259 }
260
261 interface ScriptOptions extends ScriptBaseOptions, MethodOptions { }
262
263 interface Script {
264 /**
265 * Sends a request using a script element with the given URL and options.
266 */
267 <T>(url: string, options: ScriptOptions, returnDeferred: boolean): RequestDeferred<T>;
268 <T>(url: string, options?: ScriptOptions): DojoRequestPromise<T>;
269
270 /**
271 * Send an HTTP GET request using XMLHttpRequest with the given URL and options.
272 */
273 get<T>(url: string, options?: ScriptBaseOptions): DojoRequestPromise<T>;
274
275 _attach(id: string, url: string, frameDoc?: Document): HTMLScriptElement;
276 _remove(id: string, frameDoc?: Document, cleanup?: boolean): void;
277 _callbacksProperty: string;
278 }
279
280 /* dojo/request/util */
281
282 interface Response<T> extends ParsedArgs {
283 xhr?: XMLHttpRequest;
284 requestOptions?: NodeRequestOptions;
285 clientRequest?: any;
286 hasSocket?: boolean;
287 clientResponse?: any;
288 status?: number;
289 text?: string;
290 data?: T;
291 }
292
293 interface RequestDeferred<T> extends Deferred<T> {
294 response: Response<T>;
295 isValid(response: Response<T>): boolean;
296 isReady(response: Response<T>): boolean;
297 handleResponse(response: Response<T>): Response<T>;
298 }
299
300 interface CommonMethods<O extends BaseOptions> {
301
302 /**
303 * Send an HTTP GET request using XMLHttpRequest with the given URL and options.
304 */
305 get<T>(url: string, options?: O): DojoRequestPromise<T>;
306
307 /**
308 * Send an HTTP POST request using XMLHttpRequest with the given URL and options.
309 */
310 post<T>(url: string, options?: O): DojoRequestPromise<T>;
311
312 /**
313 * Send an HTTP PUT request using XMLHttpRequest with the given URL and options.
314 */
315 put<T>(url: string, options?: O): DojoRequestPromise<T>;
316
317 /**
318 * Send an HTTP DELETE request using XMLHttpRequest with the given URL and options.
319 */
320 del<T>(url: string, options?: O): DojoRequestPromise<T>;
321 }
322
323 interface ParsedArgs {
324 url: string;
325 options: RequestOptions;
326 getHeader(headerName: string): string;
327 }
328
329 interface Util {
330 deepCopy<T extends Object, S extends Object>(target: T, source: S): T & S;
331 deepCreate<T extends Object, P extends Object>(source: T, properties?: P): T & P;
332
333 deferred<T>(
334 response: Response<T>,
335 cancel: (def: Deferred<Response<T>>, response: Response<T>) => void,
336 isValid: (response: Response<T>) => boolean,
337 isReady: (response: Response<T>) => boolean,
338 last?: boolean
339 ): RequestDeferred<Response<T>>;
340
341 addCommonMethods<T extends Object>(provider: T, methods: string[]): T;
342 addCommonMethods<T extends Object>(provider: T): T & CommonMethods<BaseOptions>;
343
344 parseArgs(url: string, options: BaseOptions, skipData?: boolean): ParsedArgs;
345
346 checkStatus(): boolean;
347 }
348
349 /* dojo/request/watch */
350
351 interface Watch {
352 /**
353 * Watches the io request represented by dfd to see if it completes.
354 */
355 <T>(dfd: DojoRequestPromise<T>): void;
356
357 /**
358 * Cancels all pending IO requests, regardless of IO type
359 */
360 cancelAll(): void;
361 }
362
363 /* dojo/request/xhr */
364
365 interface XhrBaseOptions extends BaseOptions {
366 /**
367 * Whether to make a synchronous request or not. Default
368 * is `false` (asynchronous).
369 */
370 sync?: boolean;
371
372 /**
373 * Data to transfer. This is ignored for GET and DELETE
374 * requests.
375 */
376 data?: string | GenericObject | FormData;
377
378 /**
379 * Headers to use for the request.
380 */
381 headers?: { [header: string]: string };
382
383 /**
384 * Username to use during the request.
385 */
386 user?: string;
387
388 /**
389 * Password to use during the request.
390 */
391 password?: string;
392
393 /**
394 * For cross-site requests, whether to send credentials
395 * or not.
396 */
397 withCredentials?: boolean;
398 }
399
400 interface XhrOptions extends XhrBaseOptions, MethodOptions { }
401
402 interface Xhr {
403 /**
404 * Sends a request using XMLHttpRequest with the given URL and options.
405 */
406 <T>(url: string, options?: XhrOptions): DojoRequestPromise<T>;
407
408 /**
409 * Send an HTTP GET request using XMLHttpRequest with the given URL and options.
410 */
411 get<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
412
413 /**
414 * Send an HTTP POST request using XMLHttpRequest with the given URL and options.
415 */
416 post<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
417
418 /**
419 * Send an HTTP PUT request using XMLHttpRequest with the given URL and options.
420 */
421 put<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
422
423 /**
424 * Send an HTTP DELETE request using XMLHttpRequest with the given URL and options.
425 */
426 del<T>(url: string, options?: XhrBaseOptions): DojoRequestPromise<T>;
427
428 /**
429 * does the work of portably generating a new XMLHTTPRequest object.
430 */
431 _create(): XMLHttpRequest | ActiveXObject;
432 }
433 }
434
435 declare const dojoRequest: dojoRequest.Request;
436 export = dojoRequest; No newline at end of file
@@ -0,0 +1,32
1 import has = require("./has");
2
3 declare module "./has" {
4 interface Has {
5 (name: 'air'): boolean;
6 (name: 'wp'): void | number;
7 (name: 'msapp'): void | number;
8 (name: 'khtml'): void | number;
9 (name: 'edge'): void | number;
10 (name: 'opr'): void | number;
11 (name: 'webkit'): void | number;
12 (name: 'chrome'): void | number;
13 (name: 'android'): void | number;
14 (name: 'safari'): void | number;
15 (name: 'mac'): boolean;
16 (name: 'quirks'): boolean;
17 (name: 'iphone'): void | number;
18 (name: 'ipod'): void | number;
19 (name: 'ipad'): void | number;
20 (name: 'ios'): void | number;
21 (name: 'bb'): void | number | boolean;
22 (name: 'trident'): void | number;
23 (name: 'svg'): boolean;
24 (name: 'opera'): void | number;
25 (name: 'mozilla'): void | number;
26 (name: 'ff'): void | number;
27 (name: 'ie'): void | number;
28 (name: 'wii'): boolean | any;
29 }
30 }
31
32 export = has; No newline at end of file
@@ -0,0 +1,28
1
2 /**
3 * Efficiently escape a string for insertion into HTML (innerHTML or attributes), replacing &, <, >, ", ', and / characters.
4 */
5 export declare function escape(str: string): string;
6
7 /**
8 * Efficiently replicate a string `n` times.
9 */
10 export declare function rep(str: string, num: number): string;
11
12 /**
13 * Pad a string to guarantee that it is at least `size` length by
14 * filling with the character `ch` at either the start or end of the
15 * string. Pads at the start, by default.
16 */
17 export declare function pad(text: string, size: number, ch?: string, end?: boolean): string;
18
19 /**
20 * Performs parameterized substitutions on a string. Throws an
21 * exception if any parameter is unmatched.
22 */
23 export declare function substitute(template: string, map: Object | any[], transform?: (value: any, key: string) => any, thisObject?: Object): string;
24
25 /**
26 * Trims whitespace from both sides of the string
27 */
28 export declare function trim(str: string): string;
@@ -0,0 +1,16
1 import { GenericObject } from "./interfaces";
2
3 interface Cache {
4 (module: string | GenericObject, url: string, value?: string | { value: string, sanitize?: boolean }): string;
5 }
6
7 interface Text {
8 /**
9 * the dojo/text caches it's own resources because of dojo.cache
10 */
11 dynamic: boolean;
12
13 normalize(id: string, toAbsMid: Function): string; /* TODO: Align with loader api */
14
15 load(id: string, parentRequire: Function, loaded: Function): void; /* TODO: Align with loader api */
16 } No newline at end of file
@@ -0,0 +1,14
1 import { ExtensionEvent } from "./on";
2 import { Handle } from "./interfaces";
3
4 /**
5 * Publishes a message to a topic on the pub/sub hub. All arguments after
6 * the first will be passed to the subscribers, so any number of arguments
7 * can be provided (not just event).
8 */
9 export declare function publish(topic: string | ExtensionEvent, ...event: any[]): boolean;
10
11 /**
12 * Subscribes to a topic on the pub/sub hub
13 */
14 export declare function subscribe(topic: string | ExtensionEvent, listener: EventListener | Function): Handle;
@@ -0,0 +1,21
1 import { ExtensionEvent } from "./on";
2
3 interface Touch {
4 press: ExtensionEvent;
5 move: ExtensionEvent;
6 release: ExtensionEvent;
7 cancel: ExtensionEvent;
8 over: ExtensionEvent;
9 out: ExtensionEvent;
10 enter: ExtensionEvent;
11 leave: ExtensionEvent;
12 }
13
14 declare module "./_base/kernel" {
15 interface Dojo {
16 touch: Touch;
17 }
18 }
19
20 declare const touch: Touch;
21 export = touch; No newline at end of file
@@ -0,0 +1,8
1 import { PromiseOrValue } from "./interfaces";
2 import { PromiseCallback, PromiseErrback, PromiseProgback } from "./promise/Promise";
3
4 /**
5 * Transparently applies callbacks to values and/or promises.
6 */
7 export declare function when<T>(value: PromiseOrValue<T>): PromiseLike<T>;
8 export declare function when<T, U1, U2>(value: PromiseOrValue<T>, callback?: PromiseCallback<T, U1>, errback?: PromiseErrback<U2>, progress?: PromiseProgback): PromiseOrValue<U1 | U2>; No newline at end of file
@@ -0,0 +1,16
1 import { DomGeometryBox, DomGeometryXYBox } from "./dom-geometry";
2
3 /**
4 * Returns the dimensions and scroll position of the viewable area of a browser window
5 */
6 export declare function getBox(doc?: Document): DomGeometryBox;
7
8 /**
9 * Get window object associated with document doc.
10 */
11 export declare function get(doc?: Document): Window;
12
13 /**
14 * Scroll the passed node into view using minimal movement, if it is not already.
15 */
16 export declare function scrollIntoView(node: Element, pos?: DomGeometryXYBox): void;
@@ -0,0 +1,9
1 {
2 "extends": "../tsconfig",
3 "compilerOptions": {
4 "baseUrl": "./",
5 "types": [
6 "requirejs"
7 ]
8 }
9 } No newline at end of file
@@ -1,40 +1,60
1 1 plugins {
2 2 id "org.implab.gradle-typescript" version "1.3.1"
3 3 id "ivy-publish"
4 4 }
5 5
6 6 typescript {
7 7 compilerOptions {
8 8 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
9 listFiles = true
9 //listFiles = true
10 10 declaration = true
11 11 strict = true
12 12 types = []
13 13 module = "amd"
14 14 it.target = "es5"
15 15 experimentalDecorators = true
16 16 jsx = "react"
17 17 jsxFactory = "createElement"
18 18 moduleResolution = "node"
19 // traceResolution = true
20 // baseUrl = "./"
21 // paths = [ "*": [ "$projectDir/src/typings/*" ] ]
22 // baseUrl = "$projectDir/src/typings"
23 // typeRoots = ["$projectDir/src/typings"]
19 24 }
20 25
21 26 tscCmd = "$projectDir/node_modules/.bin/tsc"
22 27 tsLintCmd = "$projectDir/node_modules/.bin/tslint"
23 28 esLintCmd = "$projectDir/node_modules/.bin/eslint"
24 29 }
25 30
26 31 configureTsMain {
27 32 compilerOptions {
28 types = ["requirejs", "dojo-typings"]
33 types = ["requirejs"]
34 }
35 }
36
37 npmPackMeta {
38 meta {
39 name = "@$npmScope/$project.name"
40 }
29 41 }
42
43 task npmPackTypings(type: Copy) {
44 dependsOn sources.main.output
45
46 npmPack.dependsOn it
47
48 from sources.main.output.typingsDir
49 into npm.packageDir
30 50 }
31 51
32 52 task printVersion {
33 53 doLast {
34 println "packageName: $packageName";
54 println "packageName: ${npmPackMeta.metadata.get().name}";
35 55 println "version: $version";
36 56 println "target: $typescript.compilerOptions.target";
37 57 println "module: $typescript.compilerOptions.module";
38 58 println "symbols: $symbols";
39 59 }
40 60 } No newline at end of file
@@ -1,1206 +1,1216
1 1 {
2 2 "requires": true,
3 3 "lockfileVersion": 1,
4 4 "dependencies": {
5 5 "@babel/code-frame": {
6 6 "version": "7.8.3",
7 7 "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz",
8 8 "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
9 9 "dev": true,
10 10 "requires": {
11 11 "@babel/highlight": "^7.8.3"
12 12 }
13 13 },
14 14 "@babel/highlight": {
15 15 "version": "7.8.3",
16 16 "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz",
17 17 "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==",
18 18 "dev": true,
19 19 "requires": {
20 20 "chalk": "^2.0.0",
21 21 "esutils": "^2.0.2",
22 22 "js-tokens": "^4.0.0"
23 23 }
24 24 },
25 25 "@babel/runtime": {
26 26 "version": "7.8.3",
27 27 "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.3.tgz",
28 28 "integrity": "sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==",
29 29 "dev": true,
30 30 "requires": {
31 31 "regenerator-runtime": "^0.13.2"
32 32 }
33 33 },
34 34 "@implab/core-amd": {
35 35 "version": "1.3.2",
36 36 "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.3.2.tgz",
37 37 "integrity": "sha512-OPx02obqz60FiOzDqEFuPfag/0ugl1tuQouI+52Op0k+fcmuBK4QACJy7o3fzOYvejdjF1DG4aRXuCm6+vgMYQ==",
38 38 "dev": true
39 39 },
40 40 "@types/chai": {
41 41 "version": "4.1.3",
42 42 "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.3.tgz",
43 43 "integrity": "sha512-f5dXGzOJycyzSMdaXVhiBhauL4dYydXwVpavfQ1mVCaGjR56a9QfklXObUxlIY9bGTmCPHEEZ04I16BZ/8w5ww==",
44 44 "dev": true
45 45 },
46 "@types/dijit": {
47 "version": "file:src/typings/dijit",
48 "dev": true,
49 "requires": {
50 "@types/dojo": "^1.0.0"
51 },
52 "dependencies": {
53 "@types/dojo": {
54 "version": "1.9.42",
55 "resolved": "https://registry.npmjs.org/@types/dojo/-/dojo-1.9.42.tgz",
56 "integrity": "sha512-yFfw7uoOlCy6QgxTWIzii4/QOsIDXq9gX3/6iXQ2nz//Y23yWXFRaYpoQ7GW0fvPN3lKtYkXgv6GXtdtWlHFXg==",
57 "dev": true
58 }
59 }
60 },
61 "@types/dojo": {
62 "version": "file:src/typings/dojo",
63 "dev": true
64 },
46 65 "@types/requirejs": {
47 66 "version": "2.1.31",
48 67 "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz",
49 68 "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==",
50 69 "dev": true
51 70 },
52 71 "@types/yaml": {
53 72 "version": "1.2.0",
54 73 "resolved": "https://registry.npmjs.org/@types/yaml/-/yaml-1.2.0.tgz",
55 74 "integrity": "sha512-GW8b9qM+ebgW3/zjzPm0I1NxMvLaz/YKT9Ph6tTb+Fkeyzd9yLTvQ6ciQ2MorTRmb/qXmfjMerRpG4LviixaqQ==",
56 75 "dev": true
57 76 },
58 77 "acorn": {
59 78 "version": "7.1.0",
60 79 "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
61 80 "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
62 81 "dev": true
63 82 },
64 83 "acorn-jsx": {
65 84 "version": "5.1.0",
66 85 "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz",
67 86 "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==",
68 87 "dev": true
69 88 },
70 89 "ajv": {
71 90 "version": "6.11.0",
72 91 "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz",
73 92 "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==",
74 93 "dev": true,
75 94 "requires": {
76 95 "fast-deep-equal": "^3.1.1",
77 96 "fast-json-stable-stringify": "^2.0.0",
78 97 "json-schema-traverse": "^0.4.1",
79 98 "uri-js": "^4.2.2"
80 99 }
81 100 },
82 101 "ansi-escapes": {
83 102 "version": "4.3.0",
84 103 "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz",
85 104 "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==",
86 105 "dev": true,
87 106 "requires": {
88 107 "type-fest": "^0.8.1"
89 108 }
90 109 },
91 110 "ansi-regex": {
92 111 "version": "5.0.0",
93 112 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
94 113 "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
95 114 "dev": true
96 115 },
97 116 "ansi-styles": {
98 117 "version": "3.2.1",
99 118 "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
100 119 "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
101 120 "dev": true,
102 121 "requires": {
103 122 "color-convert": "^1.9.0"
104 123 }
105 124 },
106 125 "argparse": {
107 126 "version": "1.0.10",
108 127 "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
109 128 "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
110 129 "dev": true,
111 130 "requires": {
112 131 "sprintf-js": "~1.0.2"
113 132 }
114 133 },
115 134 "assertion-error": {
116 135 "version": "1.1.0",
117 136 "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
118 137 "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
119 138 "dev": true
120 139 },
121 140 "astral-regex": {
122 141 "version": "1.0.0",
123 142 "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
124 143 "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
125 144 "dev": true
126 145 },
127 146 "balanced-match": {
128 147 "version": "1.0.0",
129 148 "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
130 149 "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
131 150 "dev": true
132 151 },
133 152 "brace-expansion": {
134 153 "version": "1.1.11",
135 154 "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
136 155 "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
137 156 "dev": true,
138 157 "requires": {
139 158 "balanced-match": "^1.0.0",
140 159 "concat-map": "0.0.1"
141 160 }
142 161 },
143 162 "builtin-modules": {
144 163 "version": "1.1.1",
145 164 "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
146 165 "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
147 166 "dev": true
148 167 },
149 168 "callsites": {
150 169 "version": "3.1.0",
151 170 "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
152 171 "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
153 172 "dev": true
154 173 },
155 174 "chai": {
156 175 "version": "4.2.0",
157 176 "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
158 177 "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
159 178 "dev": true,
160 179 "requires": {
161 180 "assertion-error": "^1.1.0",
162 181 "check-error": "^1.0.2",
163 182 "deep-eql": "^3.0.1",
164 183 "get-func-name": "^2.0.0",
165 184 "pathval": "^1.1.0",
166 185 "type-detect": "^4.0.5"
167 186 }
168 187 },
169 188 "chalk": {
170 189 "version": "2.4.2",
171 190 "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
172 191 "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
173 192 "dev": true,
174 193 "requires": {
175 194 "ansi-styles": "^3.2.1",
176 195 "escape-string-regexp": "^1.0.5",
177 196 "supports-color": "^5.3.0"
178 197 }
179 198 },
180 199 "chardet": {
181 200 "version": "0.7.0",
182 201 "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
183 202 "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
184 203 "dev": true
185 204 },
186 205 "check-error": {
187 206 "version": "1.0.2",
188 207 "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
189 208 "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
190 209 "dev": true
191 210 },
192 211 "cli-cursor": {
193 212 "version": "3.1.0",
194 213 "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
195 214 "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
196 215 "dev": true,
197 216 "requires": {
198 217 "restore-cursor": "^3.1.0"
199 218 }
200 219 },
201 220 "cli-width": {
202 221 "version": "2.2.0",
203 222 "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
204 223 "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
205 224 "dev": true
206 225 },
207 226 "color-convert": {
208 227 "version": "1.9.3",
209 228 "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
210 229 "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
211 230 "dev": true,
212 231 "requires": {
213 232 "color-name": "1.1.3"
214 233 }
215 234 },
216 235 "color-name": {
217 236 "version": "1.1.3",
218 237 "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
219 238 "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
220 239 "dev": true
221 240 },
222 241 "commander": {
223 242 "version": "2.20.3",
224 243 "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
225 244 "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
226 245 "dev": true
227 246 },
228 247 "concat-map": {
229 248 "version": "0.0.1",
230 249 "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
231 250 "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
232 251 "dev": true
233 252 },
234 253 "cross-spawn": {
235 254 "version": "6.0.5",
236 255 "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
237 256 "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
238 257 "dev": true,
239 258 "requires": {
240 259 "nice-try": "^1.0.4",
241 260 "path-key": "^2.0.1",
242 261 "semver": "^5.5.0",
243 262 "shebang-command": "^1.2.0",
244 263 "which": "^1.2.9"
245 264 },
246 265 "dependencies": {
247 266 "semver": {
248 267 "version": "5.7.1",
249 268 "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
250 269 "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
251 270 "dev": true
252 271 }
253 272 }
254 273 },
255 274 "debug": {
256 275 "version": "4.1.1",
257 276 "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
258 277 "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
259 278 "dev": true,
260 279 "requires": {
261 280 "ms": "^2.1.1"
262 281 }
263 282 },
264 283 "deep-eql": {
265 284 "version": "3.0.1",
266 285 "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
267 286 "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
268 287 "dev": true,
269 288 "requires": {
270 289 "type-detect": "^4.0.0"
271 290 }
272 291 },
273 292 "deep-is": {
274 293 "version": "0.1.3",
275 294 "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
276 295 "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
277 296 "dev": true
278 297 },
279 298 "diff": {
280 299 "version": "4.0.2",
281 300 "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
282 301 "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
283 302 "dev": true
284 303 },
285 304 "doctrine": {
286 305 "version": "3.0.0",
287 306 "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
288 307 "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
289 308 "dev": true,
290 309 "requires": {
291 310 "esutils": "^2.0.2"
292 311 }
293 312 },
294 313 "dojo": {
295 314 "version": "1.16.0",
296 315 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.16.0.tgz",
297 316 "integrity": "sha512-DUiXyoLK6vMF5BPr/qiMLTxDMfiM9qlzN1jxfDsVfuvB/CwhYpNxA/M4mbqKN8PCVGLmccXBJbfmFJPP5+zmzw==",
298 317 "dev": true
299 318 },
300 "dojo-typings": {
301 "version": "1.11.9",
302 "resolved": "https://registry.npmjs.org/dojo-typings/-/dojo-typings-1.11.9.tgz",
303 "integrity": "sha512-mh8w+Mau2Y1QfTEszEAdO7j6ycNhYxF/Ing6nAk1eUg6NxjeT0viVHjICMd9sU3U463vM2G+KfBBK5grk3/Mlw==",
304 "dev": true,
305 "requires": {
306 "@types/chai": "^4.0.4"
307 }
308 },
309 319 "emoji-regex": {
310 320 "version": "8.0.0",
311 321 "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
312 322 "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
313 323 "dev": true
314 324 },
315 325 "escape-string-regexp": {
316 326 "version": "1.0.5",
317 327 "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
318 328 "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
319 329 "dev": true
320 330 },
321 331 "eslint": {
322 332 "version": "6.8.0",
323 333 "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz",
324 334 "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==",
325 335 "dev": true,
326 336 "requires": {
327 337 "@babel/code-frame": "^7.0.0",
328 338 "ajv": "^6.10.0",
329 339 "chalk": "^2.1.0",
330 340 "cross-spawn": "^6.0.5",
331 341 "debug": "^4.0.1",
332 342 "doctrine": "^3.0.0",
333 343 "eslint-scope": "^5.0.0",
334 344 "eslint-utils": "^1.4.3",
335 345 "eslint-visitor-keys": "^1.1.0",
336 346 "espree": "^6.1.2",
337 347 "esquery": "^1.0.1",
338 348 "esutils": "^2.0.2",
339 349 "file-entry-cache": "^5.0.1",
340 350 "functional-red-black-tree": "^1.0.1",
341 351 "glob-parent": "^5.0.0",
342 352 "globals": "^12.1.0",
343 353 "ignore": "^4.0.6",
344 354 "import-fresh": "^3.0.0",
345 355 "imurmurhash": "^0.1.4",
346 356 "inquirer": "^7.0.0",
347 357 "is-glob": "^4.0.0",
348 358 "js-yaml": "^3.13.1",
349 359 "json-stable-stringify-without-jsonify": "^1.0.1",
350 360 "levn": "^0.3.0",
351 361 "lodash": "^4.17.14",
352 362 "minimatch": "^3.0.4",
353 363 "mkdirp": "^0.5.1",
354 364 "natural-compare": "^1.4.0",
355 365 "optionator": "^0.8.3",
356 366 "progress": "^2.0.0",
357 367 "regexpp": "^2.0.1",
358 368 "semver": "^6.1.2",
359 369 "strip-ansi": "^5.2.0",
360 370 "strip-json-comments": "^3.0.1",
361 371 "table": "^5.2.3",
362 372 "text-table": "^0.2.0",
363 373 "v8-compile-cache": "^2.0.3"
364 374 }
365 375 },
366 376 "eslint-scope": {
367 377 "version": "5.0.0",
368 378 "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
369 379 "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
370 380 "dev": true,
371 381 "requires": {
372 382 "esrecurse": "^4.1.0",
373 383 "estraverse": "^4.1.1"
374 384 }
375 385 },
376 386 "eslint-utils": {
377 387 "version": "1.4.3",
378 388 "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz",
379 389 "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==",
380 390 "dev": true,
381 391 "requires": {
382 392 "eslint-visitor-keys": "^1.1.0"
383 393 }
384 394 },
385 395 "eslint-visitor-keys": {
386 396 "version": "1.1.0",
387 397 "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz",
388 398 "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==",
389 399 "dev": true
390 400 },
391 401 "espree": {
392 402 "version": "6.1.2",
393 403 "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz",
394 404 "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==",
395 405 "dev": true,
396 406 "requires": {
397 407 "acorn": "^7.1.0",
398 408 "acorn-jsx": "^5.1.0",
399 409 "eslint-visitor-keys": "^1.1.0"
400 410 }
401 411 },
402 412 "esprima": {
403 413 "version": "4.0.1",
404 414 "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
405 415 "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
406 416 "dev": true
407 417 },
408 418 "esquery": {
409 419 "version": "1.0.1",
410 420 "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
411 421 "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
412 422 "dev": true,
413 423 "requires": {
414 424 "estraverse": "^4.0.0"
415 425 }
416 426 },
417 427 "esrecurse": {
418 428 "version": "4.2.1",
419 429 "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
420 430 "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
421 431 "dev": true,
422 432 "requires": {
423 433 "estraverse": "^4.1.0"
424 434 }
425 435 },
426 436 "estraverse": {
427 437 "version": "4.3.0",
428 438 "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
429 439 "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
430 440 "dev": true
431 441 },
432 442 "esutils": {
433 443 "version": "2.0.3",
434 444 "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
435 445 "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
436 446 "dev": true
437 447 },
438 448 "external-editor": {
439 449 "version": "3.1.0",
440 450 "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
441 451 "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
442 452 "dev": true,
443 453 "requires": {
444 454 "chardet": "^0.7.0",
445 455 "iconv-lite": "^0.4.24",
446 456 "tmp": "^0.0.33"
447 457 }
448 458 },
449 459 "fast-deep-equal": {
450 460 "version": "3.1.1",
451 461 "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
452 462 "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
453 463 "dev": true
454 464 },
455 465 "fast-json-stable-stringify": {
456 466 "version": "2.1.0",
457 467 "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
458 468 "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
459 469 "dev": true
460 470 },
461 471 "fast-levenshtein": {
462 472 "version": "2.0.6",
463 473 "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
464 474 "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
465 475 "dev": true
466 476 },
467 477 "figures": {
468 478 "version": "3.1.0",
469 479 "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz",
470 480 "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==",
471 481 "dev": true,
472 482 "requires": {
473 483 "escape-string-regexp": "^1.0.5"
474 484 }
475 485 },
476 486 "file-entry-cache": {
477 487 "version": "5.0.1",
478 488 "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
479 489 "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
480 490 "dev": true,
481 491 "requires": {
482 492 "flat-cache": "^2.0.1"
483 493 }
484 494 },
485 495 "flat-cache": {
486 496 "version": "2.0.1",
487 497 "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
488 498 "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
489 499 "dev": true,
490 500 "requires": {
491 501 "flatted": "^2.0.0",
492 502 "rimraf": "2.6.3",
493 503 "write": "1.0.3"
494 504 }
495 505 },
496 506 "flatted": {
497 507 "version": "2.0.1",
498 508 "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz",
499 509 "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
500 510 "dev": true
501 511 },
502 512 "fs.realpath": {
503 513 "version": "1.0.0",
504 514 "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
505 515 "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
506 516 "dev": true
507 517 },
508 518 "functional-red-black-tree": {
509 519 "version": "1.0.1",
510 520 "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
511 521 "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
512 522 "dev": true
513 523 },
514 524 "get-func-name": {
515 525 "version": "2.0.0",
516 526 "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
517 527 "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
518 528 "dev": true
519 529 },
520 530 "glob": {
521 531 "version": "7.1.6",
522 532 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
523 533 "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
524 534 "dev": true,
525 535 "requires": {
526 536 "fs.realpath": "^1.0.0",
527 537 "inflight": "^1.0.4",
528 538 "inherits": "2",
529 539 "minimatch": "^3.0.4",
530 540 "once": "^1.3.0",
531 541 "path-is-absolute": "^1.0.0"
532 542 }
533 543 },
534 544 "glob-parent": {
535 545 "version": "5.1.0",
536 546 "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
537 547 "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
538 548 "dev": true,
539 549 "requires": {
540 550 "is-glob": "^4.0.1"
541 551 }
542 552 },
543 553 "globals": {
544 554 "version": "12.3.0",
545 555 "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz",
546 556 "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==",
547 557 "dev": true,
548 558 "requires": {
549 559 "type-fest": "^0.8.1"
550 560 }
551 561 },
552 562 "has-flag": {
553 563 "version": "3.0.0",
554 564 "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
555 565 "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
556 566 "dev": true
557 567 },
558 568 "iconv-lite": {
559 569 "version": "0.4.24",
560 570 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
561 571 "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
562 572 "dev": true,
563 573 "requires": {
564 574 "safer-buffer": ">= 2.1.2 < 3"
565 575 }
566 576 },
567 577 "ignore": {
568 578 "version": "4.0.6",
569 579 "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
570 580 "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
571 581 "dev": true
572 582 },
573 583 "import-fresh": {
574 584 "version": "3.2.1",
575 585 "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
576 586 "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
577 587 "dev": true,
578 588 "requires": {
579 589 "parent-module": "^1.0.0",
580 590 "resolve-from": "^4.0.0"
581 591 }
582 592 },
583 593 "imurmurhash": {
584 594 "version": "0.1.4",
585 595 "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
586 596 "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
587 597 "dev": true
588 598 },
589 599 "inflight": {
590 600 "version": "1.0.6",
591 601 "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
592 602 "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
593 603 "dev": true,
594 604 "requires": {
595 605 "once": "^1.3.0",
596 606 "wrappy": "1"
597 607 }
598 608 },
599 609 "inherits": {
600 610 "version": "2.0.4",
601 611 "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
602 612 "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
603 613 "dev": true
604 614 },
605 615 "inquirer": {
606 616 "version": "7.0.3",
607 617 "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz",
608 618 "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==",
609 619 "dev": true,
610 620 "requires": {
611 621 "ansi-escapes": "^4.2.1",
612 622 "chalk": "^2.4.2",
613 623 "cli-cursor": "^3.1.0",
614 624 "cli-width": "^2.0.0",
615 625 "external-editor": "^3.0.3",
616 626 "figures": "^3.0.0",
617 627 "lodash": "^4.17.15",
618 628 "mute-stream": "0.0.8",
619 629 "run-async": "^2.2.0",
620 630 "rxjs": "^6.5.3",
621 631 "string-width": "^4.1.0",
622 632 "strip-ansi": "^5.1.0",
623 633 "through": "^2.3.6"
624 634 }
625 635 },
626 636 "is-extglob": {
627 637 "version": "2.1.1",
628 638 "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
629 639 "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
630 640 "dev": true
631 641 },
632 642 "is-fullwidth-code-point": {
633 643 "version": "3.0.0",
634 644 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
635 645 "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
636 646 "dev": true
637 647 },
638 648 "is-glob": {
639 649 "version": "4.0.1",
640 650 "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
641 651 "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
642 652 "dev": true,
643 653 "requires": {
644 654 "is-extglob": "^2.1.1"
645 655 }
646 656 },
647 657 "is-promise": {
648 658 "version": "2.1.0",
649 659 "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
650 660 "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
651 661 "dev": true
652 662 },
653 663 "isexe": {
654 664 "version": "2.0.0",
655 665 "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
656 666 "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
657 667 "dev": true
658 668 },
659 669 "js-tokens": {
660 670 "version": "4.0.0",
661 671 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
662 672 "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
663 673 "dev": true
664 674 },
665 675 "js-yaml": {
666 676 "version": "3.13.1",
667 677 "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
668 678 "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
669 679 "dev": true,
670 680 "requires": {
671 681 "argparse": "^1.0.7",
672 682 "esprima": "^4.0.0"
673 683 }
674 684 },
675 685 "json-schema-traverse": {
676 686 "version": "0.4.1",
677 687 "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
678 688 "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
679 689 "dev": true
680 690 },
681 691 "json-stable-stringify-without-jsonify": {
682 692 "version": "1.0.1",
683 693 "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
684 694 "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
685 695 "dev": true
686 696 },
687 697 "levn": {
688 698 "version": "0.3.0",
689 699 "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
690 700 "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
691 701 "dev": true,
692 702 "requires": {
693 703 "prelude-ls": "~1.1.2",
694 704 "type-check": "~0.3.2"
695 705 }
696 706 },
697 707 "lodash": {
698 708 "version": "4.17.15",
699 709 "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
700 710 "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
701 711 "dev": true
702 712 },
703 713 "mimic-fn": {
704 714 "version": "2.1.0",
705 715 "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
706 716 "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
707 717 "dev": true
708 718 },
709 719 "minimatch": {
710 720 "version": "3.0.4",
711 721 "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
712 722 "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
713 723 "dev": true,
714 724 "requires": {
715 725 "brace-expansion": "^1.1.7"
716 726 }
717 727 },
718 728 "minimist": {
719 729 "version": "0.0.8",
720 730 "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
721 731 "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
722 732 "dev": true
723 733 },
724 734 "mkdirp": {
725 735 "version": "0.5.1",
726 736 "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
727 737 "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
728 738 "dev": true,
729 739 "requires": {
730 740 "minimist": "0.0.8"
731 741 }
732 742 },
733 743 "ms": {
734 744 "version": "2.1.2",
735 745 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
736 746 "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
737 747 "dev": true
738 748 },
739 749 "mute-stream": {
740 750 "version": "0.0.8",
741 751 "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
742 752 "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
743 753 "dev": true
744 754 },
745 755 "natural-compare": {
746 756 "version": "1.4.0",
747 757 "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
748 758 "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
749 759 "dev": true
750 760 },
751 761 "nice-try": {
752 762 "version": "1.0.5",
753 763 "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
754 764 "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
755 765 "dev": true
756 766 },
757 767 "once": {
758 768 "version": "1.4.0",
759 769 "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
760 770 "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
761 771 "dev": true,
762 772 "requires": {
763 773 "wrappy": "1"
764 774 }
765 775 },
766 776 "onetime": {
767 777 "version": "5.1.0",
768 778 "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz",
769 779 "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==",
770 780 "dev": true,
771 781 "requires": {
772 782 "mimic-fn": "^2.1.0"
773 783 }
774 784 },
775 785 "optionator": {
776 786 "version": "0.8.3",
777 787 "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
778 788 "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
779 789 "dev": true,
780 790 "requires": {
781 791 "deep-is": "~0.1.3",
782 792 "fast-levenshtein": "~2.0.6",
783 793 "levn": "~0.3.0",
784 794 "prelude-ls": "~1.1.2",
785 795 "type-check": "~0.3.2",
786 796 "word-wrap": "~1.2.3"
787 797 }
788 798 },
789 799 "os-tmpdir": {
790 800 "version": "1.0.2",
791 801 "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
792 802 "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
793 803 "dev": true
794 804 },
795 805 "parent-module": {
796 806 "version": "1.0.1",
797 807 "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
798 808 "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
799 809 "dev": true,
800 810 "requires": {
801 811 "callsites": "^3.0.0"
802 812 }
803 813 },
804 814 "path-is-absolute": {
805 815 "version": "1.0.1",
806 816 "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
807 817 "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
808 818 "dev": true
809 819 },
810 820 "path-key": {
811 821 "version": "2.0.1",
812 822 "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
813 823 "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
814 824 "dev": true
815 825 },
816 826 "path-parse": {
817 827 "version": "1.0.6",
818 828 "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
819 829 "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
820 830 "dev": true
821 831 },
822 832 "pathval": {
823 833 "version": "1.1.0",
824 834 "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
825 835 "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
826 836 "dev": true
827 837 },
828 838 "prelude-ls": {
829 839 "version": "1.1.2",
830 840 "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
831 841 "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
832 842 "dev": true
833 843 },
834 844 "progress": {
835 845 "version": "2.0.3",
836 846 "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
837 847 "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
838 848 "dev": true
839 849 },
840 850 "punycode": {
841 851 "version": "2.1.1",
842 852 "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
843 853 "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
844 854 "dev": true
845 855 },
846 856 "regenerator-runtime": {
847 857 "version": "0.13.3",
848 858 "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
849 859 "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==",
850 860 "dev": true
851 861 },
852 862 "regexpp": {
853 863 "version": "2.0.1",
854 864 "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
855 865 "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
856 866 "dev": true
857 867 },
858 868 "resolve": {
859 869 "version": "1.15.0",
860 870 "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz",
861 871 "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==",
862 872 "dev": true,
863 873 "requires": {
864 874 "path-parse": "^1.0.6"
865 875 }
866 876 },
867 877 "resolve-from": {
868 878 "version": "4.0.0",
869 879 "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
870 880 "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
871 881 "dev": true
872 882 },
873 883 "restore-cursor": {
874 884 "version": "3.1.0",
875 885 "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
876 886 "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
877 887 "dev": true,
878 888 "requires": {
879 889 "onetime": "^5.1.0",
880 890 "signal-exit": "^3.0.2"
881 891 }
882 892 },
883 893 "rimraf": {
884 894 "version": "2.6.3",
885 895 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
886 896 "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
887 897 "dev": true,
888 898 "requires": {
889 899 "glob": "^7.1.3"
890 900 }
891 901 },
892 902 "run-async": {
893 903 "version": "2.3.0",
894 904 "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
895 905 "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
896 906 "dev": true,
897 907 "requires": {
898 908 "is-promise": "^2.1.0"
899 909 }
900 910 },
901 911 "rxjs": {
902 912 "version": "6.5.4",
903 913 "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
904 914 "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
905 915 "dev": true,
906 916 "requires": {
907 917 "tslib": "^1.9.0"
908 918 }
909 919 },
910 920 "safer-buffer": {
911 921 "version": "2.1.2",
912 922 "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
913 923 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
914 924 "dev": true
915 925 },
916 926 "semver": {
917 927 "version": "6.3.0",
918 928 "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
919 929 "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
920 930 "dev": true
921 931 },
922 932 "shebang-command": {
923 933 "version": "1.2.0",
924 934 "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
925 935 "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
926 936 "dev": true,
927 937 "requires": {
928 938 "shebang-regex": "^1.0.0"
929 939 }
930 940 },
931 941 "shebang-regex": {
932 942 "version": "1.0.0",
933 943 "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
934 944 "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
935 945 "dev": true
936 946 },
937 947 "signal-exit": {
938 948 "version": "3.0.2",
939 949 "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
940 950 "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
941 951 "dev": true
942 952 },
943 953 "slice-ansi": {
944 954 "version": "2.1.0",
945 955 "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
946 956 "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
947 957 "dev": true,
948 958 "requires": {
949 959 "ansi-styles": "^3.2.0",
950 960 "astral-regex": "^1.0.0",
951 961 "is-fullwidth-code-point": "^2.0.0"
952 962 },
953 963 "dependencies": {
954 964 "is-fullwidth-code-point": {
955 965 "version": "2.0.0",
956 966 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
957 967 "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
958 968 "dev": true
959 969 }
960 970 }
961 971 },
962 972 "sprintf-js": {
963 973 "version": "1.0.3",
964 974 "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
965 975 "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
966 976 "dev": true
967 977 },
968 978 "string-width": {
969 979 "version": "4.2.0",
970 980 "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
971 981 "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
972 982 "dev": true,
973 983 "requires": {
974 984 "emoji-regex": "^8.0.0",
975 985 "is-fullwidth-code-point": "^3.0.0",
976 986 "strip-ansi": "^6.0.0"
977 987 },
978 988 "dependencies": {
979 989 "strip-ansi": {
980 990 "version": "6.0.0",
981 991 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
982 992 "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
983 993 "dev": true,
984 994 "requires": {
985 995 "ansi-regex": "^5.0.0"
986 996 }
987 997 }
988 998 }
989 999 },
990 1000 "strip-ansi": {
991 1001 "version": "5.2.0",
992 1002 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
993 1003 "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
994 1004 "dev": true,
995 1005 "requires": {
996 1006 "ansi-regex": "^4.1.0"
997 1007 },
998 1008 "dependencies": {
999 1009 "ansi-regex": {
1000 1010 "version": "4.1.0",
1001 1011 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
1002 1012 "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
1003 1013 "dev": true
1004 1014 }
1005 1015 }
1006 1016 },
1007 1017 "strip-json-comments": {
1008 1018 "version": "3.0.1",
1009 1019 "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
1010 1020 "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
1011 1021 "dev": true
1012 1022 },
1013 1023 "supports-color": {
1014 1024 "version": "5.5.0",
1015 1025 "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
1016 1026 "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
1017 1027 "dev": true,
1018 1028 "requires": {
1019 1029 "has-flag": "^3.0.0"
1020 1030 }
1021 1031 },
1022 1032 "table": {
1023 1033 "version": "5.4.6",
1024 1034 "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
1025 1035 "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
1026 1036 "dev": true,
1027 1037 "requires": {
1028 1038 "ajv": "^6.10.2",
1029 1039 "lodash": "^4.17.14",
1030 1040 "slice-ansi": "^2.1.0",
1031 1041 "string-width": "^3.0.0"
1032 1042 },
1033 1043 "dependencies": {
1034 1044 "emoji-regex": {
1035 1045 "version": "7.0.3",
1036 1046 "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
1037 1047 "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
1038 1048 "dev": true
1039 1049 },
1040 1050 "is-fullwidth-code-point": {
1041 1051 "version": "2.0.0",
1042 1052 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
1043 1053 "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
1044 1054 "dev": true
1045 1055 },
1046 1056 "string-width": {
1047 1057 "version": "3.1.0",
1048 1058 "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
1049 1059 "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
1050 1060 "dev": true,
1051 1061 "requires": {
1052 1062 "emoji-regex": "^7.0.1",
1053 1063 "is-fullwidth-code-point": "^2.0.0",
1054 1064 "strip-ansi": "^5.1.0"
1055 1065 }
1056 1066 }
1057 1067 }
1058 1068 },
1059 1069 "text-table": {
1060 1070 "version": "0.2.0",
1061 1071 "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
1062 1072 "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
1063 1073 "dev": true
1064 1074 },
1065 1075 "through": {
1066 1076 "version": "2.3.8",
1067 1077 "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
1068 1078 "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
1069 1079 "dev": true
1070 1080 },
1071 1081 "tmp": {
1072 1082 "version": "0.0.33",
1073 1083 "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
1074 1084 "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
1075 1085 "dev": true,
1076 1086 "requires": {
1077 1087 "os-tmpdir": "~1.0.2"
1078 1088 }
1079 1089 },
1080 1090 "tslib": {
1081 1091 "version": "1.10.0",
1082 1092 "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
1083 1093 "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
1084 1094 "dev": true
1085 1095 },
1086 1096 "tslint": {
1087 1097 "version": "6.0.0",
1088 1098 "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.0.0.tgz",
1089 1099 "integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==",
1090 1100 "dev": true,
1091 1101 "requires": {
1092 1102 "@babel/code-frame": "^7.0.0",
1093 1103 "builtin-modules": "^1.1.1",
1094 1104 "chalk": "^2.3.0",
1095 1105 "commander": "^2.12.1",
1096 1106 "diff": "^4.0.1",
1097 1107 "glob": "^7.1.1",
1098 1108 "js-yaml": "^3.13.1",
1099 1109 "minimatch": "^3.0.4",
1100 1110 "mkdirp": "^0.5.1",
1101 1111 "resolve": "^1.3.2",
1102 1112 "semver": "^5.3.0",
1103 1113 "tslib": "^1.10.0",
1104 1114 "tsutils": "^2.29.0"
1105 1115 },
1106 1116 "dependencies": {
1107 1117 "semver": {
1108 1118 "version": "5.7.1",
1109 1119 "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
1110 1120 "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
1111 1121 "dev": true
1112 1122 }
1113 1123 }
1114 1124 },
1115 1125 "tsutils": {
1116 1126 "version": "2.29.0",
1117 1127 "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
1118 1128 "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
1119 1129 "dev": true,
1120 1130 "requires": {
1121 1131 "tslib": "^1.8.1"
1122 1132 }
1123 1133 },
1124 1134 "type-check": {
1125 1135 "version": "0.3.2",
1126 1136 "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
1127 1137 "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
1128 1138 "dev": true,
1129 1139 "requires": {
1130 1140 "prelude-ls": "~1.1.2"
1131 1141 }
1132 1142 },
1133 1143 "type-detect": {
1134 1144 "version": "4.0.8",
1135 1145 "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
1136 1146 "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
1137 1147 "dev": true
1138 1148 },
1139 1149 "type-fest": {
1140 1150 "version": "0.8.1",
1141 1151 "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
1142 1152 "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
1143 1153 "dev": true
1144 1154 },
1145 1155 "typescript": {
1146 1156 "version": "3.7.5",
1147 1157 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
1148 1158 "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
1149 1159 "dev": true
1150 1160 },
1151 1161 "uri-js": {
1152 1162 "version": "4.2.2",
1153 1163 "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
1154 1164 "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
1155 1165 "dev": true,
1156 1166 "requires": {
1157 1167 "punycode": "^2.1.0"
1158 1168 }
1159 1169 },
1160 1170 "v8-compile-cache": {
1161 1171 "version": "2.1.0",
1162 1172 "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz",
1163 1173 "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==",
1164 1174 "dev": true
1165 1175 },
1166 1176 "which": {
1167 1177 "version": "1.3.1",
1168 1178 "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
1169 1179 "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
1170 1180 "dev": true,
1171 1181 "requires": {
1172 1182 "isexe": "^2.0.0"
1173 1183 }
1174 1184 },
1175 1185 "word-wrap": {
1176 1186 "version": "1.2.3",
1177 1187 "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
1178 1188 "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
1179 1189 "dev": true
1180 1190 },
1181 1191 "wrappy": {
1182 1192 "version": "1.0.2",
1183 1193 "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
1184 1194 "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
1185 1195 "dev": true
1186 1196 },
1187 1197 "write": {
1188 1198 "version": "1.0.3",
1189 1199 "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz",
1190 1200 "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==",
1191 1201 "dev": true,
1192 1202 "requires": {
1193 1203 "mkdirp": "^0.5.1"
1194 1204 }
1195 1205 },
1196 1206 "yaml": {
1197 1207 "version": "1.7.2",
1198 1208 "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz",
1199 1209 "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==",
1200 1210 "dev": true,
1201 1211 "requires": {
1202 1212 "@babel/runtime": "^7.6.3"
1203 1213 }
1204 1214 }
1205 1215 }
1206 1216 }
@@ -1,15 +1,16
1 1 {
2 2 "devDependencies": {
3 3 "@types/requirejs": "2.1.31",
4 4 "dojo": "1.16.0",
5 "dojo-typings": "1.11.9",
6 5 "typescript": "~3.7.5",
7 6 "eslint": "6.8.0",
8 7 "tslint": "6.0.0",
9 8 "@implab/core-amd": "^1.3.2",
10 9 "yaml": "~1.7.2",
11 10 "@types/yaml": "1.2.0",
12 11 "chai": "4.2.0",
13 "@types/chai": "4.1.3"
12 "@types/chai": "4.1.3",
13 "@types/dojo": "./src/typings/dojo",
14 "@types/dijit": "./src/typings/dijit"
14 15 }
15 16 }
@@ -1,15 +1,15
1 1 /*
2 2 * This settings file was generated by the Gradle 'init' task.
3 3 *
4 4 * The settings file is used to specify which projects to include in your build.
5 5 * In a single project build this file can be empty or even removed.
6 6 *
7 7 * Detailed information about configuring a multi-project build in Gradle can be found
8 8 * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html
9 9 */
10 10
11 11 // To declare projects as part of a multi-project build use the 'include' method
12 12
13 13 //include 'sub-project-name'
14 14
15 //rootProject.name = 'djx' No newline at end of file
15 rootProject.name = 'djx' No newline at end of file
@@ -1,233 +1,234
1 1 import declare = require("dojo/_base/declare");
2 2 import { each } from "@implab/core-amd/safe";
3 3 import { Constructor } from "@implab/core-amd/interfaces";
4 import { DeclareConstructor } from "dojo/_base/declare";
4 5
5 6 export interface AbstractConstructor<T = {}> {
6 7 prototype: T;
7 8 }
8 9
9 10 interface DjMockConstructor<T = {}> {
10 11 new(...args: any[]): T;
11 12 mock: boolean;
12 13 base: AbstractConstructor;
13 14 }
14 15
15 16 export function djbase<T>(
16 17 b0: AbstractConstructor<T>
17 ): dojo._base.DeclareConstructor<T>;
18 ): DeclareConstructor<T>;
18 19
19 20 export function djbase<T0, T1>(
20 21 b0: AbstractConstructor<T0>,
21 22 b1: AbstractConstructor<T1>
22 ): dojo._base.DeclareConstructor<T0 & T1>;
23 ): DeclareConstructor<T0 & T1>;
23 24
24 25 export function djbase<T0, T1, T2>(
25 26 b0: AbstractConstructor<T0>,
26 27 b1: AbstractConstructor<T1>,
27 28 b2: AbstractConstructor<T2>
28 ): dojo._base.DeclareConstructor<T0 & T1 & T2>;
29 ): DeclareConstructor<T0 & T1 & T2>;
29 30
30 31 export function djbase<T0, T1, T2, T3>(
31 32 b0: AbstractConstructor<T0>,
32 33 b1: AbstractConstructor<T1>,
33 34 b2: AbstractConstructor<T2>,
34 35 b3: AbstractConstructor<T3>
35 ): dojo._base.DeclareConstructor<T0 & T1 & T2 & T3>;
36 ): DeclareConstructor<T0 & T1 & T2 & T3>;
36 37
37 38 export function djbase<T0, T1, T2, T3, T4>(
38 39 b0: AbstractConstructor<T0>,
39 40 b1: AbstractConstructor<T1>,
40 41 b2: AbstractConstructor<T2>,
41 42 b3: AbstractConstructor<T3>,
42 43 b4: AbstractConstructor<T4>
43 ): dojo._base.DeclareConstructor<T0 & T1 & T2 & T3 & T4>;
44 ): DeclareConstructor<T0 & T1 & T2 & T3 & T4>;
44 45
45 46 export function djbase<T0, T1, T2, T3, T4, T5>(
46 47 b0: AbstractConstructor<T0>,
47 48 b1: AbstractConstructor<T1>,
48 49 b2: AbstractConstructor<T2>,
49 50 b3: AbstractConstructor<T3>,
50 51 b4: AbstractConstructor<T4>,
51 52 b5: AbstractConstructor<T5>
52 ): dojo._base.DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5>;
53 ): DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5>;
53 54
54 55 export function djbase<T0, T1, T2, T3, T4, T5, T6>(
55 56 b0: AbstractConstructor<T0>,
56 57 b1: AbstractConstructor<T1>,
57 58 b2: AbstractConstructor<T2>,
58 59 b3: AbstractConstructor<T3>,
59 60 b4: AbstractConstructor<T4>,
60 61 b5: AbstractConstructor<T5>,
61 62 b6: AbstractConstructor<T6>
62 ): dojo._base.DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5 & T6>;
63 ): DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5 & T6>;
63 64
64 65 export function djbase<T0, T1, T2, T3, T4, T5, T6, T7>(
65 66 b0: AbstractConstructor<T0>,
66 67 b1: AbstractConstructor<T1>,
67 68 b2: AbstractConstructor<T2>,
68 69 b3: AbstractConstructor<T3>,
69 70 b4: AbstractConstructor<T4>,
70 71 b5: AbstractConstructor<T5>,
71 72 b6: AbstractConstructor<T6>,
72 73 b7: AbstractConstructor<T7>
73 ): dojo._base.DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5 & T6 & T7>;
74 ): DeclareConstructor<T0 & T1 & T2 & T3 & T4 & T5 & T6 & T7>;
74 75
75 76 /** Создает конструктор-заглушку из списка базовых классов, используется
76 77 * для объявления классов при помощи `dojo/_base/declare`.
77 78 *
78 79 * Создает пустой конструтор, с пустым стандартным прототипом, это нужно,
79 80 * поскольку в унаследованном классе конструктор обязательно должен вызвать
80 81 * `super(...)`, таким образом он вызовет пустую функцию.
81 82 *
82 83 * Созданный конструтор хранит в себе список базовых классов, который будет
83 84 * использован декоратором `djclass`, который вернет класс, объявленный при
84 85 * помощи `dojo/_base/declare`.
85 86 *
86 87 * @param bases список базовых классов, от которых требуется унаследовать
87 88 * новый класс.
88 89 *
89 90 */
90 91 export function djbase(...bases: any[]): Constructor {
91 92
92 93 const t = class {
93 94 static mock: boolean;
94 95 static base: AbstractConstructor;
95 96 };
96 97
97 98 t.mock = true;
98 99 t.base = declare(bases);
99 100
100 101 return t as any;
101 102 }
102 103
103 104 function isMockConstructor<T extends {}>(v: AbstractConstructor<T>): v is DjMockConstructor<T> {
104 105 return v && "mock" in v;
105 106 }
106 107
107 108 /** Создает класс при помощи `dojo/_base/declare`. Для этого исходный класс
108 109 * должен быть унаследован от `djbase(...)`.
109 110 *
110 111 * @param target Класс, который нужно объявить при помощи `dojo/_base/declare`
111 112 */
112 113 export function djclass<T extends AbstractConstructor>(target: T): T {
113 114 // получаем базовый конструктор и его прототип
114 115 let bp = target && target.prototype && Object.getPrototypeOf(target.prototype);
115 116 const bc = bp && bp.constructor;
116 117
117 118 // проверка того, что класс унаследован от специальной заглушки
118 119 if (isMockConstructor(bc)) {
119 120 // t - базовый класс, объявленный при помощи dojo/_base/declare
120 121 const t = bc.base;
121 122
122 123 // bc - базовый класс, bc.prototype используется как super
123 124 // при вызове базовых методов. Нужно создать bc.prototype
124 125 // таким образом, чтобы он вызывал this.inherited().
125 126
126 127 // создаем новый порототип, он не в цепочке прототипов у текущего
127 128 // класса, но super.some_method будет использовать именно его.
128 129 // в этом объекте будут размещены прокси для переопределенных
129 130 // методов.
130 131 bp = bc.prototype = Object.create(t.prototype);
131 132 bp.constructor = bc;
132 133
133 134 // proxy - фабрика для создания прокси-методов, которые внутри
134 135 // себя вызовут this.inherited с правильными параметрами.
135 136 const proxy = (m: (...args: any[]) => any) => function (this: any) {
136 137 return this.inherited(m, arguments);
137 138 };
138 139
139 140 // у текущего класса прототип содержит методы, объявленные в этом
140 141 // классе и его конструктор. Нужно пройти по всем методам и
141 142 // создать для них прокси.
142 143 // При этом только те, методы, которые есть в базовых классах
143 144 // могут быть переопределены.
144 145 each(target.prototype, (m: any, p: string | number | symbol) => {
145 146 if (typeof m === "function" &&
146 147 p !== "constructor" &&
147 148 target.prototype.hasOwnProperty(p) &&
148 149 p in t.prototype
149 150 ) {
150 151 bp[p] = proxy(m);
151 152 }
152 153 });
153 154
154 155 const cls = declare(t, target.prototype);
155 156 // TODO mixin static members
156 157 return cls as any;
157 158 } else {
158 159 return target as any;
159 160 }
160 161 }
161 162
162 163 function makeSetterName(prop: string) {
163 164 return [
164 165 "_set",
165 166 prop.replace(/^./, x => x.toUpperCase()),
166 167 "Attr"
167 168 ].join("");
168 169 }
169 170
170 171 function makeGetterName(prop: string) {
171 172 return [
172 173 "_get",
173 174 prop.replace(/^./, x => x.toUpperCase()),
174 175 "Attr"
175 176 ].join("");
176 177 }
177 178
178 179 interface NodeBindSpec {
179 180 node: string;
180 181 type: string;
181 182 }
182 183
183 184 /**
184 185 * Описание привязки свойства виджета к свойству внутреннего объекта.
185 186 */
186 187 interface MemberBindSpec {
187 188 /**
188 189 * Имя свойства со ссылкой на объект, к которому .
189 190 */
190 191 member: string;
191 192 /**
192 193 * Свойство объекта к которому нужно осуществить привязку.
193 194 */
194 195 property: string;
195 196
196 197 /**
197 198 * Привязка осуществляется не только на запись но и на чтение свойства.
198 199 */
199 200 getter?: boolean;
200 201 }
201 202
202 203 function isNodeBindSpec(v: any): v is NodeBindSpec {
203 204 return "node" in v;
204 205 }
205 206
206 207 function isMemberBindSpec(v: any): v is MemberBindSpec {
207 208 return "member" in v;
208 209 }
209 210
210 211 /** Декорирует свойства виджета для привязки их к внутренним членам, либо DOM
211 212 * элементам, либо свойству внутреннего объекта.
212 213 *
213 214 * @param {NodeBindSpec | MemberBindSpec} params Параметры связывания.
214 215 */
215 216 export function bind(params: NodeBindSpec | MemberBindSpec) {
216 217 if (isNodeBindSpec(params))
217 218 return (target: any, name: string) => {
218 219 target[makeSetterName(name)] = params;
219 220 };
220 221 else if (isMemberBindSpec(params)) {
221 222 return (target: any, name: string) => {
222 223 target[name] = null;
223 224 target[makeSetterName(name)] = function (v: any) {
224 225 this._set(name, v);
225 226 this[params.member].set(params.property, v);
226 227 };
227 228 if (params.getter)
228 229 target[makeGetterName(name)] = function () {
229 230 return this[params.member].get(params.property);
230 231 };
231 232 };
232 233 }
233 234 }
@@ -1,49 +1,50
1 1 import { djbase, djclass } from "../declare";
2 2 import _WidgetBase = require("dijit/_WidgetBase");
3 3 import _AttachMixin = require("dijit/_AttachMixin");
4 4 import { BuildContext, isNode } from "./traits";
5 5 import registry = require("dijit/registry");
6 import { Handle } from "dojo/interfaces";
6 7
7 8 @djclass
8 9 export abstract class DjxWidgetBase extends djbase(_WidgetBase, _AttachMixin) {
9 10
10 11 buildRendering() {
11 12 this.domNode = this.render().getDomElement();
12 13 super.buildRendering();
13 14 }
14 15
15 16 abstract render(): BuildContext;
16 17
17 18 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
18 19 baseNode: T,
19 20 getAttrFunc: (baseNode: T, attr: string) => string,
20 21 // tslint:disable-next-line: ban-types
21 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
22 attachFunc: (node: T, type: string, func?: Function) => Handle
22 23 ): boolean {
23 24 if (isNode(baseNode)) {
24 25 const w = registry.byNode(baseNode);
25 26 if (w) {
26 27 // from dijit/_WidgetsInTemplateMixin
27 28 this._processTemplateNode(w,
28 29 (n, p) => n.get(p), // callback to get a property of a widget
29 30 (widget, type, callback) => {
30 31 if (!callback)
31 32 throw new Error("The callback must be specified");
32 33
33 34 // callback to do data-dojo-attach-event to a widget
34 35 if (type in widget) {
35 36 // back-compat, remove for 2.0
36 37 return widget.connect(widget, type, callback as EventListener);
37 38 } else {
38 39 // 1.x may never hit this branch, but it's the default for 2.0
39 40 return widget.on(type, callback);
40 41 }
41 42
42 43 });
43 44 // don't process widgets internals
44 45 return false;
45 46 }
46 47 }
47 48 return super._processTemplateNode(baseNode, getAttrFunc, attachFunc);
48 49 }
49 50 }
@@ -1,42 +1,42
1 1 import dom = require("dojo/dom-construct");
2 import { argumentNotNull, isNull, mixin } from "@implab/core-amd/safe";
2 import { argumentNotNull } from "@implab/core-amd/safe";
3 3 import _WidgetBase = require("dijit/_WidgetBase");
4 import { _WidgetBaseConstructor, isNode } from "./traits";
5 4 import { BuildContextBase } from "./BuildContextBase";
5 import { _WidgetBaseConstructor } from "dijit/_WidgetBase";
6 6
7 7 export class WidgetContext extends BuildContextBase {
8 8 widgetClass: _WidgetBaseConstructor;
9 9
10 10 _instance: _WidgetBase | undefined;
11 11
12 12 constructor(widgetClass: _WidgetBaseConstructor) {
13 13 super();
14 14 argumentNotNull(widgetClass, "widgetClass");
15 15
16 16 this.widgetClass = widgetClass;
17 17 }
18 18
19 19 _addChild(child: any): void {
20 20 if (!this._instance || !this._instance.containerNode)
21 21 throw new Error("Widget doesn't support adding children");
22 22
23 23 dom.place(this.getChildDom(child), this._instance.containerNode);
24 24 }
25 25
26 26 _setAttrs(attrs: object): void {
27 27 this._instance?.set(attrs);
28 28 }
29 29
30 30 _create(attrs: object, children: any[]) {
31 31 this._instance = new this.widgetClass(this._attrs);
32 32 if (children)
33 33 children.forEach(x => this._addChild(x));
34 34 }
35 35
36 36 _getDomElement() {
37 37 if (!this._instance)
38 38 throw new Error("The instance of the widget isn't created");
39 39 return this._instance.domNode;
40 40 }
41 41
42 42 }
@@ -1,31 +1,30
1 1 import _WidgetBase = require("dijit/_WidgetBase");
2 import { _WidgetBaseConstructor } from "dijit/_WidgetBase";
2 3
3 4 export interface BuildContext {
4 5 getDomElement(): HTMLElement;
5 6 }
6 7
7 8 export function isNode(el: any): el is HTMLElement {
8 9 return el && el.nodeName && el.nodeType;
9 10 }
10 11
11 12 export function isWidget(v: any): v is _WidgetBase {
12 13 return v && "domNode" in v;
13 14 }
14 15
15 16 export function isBuildContext(v: any): v is BuildContext {
16 17 return typeof v === "object" && typeof v.getDomElement === "function";
17 18 }
18 19
19 20 export function isPlainObject(v: object) {
20 21 if (typeof v !== "object")
21 22 return false;
22 23
23 24 const vp = Object.getPrototypeOf(v);
24 25 return !vp || vp === Object.prototype;
25 26 }
26 27
27 export type _WidgetBaseConstructor = dijit._WidgetBaseConstructor<_WidgetBase>;
28
29 28 export function isWidgetConstructor(v: any): v is _WidgetBaseConstructor {
30 29 return typeof v === "function" && v.prototype && "domNode" in v.prototype;
31 30 }
@@ -1,28 +1,29
1 1 import { MapOf } from "@implab/core-amd/interfaces";
2 2 import { NlsBundle } from "./NlsBundle";
3 3 import { isPromise } from "@implab/core-amd/safe";
4 4
5 5 export function bundle<T extends object>(nls: T, locales?: MapOf<any>) {
6 6 const nlsBundle = new NlsBundle(nls, locales);
7 7
8 8 const fn = (locale?: string) => {
9 const result = nlsBundle.getLocale(locale);
9 const result = locale ? nlsBundle.getLocale(locale) : nlsBundle.default;
10
10 11 if (isPromise(result))
11 12 throw new Error(`The bundle '${locale}' isn't loaded`);
12 13 else
13 14 return result;
14 15 };
15 16
16 17 fn.define = (pack: Partial<T>) => pack;
17 18 fn.default = nlsBundle.default;
18 19 fn.load = async (id: string, require: Require, cb: { (): void; error: (arg0: any) => void; }) => {
19 20 try {
20 21 await nlsBundle.getLocale(id);
21 22 cb();
22 23 } catch (e) {
23 24 cb.error(e);
24 25 }
25 26 };
26 27
27 28 return fn;
28 29 }
@@ -1,7 +1,9
1 1 {
2 2 "extends": "../tsconfig",
3 3 "compilerOptions": {
4 4 "rootDir": "ts",
5 "types": ["requirejs", "dojo-typings"]
5 "types": [
6 "requirejs"
7 ]
6 8 }
7 9 } No newline at end of file
@@ -1,57 +1,62
1 1 import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces";
2 2 import { Cancellation } from "@implab/core-amd/Cancellation";
3 3 import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource";
4 4 import { argumentNotNull, destroy } from "@implab/core-amd/safe";
5 5 import { TapWriter } from "./Tap";
6 6
7 7
8 8
9 9 export class TapeWriter implements IDestroyable {
10 10
11 11 private readonly _t: TapWriter;
12 12
13 13 private readonly _subscriptions = new Array<IDestroyable>();
14 private _destroyed;
14 private _destroyed = false;
15 15
16 16 constructor(t: TapWriter) {
17 17 argumentNotNull(t, "test");
18
18 this._t = t;
19 19 }
20 20
21 21 writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) {
22 22 if (!this._destroyed) {
23 23 const subscription = source.on(this.writeEvent.bind(this));
24 24 if (ct.isSupported()) {
25 25 ct.register(subscription.destroy.bind(subscription));
26 26 }
27 27 this._subscriptions.push(subscription);
28 28 }
29 29 }
30 30
31 31 writeEvent(next: TraceEvent) {
32 32 if (next.level >= DebugLevel) {
33 33 this._t.comment(`DEBUG ${next.source.id} ${next}`);
34 34 } else if (next.level >= LogLevel) {
35 35 this._t.comment(`LOG ${next.source.id} ${next}`);
36 36 } else if (next.level >= WarnLevel) {
37 37 this._t.comment(`WARN ${next.source.id} ${next}`);
38 38 } else {
39 39 this._t.comment(`ERROR ${next.source.id} ${next}`);
40 40 }
41 41 }
42 42
43 43 destroy() {
44 if (this._destroyed)
45 return;
46 this._destroyed = true;
44 47 this._subscriptions.forEach(destroy);
45 48 }
46 49 }
47 50
48 51 type TestCallback = (ok: (msg:string) => void, fail: (msg:string) => void, trace: TraceSource) => void;
49 type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void> | void;
52 type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void>;
50 53
54 export function test(name: string, cb: TestCallback ): void;
55 export function test(name: string, cb: AsyncTestCallback): void;
51 56 export function test(name: string, cb: TestCallback | AsyncTestCallback) {
52 57
53 58 }
54 59
55 60 export function run() {
56 61
57 62 }
@@ -1,11 +1,11
1 1 {
2 2 "extends": "../tsconfig",
3 3 "compilerOptions": {
4 4 "rootDir": "ts",
5 5 "rootDirs": [
6 6 "ts",
7 7 "../main/ts"
8 8 ],
9 "types": ["requirejs", "dojo-typings"]
9 "types": ["requirejs"]
10 10 }
11 11 } No newline at end of file
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now