// @ts-nocheck declare namespace DojoJS { interface Handle { remove(): void; } interface Require { (config: Record, dependencies?: string | string[], callback?: (...args: any[]) => void): Require; (dependencies: string | string[], callback: (...args: any[]) => void): Require; async: number| boolean; has: DojoJS.Has; isXdurl(url: string): boolean; initSyncLoader(dojoRequirePlugin: any, checkDojoRequirePlugin: any, transformToAmd: any): Record; getXhr(): XMLHttpRequest | /* ActiveXObject */ any; getText(url: string, async?: boolean, onLoad?: (responseText: string, async?: boolean) => void): string; eval(text: string, hint?: string): any; signal(type: string, args: any[]): void; on(type: string, listener: (...args: any[]) => void): Handle; map: { [id: string]: any }; waitms?: number; legacyMode: boolean; rawConfig: DojoJS._base.Config; baseUrl: string; combo?: { add: () => void; done(callback: (mids: string[], url?: string) => void, req: Require): void; plugins?: Record; }; idle(): boolean; toAbsMid(mid: string, referenceModule?: string): string; toUrl(name: string, referenceModule?: string): string; undef(moduleId: string, referenceModule?: string): void; pageLoaded: number | boolean; injectUrl(url: string, callback?: () => void, owner?: HTMLScriptElement): HTMLScriptElement; log(...args: any[]): void; trace: { (group: string, args: any[]): void; on: boolean | number; group: Record; set(group: string | Record, value: any): void; }; boot?: [string[], Function] | number; } interface Define { (mid: string, dependencies?: string[], factory?: any): void; (dependencies: string[], factory?: any): void; amd: string; } interface Dojo {} interface Dojox {} interface Dijit {} } var require: DojoJS.Require; var define: DojoJS.Define; var dojo: DojoJS.Dojo; var dijit: DojoJS.Dijit; var dojox: DojoJS.Dojox; declare module "require" { export = require; } declare module "module" { var module: any; export = module; } declare module "exports" { var exports: any; export = exports; } declare module "dojo" { export = dojo; } declare module "dijit" { export = dijit; } declare module "dojox" { export = dojox; } // TODO: Correctly type and split namespace into the files. This is included here so that if any dojo.dnd module is imported, the entire namespace is available. declare namespace DojoJS { namespace dnd { /* implied types */ interface DndLocation { t: number; l: number; } /* dojo/dnd/autoscroll */ interface AutoScroll { getViewport(doc?: Document): DomGeometryBox; V_TRIGGER_AUTOSCROLL: number; H_TRIGGER_AUTOSCROLL: number; V_AUTOSCROLL_VALUE: number; H_AUTOSCROLL_VALUE: number; /** * Called at the start of a drag. */ autoScrollStart(d: Document): void; /** * a handler for mousemove and touchmove events, which scrolls the window, if * necessary */ autoScroll(e: Event): void; _validNodes: { div: number; p: number; td: number; }; _validOverflow: { auto: number; scroll: number; }; /** * a handler for mousemove and touchmove events, which scrolls the first available * Dom element, it falls back to exports.autoScroll() */ autoScrollNodes(e: Event): void; } /* dojo/dnd/AutoSource */ interface AutoSource extends Source { } interface AutoSourceConstructor { new (node: Node | string, params?: SourceArgs): AutoSource; prototype: AutoSource; } /* dojo/dnd/Avatar */ interface Avatar { /** * constructor function; * it is separate so it can be (dynamically) overwritten in case of need */ construct(): void; /** * destructor for the avatar; called to remove all references so it can be garbage-collected */ destroy(): void; /** * updates the avatar to reflect the current DnD state */ update(): void; /** * generates a proper text to reflect copying or moving of items */ _generateText(): string; } interface AvatarConstructor { new (manager: Manager): Avatar; prototype: Avatar; } /* dojo/dnd/common */ interface Common { getCopyKeyState(evt: Event): boolean; _uniqueId: number; /** * returns a unique string for use with any DOM element */ getUniqueId(): string; _empty: { }; /** * returns true if user clicked on a form element */ isFormElement(e: Event): boolean; } /* dojo/dnd/Container */ interface ContainerItem> { type?: string[]; data?: T; } interface ContainerArgs { /** * a creator function, which takes a data item, and returns an object like that: * {node: newNode, data: usedData, type: arrayOfStrings} */ creator>(data?: ContainerItem): { node: Element; data: T; type: string[]; }; /** * don't start the drag operation, if clicked on form elements */ skipForm: boolean; /** * node or node's id to use as the parent node for dropped items * (must be underneath the 'node' parameter in the DOM) */ dropParent: Node | string; /** * skip startup(), which collects children, for deferred initialization * (this is used in the markup mode) */ _skipStartup: boolean; } interface Container extends Type { /** * Indicates whether to allow dnd item nodes to be nested within other elements. * By default this is false, indicating that only direct children of the container can * be draggable dnd item nodes */ skipForm: boolean; /** * Indicates whether to allow dnd item nodes to be nested within other elements. * By default this is false, indicating that only direct children of the container can * be draggable dnd item nodes */ allowNested: boolean; /** * The DOM node the mouse is currently hovered over */ current: HTMLElement; /** * Map from an item's id (which is also the DOMNode's id) to * the dojo/dnd/Container.Item itself. */ map: { [name: string]: ContainerItem }; /** * creator function, dummy at the moment */ creator>(data?: ContainerItem): { node: Element; data: T; type: string[]; }; /** * returns a data item by its key (id) */ getItem>(key: string): ContainerItem; /** * associates a data item with its key (id) */ setITem>(key: string, data: ContainerItem): void; /** * removes a data item from the map by its key (id) */ delItem(key: string): void; /** * iterates over a data map skipping members that * are present in the empty object (IE and/or 3rd-party libraries). */ forInItems, U>(f: (i: ContainerItem, idx?: number, container?: Container) => void, o?: U): U; /** * removes all data items from the map */ clearItems(): void; /** * returns a list (an array) of all valid child nodes */ getAllNodes(): NodeList; /** * sync up the node list with the data map */ sync(): this; /** * inserts an array of new nodes before/after an anchor node */ insertNodes(data: ContainerItem[], before?: boolean, anchor?: Element): this; /** * prepares this object to be garbage-collected */ destroy(): void; markupFactory(params: ContainerArgs, node: Element, Ctor: Constructor): T; /** * collects valid child items and populate the map */ startup(): void; /** * event processor for onmouseover or touch, to mark that element as the current element */ onMouseOver(e: Event): void; /** * event processor for onmouseout */ onMouseOut(e: Event): void; /** * event processor for onselectevent and ondragevent */ onSelectStart(e: Event): void; /** * this function is called once, when mouse is over our container */ onOverEvent(e: Event): void; /** * this function is called once, when mouse is out of our container */ onOutEvent(e: Event): void; /** * changes a named state to new state value */ _changeState(type: string, newState: string): void; /** * adds a class with prefix "dojoDndItem" */ _addItemClass(node: Element, type: string): void; /** * removes a class with prefix "dojoDndItem" */ _removeItemClass(node: Element, type: string): void; /** * gets a child, which is under the mouse at the moment, or null */ _getChildByEvent(e: Event): void; /** * adds all necessary data to the output of the user-supplied creator function */ _normalizedCreator>(item: ContainerItem, hint: string): this; } interface ContainerConstructor { /** * a constructor of the Container */ new (node: Node | string, params?: ContainerArgs): Container; prototype: Container; } interface Common { /** * returns a function, which creates an element of given tag * (SPAN by default) and sets its innerHTML to given text */ _createNode(tag: string): (text: string) => HTMLElement; /** * creates a TR/TD structure with given text as an innerHTML of TD */ _createTrTd(text: string): HTMLTableRowElement; /** * creates a SPAN element with given text as its innerHTML */ _createSpan(text: string): HTMLSpanElement; /** * a dictionary that maps container tag names to child tag names */ _defaultCreatorNodes: { ul: string, ol: string, div: string, p: string }; /** * takes a parent node, and returns an appropriate creator function */ _defaultCreator(node: HTMLElement): { node: HTMLElement; data: T; type: string }; } /* dojo/dnd/Manager */ interface Manager extends Type { OFFSET_X: number; OFFSET_Y: number; overSource(source: Source): void; outSource(source: Source): void; startDrag(source: Source, nodes: HTMLElement[], copy?: boolean): void; canDrop(flag: boolean): void; stopDrag(): void; makeAvatar(): Avatar; updateAvatar(): void; onMouseMove(e: MouseEvent): void; onMouseUp(e: MouseEvent): void; onKeyDown(e: KeyboardEvent): void; onKeyUp(e: KeyboardEvent): void; _setCopyStatus(copy?: boolean): void; } interface ManagerConstructor { /** * the manager of DnD operations (usually a singleton) */ new (): Manager; prototype: Manager; /** * Returns the current DnD manager. Creates one if it is not created yet. */ manager(): Manager; } interface Common { _manager: Manager; } /* dojo/dnd/move */ interface Move { constrainedMoveable: ConstrainedMoveableConstructor; boxConstrainedMoveable: BoxConstrainedMoveableConstructor; parentConstrainedMoveable: ParentConstrainedMoveableConstructor; } interface ConstrainedMoveableArgs extends MoveableArgs { /** * Calculates a constraint box. * It is called in a context of the moveable object. */ constraints?: () => DomGeometryBox; /** * restrict move within boundaries. */ within?: boolean; } interface ConstrainedMoveable extends Moveable { /** * Calculates a constraint box. * It is called in a context of the moveable object. */ constraints: () => DomGeometryBox; /** * restrict move within boundaries. */ within: boolean; } interface ConstrainedMoveableConstructor { /** * an object that makes a node moveable */ new (node: Node | string, params?: ConstrainedMoveableArgs): ConstrainedMoveable; } interface BoxConstrainedMoveableArgs extends ConstrainedMoveableArgs { /** * a constraint box */ box?: DomGeometryBox; } interface BoxConstrainedMoveable extends ConstrainedMoveable { /** * a constraint box */ box: DomGeometryBox; } interface BoxConstrainedMoveableConstructor { /** * an object, which makes a node moveable */ new (node: Node | string, params?: BoxConstrainedMoveableArgs): BoxConstrainedMoveable; } type ConstraintArea = 'border' | 'content' | 'margin' | 'padding'; interface ParentConstrainedMoveableArgs extends ConstrainedMoveableArgs { /** * A parent's area to restrict the move. * Can be "margin", "border", "padding", or "content". */ area?: ConstraintArea; } interface ParentConstrainedMoveable extends ConstrainedMoveable { /** * A parent's area to restrict the move. * Can be "margin", "border", "padding", or "content". */ area: ConstraintArea; } interface ParentConstrainedMoveableConstructor { /** * an object, which makes a node moveable */ new (node: Node | string, params?: ParentConstrainedMoveableArgs): ParentConstrainedMoveable; } /* dojo/dnd/Moveable */ interface MoveableArgs { /** * A node (or node's id), which is used as a mouse handle. * If omitted, the node itself is used as a handle. */ handle?: Node | string; /** * delay move by this number of pixels */ delay?: number; /** * skip move of form elements */ skip?: boolean; /** * a constructor of custom Mover */ mover?: MoverConstructor; } interface Moveable { /** * markup methods */ markupFactory(params: MoveableArgs, node: HTMLElement, Ctor: Constructor): T; /** * stops watching for possible move, deletes all references, so the object can be garbage-collected */ destroy(): void; /** * event processor for onmousedown/ontouchstart, creates a Mover for the node */ onMouseDown(e: MouseEvent): void; /** * event processor for onmousemove/ontouchmove, used only for delayed drags */ onMouseMove(e: MouseEvent): void; /** * event processor for onmouseup, used only for delayed drags */ onMouseUp(e: MouseEvent): void; /** * called when the drag is detected; * responsible for creation of the mover */ onDragDetected(e: Event): void; /** * called before every move operation */ onMoveStart(mover: Mover): void; /** * called after every move operation */ onMoveStop(mover: Mover): void; /** * called during the very first move notification; * can be used to initialize coordinates, can be overwritten. */ onFirstMove(mover: Mover, e: Event): void; /** * called during every move notification; * should actually move the node; can be overwritten. */ onMove(mover: Mover, leftTop: DndLocation, e?: Event): void; /** * called before every incremental move; can be overwritten. */ onMoving(mover: Mover, leftTop: DndLocation): void; /** * called after every incremental move; can be overwritten. */ onMoved(mover: Mover, leftTop: DndLocation): void; } interface MoveableConstructor { new (node: Node | string, params?: MoveableArgs): Moveable; prototype: Moveable; } /* dojo/dnd/Mover */ interface MoverHost extends Record { onMoveStart(mover: Mover): void; onMoveStop(mover: Mover): void; } interface Mover extends Type { /** * event processor for onmousemove/ontouchmove */ onMouseMove(e: MouseEvent): void; onMouseUp(e: MouseEvent): void; /** * makes the node absolute; it is meant to be called only once. * relative and absolutely positioned nodes are assumed to use pixel units */ onFirstMove(e: Event): void; /** * stops the move, deletes all references, so the object can be garbage-collected */ destroy(): void; } interface MoverConstructor { /** * an object which makes a node follow the mouse, or touch-drag on touch devices. * Used as a default mover, and as a base class for custom movers. */ new (node: HTMLElement, e: MouseEvent, host: MoverHost): Mover; prototype: Mover; } /* dojo/dnd/Selector */ interface Selector extends Container { /** * The set of id's that are currently selected, such that this.selection[id] == 1 * if the node w/that id is selected. Can iterate over selected node's id's like: * for(var id in this.selection) */ selection: { [id: string]: number }; /** * is singular property */ singular: boolean; /** * returns a list (an array) of selected nodes */ getSelectedNodes(): NodeList; /** * unselects all items */ selectNone(): this; /** * selects all items */ selectAll(): this; /** * deletes all selected items */ deleteSelectedNodes(): this; /** * iterates over selected items; * see `dojo/dnd/Container.forInItems()` for details */ forInSelectedItems>(f: (i: ContainerItem, idx?: number, container?: Container) => void, o?: Record): void; /** * event processor for onmousemove */ onMouseMove(e: Event): void; /** * this function is called once, when mouse is over our container */ onOverEvent(): void; /** * this function is called once, when mouse is out of our container */ onOutEvent(): void; /** * unselects all items */ _removeSelection(): this; _removeAnchor(): this; } interface SelectorConstructor { /** * constructor of the Selector */ new (node: Node | string, params?: ContainerArgs): Selector; prototype: Selector; } /* dojo/dnd/Source */ /** * a dict of parameters for DnD Source configuration. Note that any * property on Source elements may be configured, but this is the * short-list */ interface SourceArgs { [arg: string]: any; /** * can be used as a DnD source. Defaults to true. */ isSource?: boolean; /** * list of accepted types (text strings) for a target; defaults to * ["text"] */ accept?: string[]; /** * if true refreshes the node list on every operation; false by default */ autoSync?: boolean; /** * copy items, if true, use a state of Ctrl key otherwisto * see selfCopy and selfAccept for more details */ copyOnly?: boolean; /** * the move delay in pixels before detecting a drag; 0 by default */ delay?: number; /** * a horizontal container, if true, vertical otherwise or when omitted */ horizontal?: boolean; /** * copy items by default when dropping on itself, * false by default, works only if copyOnly is true */ selfCopy?: boolean; /** * accept its own items when copyOnly is true, * true by default, works only if copyOnly is true */ selfAccept?: boolean; /** * allows dragging only by handles, false by default */ withHandles?: boolean; /** * generate text node for drag and drop, true by default */ generateText?: boolean; } interface Source extends Selector { /** * checks if the target can accept nodes from this source */ checkAcceptance(source: Container, nodes: HTMLElement[]): boolean; /** * Returns true if we need to copy items, false to move. * It is separated to be overwritten dynamically, if needed. */ copyState(keyPressed: boolean, self?: boolean): boolean; /** * topic event processor for /dnd/source/over, called when detected a current source */ onDndSourceOver(source: Container): void; /** * topic event processor for /dnd/start, called to initiate the DnD operation */ onDndStart(source: Container, nodes: HTMLElement[], copy?: boolean): void; /** * topic event processor for /dnd/drop, called to finish the DnD operation */ onDndDrop(source: Container, nodes: HTMLElement[], copy: boolean, target: Container): void; /** * topic event processor for /dnd/cancel, called to cancel the DnD operation */ onDndCancel(): void; /** * called only on the current target, when drop is performed */ onDrop(source: Container, nodes: HTMLElement[], copy?: boolean): void; /** * called only on the current target, when drop is performed * from an external source */ onDropExternal(source: Container, nodes: HTMLElement[], copy?: boolean): void; /** * called only on the current target, when drop is performed * from the same target/source */ onDropInternal(nodes: HTMLElement[], copy?: boolean): void; /** * called during the active DnD operation, when items * are dragged over this target, and it is not disabled */ onDraggingOver(): void; /** * called during the active DnD operation, when items * are dragged away from this target, and it is not disabled */ onDraggingOut(): void; /** * this function is called once, when mouse is over our container */ onOverEvent(): void; /** * this function is called once, when mouse is out of our container */ onOutEvent(): void; /** * assigns a class to the current target anchor based on "before" status */ _markTargetAnchor(before?: boolean): void; /** * removes a class of the current target anchor based on "before" status */ _unmarkTargetAnchor(): void; /** * changes source's state based on "copy" status */ _markDndStatus(copy?: boolean): void; /** * checks if user clicked on "approved" items */ _legalMouseDown(e?: Event): boolean; } interface SourceConstructor { new (node: Node | string, params?: SourceArgs): Source; prototype: Source; } /* dojo/dnd/Target */ interface Target extends Source { } interface TargetConstructor { new (node: HTMLElement, params: SourceArgs): Target; prototype: Target; } /* dojo/dnd/TimedMoveable */ interface TimedMoveableArgs extends MoveableArgs { timeout?: number; } interface TimedMoveable extends Moveable { onMoveStop(mover: Mover): void; onMove(mover: Mover, leftTop: DndLocation): void; } interface TimedMoveableConstructor { new (node: HTMLElement, params?: TimedMoveableArgs): TimedMoveable; prototype: TimedMoveable; } } } // TODO: move this to the xhr file: declare namespace DojoJS { interface BaseOptions { /** * Query parameters to append to the URL. */ query?: string | { [name: string]: any }; /** * Data to transfer. This is ignored for GET and DELETE * requests. */ data?: string | { [name: string]: any }; /** * Whether to append a cache-busting parameter to the URL. */ preventCache?: boolean; /** * Milliseconds to wait for the response. If this time * passes, the then the promise is rejected. */ timeout?: number; /** * How to handle the response from the server. Default is * 'text'. Other values are 'json', 'javascript', and 'xml'. */ handleAs?: string; } interface MethodOptions { /** * The HTTP method to use to make the request. Must be * uppercase. */ method?: string; } namespace request { interface XhrBaseOptions extends DojoJS.BaseOptions { /** * Whether to make a synchronous request or not. Default * is `false` (asynchronous). */ sync?: boolean; /** * Data to transfer. This is ignored for GET and DELETE * requests. */ data?: string | Record | FormData; /** * Headers to use for the request. */ headers?: { [header: string]: string }; /** * Username to use during the request. */ user?: string; /** * Password to use during the request. */ password?: string; /** * For cross-site requests, whether to send credentials * or not. */ withCredentials?: boolean; } interface XhrOptions extends XhrBaseOptions, DojoJS.MethodOptions { } interface Xhr { /** * Sends a request using XMLHttpRequest with the given URL and options. */ (url: string, options?: XhrOptions): Promise; /** * Send an HTTP GET request using XMLHttpRequest with the given URL and options. */ get(url: string, options?: DojoJS.request.XhrBaseOptions): Promise; /** * Send an HTTP POST request using XMLHttpRequest with the given URL and options. */ post(url: string, options?: DojoJS.request.XhrBaseOptions): Promise; /** * Send an HTTP PUT request using XMLHttpRequest with the given URL and options. */ put(url: string, options?: DojoJS.request.XhrBaseOptions): Promise; /** * Send an HTTP DELETE request using XMLHttpRequest with the given URL and options. */ del(url: string, options?: DojoJS.request.XhrBaseOptions): Promise; /** * does the work of portably generating a new XMLHTTPRequest object. */ _create(): XMLHttpRequest | /* ActiveXObject */ any; } } } // TODO: move this back to the QueryResults file declare namespace DojoJS { interface ExtensionEvent { (target: Element | Record, listener: EventListener): Handle; } interface QueryResults extends ArrayLike { /** * Iterates over the query results, based on * https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/forEach. * Note that this may executed asynchronously. The callback may be called * after this function returns. */ forEach(callback: (item: T, id: string | number, results: this) => void, thisObject?: Object): void | this; /** * Filters the query results, based on * https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter. * Note that this may executed asynchronously. The callback may be called * after this function returns. */ filter(callback: (item: T, id: string | number, results: this) => boolean, thisObject?: Object): this; /** * Maps the query results, based on * https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map. * Note that this may executed asynchronously. The callback may be called * after this function returns. */ map(callback: (item: T, id: string | number, results: this) => U, thisObject?: Object): QueryResults; /** * This registers a callback for when the query is complete, if the query is asynchronous. * This is an optional method, and may not be present for synchronous queries. */ then?: (callback?: ((result: T) => U | DojoJS.Thenable) | null, errback?: ((error: any) => U | DojoJS.Thenable | void) | null) => Promise; /** * This registers a callback for notification of when data is modified in the query results. * This is an optional method, and is usually provided by dojo/store/Observable. */ total: number | Promise; } interface QueryOptions { /** * A list of attributes to sort on, as well as direction * For example: * | [{attribute:"price", descending: true}]. * If the sort parameter is omitted, then the natural order of the store may be * applied if there is a natural order. */ sort?: { /** * The name of the attribute to sort on. */ attribute: string; /** * The direction of the sort. Default is false. */ descending?: boolean; }[]; /** * The first result to begin iteration on */ start?: number; /** * The number of how many results should be returned. */ count?: number; } interface DojoStoreUtil { QueryResults: (results: T[]) => DojoJS.QueryResults; } interface DojoStore { util: DojoStoreUtil; } interface Dojo { store: DojoStore; } } // TODO: move this to the stateful file somehow declare namespace DojoJS { interface WatchHandle extends Handle { unwatch(): void; } interface Stateful { /** * Used across all instances a hash to cache attribute names and their getter * and setter names. */ _attrPairNames: { [attr: string]: string }; /** * Helper function for get() and set(). * Caches attribute name values so we don't do the string ops every time. */ _getAttrNames(name: string): string; /** * Automatic setting of params during construction */ postscript(params?: Object): void; /** * Get a property on a Stateful instance. */ get(name: string): any; /** * Set a property on a Stateful instance */ set(name: string, value: any): this; set(name: string, ...values: any[]): this; set(name: Object): this; /** * Internal helper for directly changing an attribute value. */ _changeAttrValue(name: string, value: any): this; /** * Watches a property for changes */ watch(callback: (prop: string, oldValue: any, newValue: any) => void): WatchHandle; watch(name: string, callback: (prop: string, oldValue: any, newValue: any) => void): WatchHandle; } interface Dojo { Stateful: DojoJS.DojoClass; } } // TODO: Correctly type and split namespace into the files. This is included here so that if any dijit module is imported, the entire namespace is available. declare namespace DijitJS { /* Global Dijit Interface */ interface Dijit { } interface WatchHandle extends DojoJS.Handle { unwatch(): void; } /* dijit/_AttachMixin */ /* tslint:disable:class-name */ type Stateful = DojoJS.Dojo["Stateful"]; interface _WidgetBase extends Stateful, Destroyable { dojoAttachEvent: string; dojoAttachPoint: string; } interface _AttachMixin { /** * List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"] */ _attachPoints: string[]; /** * List of connections associated with data-dojo-attach-event=... in the template */ _attachEvents: DojoJS.Handle[]; /** * Object to which attach points and events will be scoped. Defaults to 'this'. */ attachScope: any; /** * Search descendants of this.containerNode for data-dojo-attach-point and data-dojo-attach-event. * * 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. */ searchContainerNode: boolean; /** * Attach to DOM nodes marked with special attributes. */ buildRendering(): void; /** * hook for _WidgetsInTemplateMixin */ _beforeFillContent(): void; /** * Iterate through the dom nodes and attach functions and nodes accordingly. * * 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: * - dojoAttachPoint/data-dojo-attach-point * - dojoAttachEvent/data-dojo-attach-event */ _attachTemplateNodes(rootNode: Element | Node): void; /** * Process data-dojo-attach-point and data-dojo-attach-event for given node or widget. * * Returns true if caller should process baseNode's children too. */ _processTemplateNode( baseNode: T, getAttrFunc: (baseNode: T, attr: string) => string, attachFunc: (node: T, type: string, func?: Function) => DojoJS.Handle ): boolean; /** * 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. */ _attach(node: Element | Node, type: string, func?: Function): DojoJS.Handle; /** * Detach and clean up the attachments made in _attachtempalteNodes. */ _detachTemplateNodes(): void; destroyRendering(preserveDom?: boolean): void; } interface _AttachMixinConstructor extends DojoJS.DojoClass<_AttachMixin> { } /* dijit/_BidiMixin */ interface _WidgetBase extends InstanceType, Destroyable { /** * Gets the right direction of text. */ getTextDir(text: string): string; /** * Set element.dir according to this.textDir, assuming this.textDir has a value. */ applyTextDir(element: HTMLElement, text?: string): void; /** * Wraps by UCC (Unicode control characters) option's text according to this.textDir */ enforceTextDirWithUcc(option: HTMLOptionElement, text: string): string; /** * Restores the text of origObj, if needed, after enforceTextDirWithUcc, e.g. set("textDir", textDir). */ restoreOriginalText(origObj: HTMLOptionElement): HTMLOptionElement; } /* dijit/_ConfirmDialogMixin */ interface _ConfirmDialogMixin extends _WidgetsInTemplateMixin { /** * HTML snippet for action bar, overrides _DialogMixin.actionBarTemplate */ actionBarTemplate: string; /** * Label of OK button. */ buttonOk: string; /** * Label of cancel button. */ buttonCancel: string; } /* dijit/_Contained */ interface _Contained { /** * Returns the previous child of the parent or null if this is the * first child of the parent. */ getPreviousSibling(): T; /** * Returns the next child of the parent or null if this is the last * child of the parent. */ getNextSibling(): T; /** * Returns the index of this widget within its container parent. * It returns -1 if the parent does not exist or if the parent is * not a dijit/_Container. */ getIndexInParent(): number; } interface _ContainedConstructor extends DojoJS.DojoClass<_Contained> { } /* dijit/_Container */ interface _Container { buildRendering(): void; /** * Makes the given widget a child of this widget. */ addChild(widget: T, insertIndex?: number): void; /** * Removes the passed widget instance from this widget but does * not destroy it. You can also pass in an integer indicating * the index within the container to remove (ie, removeChild(5) removes the sixth widget) */ removeChild(widget: T): void; removeChild(widget: number): void; /** * Returns true if widget has child widgets, i.e. if this.containerNode contains widgets. */ hasChildren(): boolean; /** * Gets the index of the child in this container or -1 if not found */ getIndexOfChild(widget: T): number; } interface _ContainerConstructor extends DojoJS.DojoClass<_Container> { } /* dijit/_CssStateMixin */ interface CSSStateNodes { [node: string]: string; } interface _CssStateMixin { /** * True if cursor is over this widget */ hovering: boolean; /** * True if mouse was pressed while over this widget, and hasn't been released yet */ active: boolean; } interface _CssStateMixinConstructor extends DojoJS.DojoClass<_CssStateMixin> { } /* dijit/_DialogMixin */ interface _DialogMixin { /** * HTML snippet to show the action bar (gray bar with OK/cancel buttons). * Blank by default, but used by ConfirmDialog/ConfirmTooltipDialog subclasses. */ actionBarTemplate: string; /** * Callback when the user hits the submit button. * Override this method to handle Dialog execution. */ execute(formContents?: any): void; /** * Called when user has pressed the Dialog's cancel button, to notify container. */ onCancel(): void; /** * Called when user has pressed the dialog's OK button, to notify container. */ onExecute(): void; } /* dijit/_FocusMixin */ interface _FocusMixin { } interface _WidgetBase extends InstanceType, Destroyable { /** * Called when the widget becomes "active" because * it or a widget inside of it either has focus, or has recently * been clicked. */ onFocus(): void; /** * Called when the widget stops being "active" because * focus moved to something outside of it, or the user * clicked somewhere outside of it, or the widget was * hidden. */ onBlur(): void; } /* dijit/_HasDropDown */ interface _HasDropDown extends _FocusMixin { /** * The button/icon/node to click to display the drop down. * Can be set via a data-dojo-attach-point assignment. * If missing, then either focusNode or domNode (if focusNode is also missing) will be used. */ _buttonNode: HTMLElement; /** * Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending * on where the drop down is set to be positioned. * Can be set via a data-dojo-attach-point assignment. * If missing, then _buttonNode will be used. */ _arrowWrapperNode: HTMLElement; /** * The node to set the aria-expanded class on. * Also sets popupActive class but that will be removed in 2.0. * Can be set via a data-dojo-attach-point assignment. * If missing, then focusNode or _buttonNode (if focusNode is missing) will be used. */ _popupStateNode: HTMLElement; /** * The node to display the popup around. * Can be set via a data-dojo-attach-point assignment. * If missing, then domNode will be used. */ _aroundNode: HTMLElement; /** * The widget to display as a popup. This widget *must* be * defined before the startup function is called. */ dropDown: T; /** * Set to true to make the drop down at least as wide as this * widget. Set to false if the drop down should just be its * default width. */ autoWidth: boolean; /** * Set to true to make the drop down exactly as wide as this * widget. Overrides autoWidth. */ forceWidth: boolean; /** * The max height for our dropdown. * Any dropdown taller than this will have scrollbars. * Set to 0 for no max height, or -1 to limit height to available space in viewport */ maxHeight: number; /** * This variable controls the position of the drop down. * It's an array of strings */ dropDownPosition: ('before' | 'after' | 'above' | 'below')[]; /** * When set to false, the click events will not be stopped, in * case you want to use them in your subclass */ _stopClickEvents: boolean; /** * Callback when the user mousedown/touchstart on the arrow icon. */ _onDropDownMouseDown(e: MouseEvent): void; /** * Callback on mouseup/touchend after mousedown/touchstart on the arrow icon. * Note that this function is called regardless of what node the event occurred on (but only after * a mousedown/touchstart on the arrow). */ _onDropDownMouseUp(e?: MouseEvent): void; /** * The drop down was already opened on mousedown/keydown; just need to stop the event */ _onDropDownClick(e: MouseEvent): void; buildRendering(): void; postCreate(): void; destroy(preserveDom?: boolean): void; /** * Returns true if the dropdown exists and it's data is loaded. This can * be overridden in order to force a call to loadDropDown(). */ isLoaded(): boolean; /** * Creates the drop down if it doesn't exist, loads the data * if there's an href and it hasn't been loaded yet, and then calls * the given callback. */ loadDropDown(loadCallback: () => void): void; /** * Creates the drop down if it doesn't exist, loads the data * if there's an href and it hasn't been loaded yet, and * then opens the drop down. This is basically a callback when the * user presses the down arrow button to open the drop down. */ loadAndOpenDropDown(): DojoJS.Deferred; /** * Callback when the user presses the down arrow button or presses * the down arrow key to open/close the drop down. * Toggle the drop-down widget; if it is up, close it, if not, open it */ toggleDropDown(): void; /** * Opens the dropdown for this widget. To be called only when this.dropDown * has been created and is ready to display (ie, it's data is loaded). */ openDropDown(): PlaceLocation; /** * Closes the drop down on this widget */ closeDropDown(focus?: boolean): void; } /* dijit/_OnDijitClickMixin */ interface _OnDijitClickMixin { /** * override _WidgetBase.connect() to make this.connect(node, "ondijitclick", ...) work */ connect(obj: any, event: string | DojoJS.ExtensionEvent, method: string | EventListener): WatchHandle; } interface _OnDijitClickMixinConstructor { /** * Deprecated. New code should access the dijit/a11yclick event directly, ex: * | this.own(on(node, a11yclick, function(){ ... })); * * Mixing in this class will make _WidgetBase.connect(node, "ondijitclick", ...) work. * It also used to be necessary to make templates with ondijitclick work, but now you can just require * dijit/a11yclick. */ new (): _OnDijitClickMixin; a11yclick: A11yClick; } /* dijit/_TemplatedMixin */ interface _TemplatedMixin extends _AttachMixin { /** * A string that represents the widget template. * Use in conjunction with dojo.cache() to load from a file. */ templateString: string; /** * Path to template (HTML file) for this widget relative to dojo.baseUrl. * Deprecated: use templateString with require([... "dojo/text!..."], ...) instead */ templatePath: string; /** * Set _AttachMixin.searchContainerNode to true for back-compat for widgets that have data-dojo-attach-point's * and events inside this.containerNode. Remove for 2.0. */ searchContainerNode: boolean; /** * Construct the UI for this widget from a template, setting this.domNode. */ buildRendering(): void; } interface _TemplatedMixinConstructor extends _WidgetBaseConstructor<_TemplatedMixin> { /** * Static method to get a template based on the templatePath or * templateString key */ getCachedTemplate(templateString: string, alwaysUseString: string, doc?: Document): string | HTMLElement; } /* dijit/_Widget */ interface _Widget extends _WidgetBase, _OnDijitClickMixin, _FocusMixin { /** * Connect to this function to receive notifications of mouse click events. */ onClick(event: Event): void; /** * Connect to this function to receive notifications of mouse double click events. */ onDblClick(event: Event): void; /** * Connect to this function to receive notifications of keys being pressed down. */ onKeyDown(event: Event): void; /** * Connect to this function to receive notifications of printable keys being typed. */ onKeyPress(event: Event): void; /** * Connect to this function to receive notifications of keys being released. */ onKeyUp(event: Event): void; /** * Connect to this function to receive notifications of when the mouse button is pressed down. */ onMouseDown(event: Event): void; /** * Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget. */ onMouseMove(event: Event): void; /** * Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget. */ onMouseOut(event: Event): void; /** * Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget. */ onMouseOver(event: Event): void; /** * Connect to this function to receive notifications of when the mouse moves off of this widget. */ onMouseLeave(event: Event): void; /** * Connect to this function to receive notifications of when the mouse moves onto this widget. */ onMouseEnter(event: Event): void; /** * Connect to this function to receive notifications of when the mouse button is released. */ onMouseUp(event: Event): void; postCreate(): void; /** * Deprecated. Use set() instead. */ setAttribute(attr: string, value: any): void; /** * This method is deprecated, use get() or set() directly. */ attr(name: string | { [attr: string]: any }, value?: any): any; /** * Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. */ getDescendants(): _Widget[]; /** * Called when this widget becomes the selected pane in a * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`, * `dijit/layout/AccordionContainer`, etc. * * Also called to indicate display of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`. */ onShow: () => void; /** * Called when another widget becomes the selected pane in a * `dijit/layout/TabContainer`, `dijit/layout/StackContainer`, * `dijit/layout/AccordionContainer`, etc. * * Also called to indicate hide of a `dijit.Dialog`, `dijit.TooltipDialog`, or `dijit.TitlePane`. */ onHide: () => void; /** * Called when this widget is being displayed as a popup (ex: a Calendar popped * up from a DateTextBox), and it is hidden. * This is called from the dijit.popup code, and should not be called directly. * * Also used as a parameter for children of `dijit/layout/StackContainer` or subclasses. * Callback if a user tries to close the child. Child will be closed if this function returns true. */ onClose: () => boolean; } /* dijit/_WidgetBase */ interface _WidgetBase extends InstanceType, Destroyable { /** * A unique, opaque ID string that can be assigned by users or by the * system. If the developer passes an ID which is known not to be * unique, the specified ID is ignored and the system-generated ID is * used instead. */ id: string; /** * Rarely used. Overrides the default Dojo locale used to render this widget, * as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute. * Value must be among the list of locales specified during by the Dojo bootstrap, * formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us). */ lang: string; /** * Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir) * attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's * default direction. */ dir: string; /** * HTML class attribute */ class: string; /** * HTML style attributes as cssText string or name/value hash */ style: string; /** * HTML title attribute. * * For form widgets this specifies a tooltip to display when hovering over * the widget (just like the native HTML title attribute). * * For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer, * etc., it's used to specify the tab label, accordion pane title, etc. In this case it's * interpreted as HTML. */ title: string; /** * When this widget's title attribute is used to for a tab label, accordion pane title, etc., * this specifies the tooltip to appear when the mouse is hovered over that text. */ tooltip: string; /** * Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate * widget state. */ baseClass: string; /** * pointer to original DOM node */ srcNodeRef: HTMLElement; /** * This is our visible representation of the widget! Other DOM * Nodes may by assigned to other properties, usually through the * template system's data-dojo-attach-point syntax, but the domNode * property is the canonical "top level" node in widget UI. */ domNode: HTMLElement; /** * Designates where children of the source DOM node will be placed. * "Children" in this case refers to both DOM nodes and widgets. */ containerNode: HTMLElement; /** * The document this widget belongs to. If not specified to constructor, will default to * srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global */ ownerDocument: HTMLElement; /** * Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute * for each XXX attribute to be mapped to the DOM. */ attributeMap: { [attribute: string]: any }; /** * Bi-directional support, the main variable which is responsible for the direction of the text. * The text direction can be different than the GUI direction by using this parameter in creation * of a widget. */ textDir: string; /** * Kicks off widget instantiation. See create() for details. */ postscript(params?: any, srcNodeRef?: HTMLElement): void; /** * Kick off the life-cycle of a widget */ create(params?: any, srcNodeRef?: HTMLElement): void; /** * Called after the parameters to the widget have been read-in, * but before the widget template is instantiated. Especially * useful to set properties that are referenced in the widget * template. */ postMixInProperties(): void; /** * Construct the UI for this widget, setting this.domNode. * Most widgets will mixin `dijit._TemplatedMixin`, which implements this method. */ buildRendering(): void; /** * Processing after the DOM fragment is created */ postCreate(): void; /** * Processing after the DOM fragment is added to the document */ startup(): void; /** * Destroy this widget and its descendants */ destroyRecursive(preserveDom?: boolean): void; /** * Destroys the DOM nodes associated with this widget. */ destroyRendering(preserveDom?: boolean): void; /** * Recursively destroy the children of this widget and their * descendants. */ destroyDescendants(preserveDom?: boolean): void; /** * Deprecated. Override destroy() instead to implement custom widget tear-down * behavior. */ uninitialize(): boolean; /** * Used by widgets to signal that a synthetic event occurred, ex: * | myWidget.emit("attrmodified-selectedChildWidget", {}). */ emit(type: string, eventObj?: any, callbackArgs?: any[]): any; /** * Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }). */ on(type: string | DojoJS.ExtensionEvent, func: EventListener | Function): WatchHandle; /** * Returns a string that represents the widget. */ toString(): string; /** * Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent * is this widget. Note that it does not return all descendants, but rather just direct children. */ getChildren(): T[]; /** * Returns the parent widget of this widget. */ getParent(): T; /** * Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead. */ connect(obj: any, event: string | DojoJS.ExtensionEvent, method: string | EventListener): WatchHandle; /** * Deprecated, will be removed in 2.0, use handle.remove() instead. */ disconnect(handle: WatchHandle): void; /** * Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead. */ subscribe(t: string, method: EventListener): WatchHandle; /** * Deprecated, will be removed in 2.0, use handle.remove() instead. */ unsubscribe(handle: WatchHandle): void; /** * Return this widget's explicit or implicit orientation (true for LTR, false for RTL) */ isLeftToRight(): boolean; /** * Return true if this widget can currently be focused * and false if not */ isFocusable(): boolean; /** * Place this widget somewhere in the DOM based * on standard domConstruct.place() conventions. */ placeAt(reference: Node | string | DocumentFragment | T, position?: string | number): this; /** * Wrapper to setTimeout to avoid deferred functions executing * after the originating widget has been destroyed. * Returns an object handle with a remove method (that returns null) (replaces clearTimeout). */ defer(fcn: Function, delay?: number): DojoJS.Handle; } interface _WidgetBaseConstructor extends Pick, Exclude, 'new'>> { new (params?: Partial & ThisType, srcNodeRef?: Node | string): W & DojoJS.DojoClassObject; } /* dijit/_WidgetsInTemplateMixin */ interface _WidgetsInTemplateMixin { /** * Used to provide a context require to dojo/parser in order to be * able to use relative MIDs (e.g. `./Widget`) in the widget's template. */ contextRequire: Function; startup(): void; } interface _WidgetsInTemplateMixinConstructor extends DojoJS.DojoClass<_WidgetsInTemplateMixin> { new (params: Object, srcNodeRef: Node | string): _WidgetsInTemplateMixin; } /* dijit/a11yclick */ interface A11yClick { /** * Custom press, release, and click synthetic events * which trigger on a left mouse click, touch, or space/enter keyup. */ (node: HTMLElement, listener: Function): DojoJS.Handle; /** * Mousedown (left button), touchstart, or keydown (space or enter) corresponding to logical click operation. */ press: DojoJS.ExtensionEvent; /** * Mouseup (left button), touchend, or keyup (space or enter) corresponding to logical click operation. */ release: DojoJS.ExtensionEvent; /** * Mouse cursor or a finger is dragged over the given node. */ move: DojoJS.ExtensionEvent; } /* dijit/Calendar */ interface _MonthDropDownButton extends form.DropDownButton<_MonthDropDown> { onMonthSelect(): void; postCreate(): void; set(name: 'month', value: number): this; set(name: string, value: any): this; set(values: Object): this; } interface _MonthDropDownButtonConstructor extends _WidgetBaseConstructor<_MonthDropDownButton> { } interface _MonthDropDown extends _Widget, _TemplatedMixin, _CssStateMixin { months: string[]; baseClass: string; templateString: string; /** * Callback when month is selected from drop down */ onChange(month: number): void; set(name: 'months', value: string[]): this; set(name: string, value: any): this; set(values: Object): this; } interface _MonthDropDownConstructor extends _WidgetBaseConstructor<_MonthDropDown> { } interface Calendar extends CalendarLite, Omit<_Widget, "_changeAttrValue" | "placeAt" | keyof DojoJS.DojoClassObject>, _CssStateMixin { baseClass: string; /** * Set node classes for various mouse events, see dijit._CssStateMixin for more details */ cssStateNodes: CSSStateNodes; /** * Creates the drop down button that displays the current month and lets user pick a new one */ _createMonthWidget(): _MonthDropDownButton; postCreate(): void; /** * Handler for when user selects a month from the drop down list */ _onMonthSelect(newMonth: number): void; /** * Handler for mouse over events on days, sets hovered style */ _onDayMouseOver(evt: MouseEvent): void; /** * Handler for mouse out events on days, clears hovered style */ _onDayMouseOut(evt: MouseEvent): void; _onDayMouseDown(evt: MouseEvent): void; _onDayMouseUp(evt: MouseEvent): void; /** * Provides keyboard navigation of calendar. */ handleKey(evt: KeyboardEvent): void; /** * For handling keydown events on a stand alone calendar */ _onKeyDown(evt: KeyboardEvent): void; /** * Deprecated. Notification that a date cell was selected. It may be the same as the previous value. */ onValueSelected(date: Date): void; onChange(date: Date): void; /** * May be overridden to return CSS classes to associate with the date entry for the given dateObject * for example to indicate a holiday in specified locale. */ getClassForDate(dateObject: Date, locale?: string): string; get(name: 'value'): Date; get(name: string): any; set(name: 'value', value: number | Date): this; set(name: string, value: any): this; set(values: Object): this; } interface CalendarConstructor extends _WidgetBaseConstructor { _MonthWidget: _MonthWidgetConstructor; _MonthDropDown: _MonthDropDownButtonConstructor; _MonthDropDownButton: _MonthDropDownButtonConstructor; } /* dijit/CalendarLite */ interface _MonthWidget extends _WidgetBase { set(name: 'month', value: Date): this; set(name: string, value: any): this; set(values: Object): this; } interface _MonthWidgetConstructor extends _WidgetBaseConstructor<_MonthWidget> { } interface CalendarLite extends _WidgetBase, _TemplatedMixin { /** * Template for main calendar */ templateString: string; /** * Template for cell for a day of the week (ex: M) */ dowTemplateString: string; dateTemplateString: string; weekTemplateString: string; /** * The currently selected Date, initially set to invalid date to indicate no selection. */ value: Date; /** * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines * at dojo/date and dojo/date/locale. */ datePackage: string; /** * How to represent the days of the week in the calendar header. See locale */ dayWidth: string; /** * Order fields are traversed when user hits the tab key */ tabIndex: string; /** * (Optional) The first day of week override. By default the first day of week is determined * for the current locale (extracted from the CLDR). * Special value -1 (default value), means use locale dependent value. */ dayOffset: number; /** * Date object containing the currently focused date, or the date which would be focused * if the calendar itself was focused. Also indicates which year and month to display, * i.e. the current "page" the calendar is on. */ currentFocus: Date; /** * Put the summary to the node with role=grid */ _setSummaryAttr: string; baseClass: string; /** * Runs various tests on the value, checking that it's a valid date, rather * than blank or NaN. */ _isValidDate(value: Date): boolean; /** * Convert Number into Date, or copy Date object. Then, round to nearest day, * setting to 1am to avoid issues when DST shift occurs at midnight, see #8521, #9366) */ _patchDate(value: number | Date): Date; /** * This just sets the content of node to the specified text. * Can't do "node.innerHTML=text" because of an IE bug w/tables, see #3434. */ _setText(node: HTMLElement, text?: string): void; /** * Fills in the calendar grid with each day (1-31). * Call this on creation, when moving to a new month. */ _populateGrid(): void; /** * Fill in localized month, and prev/current/next years */ _populateControls(): void; /** * Sets calendar's value to today's date */ goToToday(): void; /** * Creates the drop down button that displays the current month and lets user pick a new one */ _createMonthWidget(): void; buildRendering(): void; postCreate(): void; /** * Set up connects for increment/decrement of months/years */ _connectControls(): void; /** * If the calendar currently has focus, then focuses specified date, * changing the currently displayed month/year if necessary. * If the calendar doesn't have focus, updates currently * displayed month/year, and sets the cell that will get focus * when Calendar is focused. */ _setCurrentFocusAttr(date: Date, forceFocus?: boolean): void; /** * Focus the calendar by focusing one of the calendar cells */ focus(): void; /** * Handler for day clicks, selects the date if appropriate */ _onDayClick(evt: MouseEvent): void; /** * Returns the cell corresponding to the date, or null if the date is not within the currently * displayed month. */ _getNodeByDate(value: Date): HTMLElement; /** * Marks the specified cells as selected, and clears cells previously marked as selected. * For CalendarLite at most one cell is selected at any point, but this allows an array * for easy subclassing. */ _markSelectedDates(dates: Date[]): void; /** * Called only when the selected date has changed */ onChange(date: Date): void; /** * May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend` */ isDisabledDate(dateObject: Date, locale?: string): boolean; /** * May be overridden to return CSS classes to associate with the date entry for the given dateObject, * for example to indicate a holiday in specified locale. */ getClassForDate(dateObject: Date, locale?: string): string; get(name: 'value'): Date; get(name: string): any; set(name: 'value', value: number | Date): this; set(name: string, value: any): this; set(values: Object): this; } interface CalendarLiteConstructor extends _WidgetBaseConstructor { _MonthWidget: _MonthWidgetConstructor; } /* dijit/Destroyable */ interface Destroyable { _destroyed?: true; /** * Destroy this class, releasing any resources registered via own(). */ destroy(preserveDom?: boolean): void; /** * Track specified handles and remove/destroy them when this instance is destroyed, unless they were * already removed/destroyed manually. */ own(...args: any[]): any[]; } /** * Mixin to track handles and release them when instance is destroyed. */ interface DestroyableConstructor extends DojoJS.DojoClass { } /** dijit/_KeyNavMixin */ /** * A mixin to allow arrow key and letter key navigation of child or descendant widgets. * It can be used by dijit/_Container based widgets with a flat list of children, or more complex widgets like dijit/Tree. * * To use this mixin, the subclass must: * * - 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. * - Set all descendants' initial tabIndex to "-1"; both initial descendants and any descendants added later, by for example addChild() * - Define childSelector to a function or string that identifies focusable descendant widgets * * Also, child widgets must implement a focus() method. */ interface _KeyNavMixin extends _FocusMixin { /** * Tab index of the container; same as HTML tabIndex attribute. * Note then when user tabs into the container, focus is immediately moved to the first item in the container. */ tabIndex: string; /** * 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. */ childSelector: string | Function | null; /** * Called on left arrow key, or right arrow key if widget is in RTL mode. * Should go back to the previous child in horizontal container widgets like Toolbar. */ _onLeftArrow(evt?: KeyboardEvent): void; /** * Called on right arrow key, or left arrow key if widget is in RTL mode. * Should go to the next child in horizontal container widgets like Toolbar. */ _onRightArrow(evt?: KeyboardEvent): void; /** * Called on up arrow key. Should go to the previous child in vertical container widgets like Menu. */ _onUpArrow(evt?: KeyboardEvent): void; /** * Called on down arrow key. Should go to the next child in vertical container widgets like Menu. */ _onDownArrow(evt?: KeyboardEvent): void; /** * Default focus() implementation: focus the first child. */ focus(): void; /** * Returns first child that can be focused. */ _getFirstFocusableChild(): _WidgetBase; /** * Returns last child that can be focused. */ _getLastFocusableChild(): _WidgetBase; /** * Focus the first focusable child in the container. */ focusFirstChild(): void; /** * Focus the last focusable child in the container. */ focusLastChild(): void; /** * Focus specified child widget. * * @param widget Reference to container's child widget * @param last If true and if widget has multiple focusable nodes, focus the last one instead of the first one */ focusChild(widget: _WidgetBase, last?: boolean): void; /** * Handler for when the container itself gets focus. * * Initially the container itself has a tabIndex, but when it gets focus, switch focus to first child. */ _onContainerFocus(evt: Event): void; /** * Called when a child widget gets focus, either by user clicking it, or programatically by arrow key handling code. * * It marks that the current node is the selected one, and the previously selected node no longer is. */ _onChildFocus(child?: _WidgetBase): void; _searchString: string; multiCharSearchDuration: number; /** * When a key is pressed that matches a child item, this method is called so that a widget can take appropriate action is necessary. */ onKeyboardSearch(tem: _WidgetBase, evt: Event, searchString: string, numMatches: number): void; /** * Compares the searchString to the widget's text label, returning: * * * -1: a high priority match and stop searching * * 0: not a match * * 1: a match but keep looking for a higher priority match */ _keyboardSearchCompare(item: _WidgetBase, searchString: string): -1 | 0 | 1; /** * When a key is pressed, if it's an arrow key etc. then it's handled here. */ _onContainerKeydown(evt: Event): void; /** * When a printable key is pressed, it's handled here, searching by letter. */ _onContainerKeypress(evt: Event): void; /** * Perform a search of the widget's options based on the user's keyboard activity * * 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. */ _keyboardSearch(evt: Event, keyChar: string): void; /** * Called when focus leaves a child widget to go to a sibling widget. */ _onChildBlur(widget: _WidgetBase): void; /** * Returns the next or previous focusable descendant, compared to "child". * Implements and extends _KeyNavMixin._getNextFocusableChild() for a _Container. */ _getNextFocusableChild(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null; /** * Returns the first child. */ _getFirst(): _WidgetBase | null; /** * Returns the last descendant. */ _getLast(): _WidgetBase | null; /** * Returns the next descendant, compared to "child". */ _getNext(child: _WidgetBase, dir: 1 | -1): _WidgetBase | null; } interface _KeyNavMixinConstructor extends DojoJS.DojoClass<_KeyNavMixin> { } /* dijit/_KeyNavContainer */ /** * A _Container with keyboard navigation of its children. * * Provides normalized keyboard and focusing code for Container widgets. * To use this mixin, call connectKeyNavHandlers() in postCreate(). * Also, child widgets must implement a focus() method. */ interface _KeyNavContainer extends _FocusMixin, _KeyNavMixin, _Container { /** * 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(). * * @param prevKeyCodes Key codes for navigating to the previous child. * @param nextKeyCodes Key codes for navigating to the next child. */ connectKeyNavHandlers(prevKeyCodes: number[], nextKeyCodes: number[]): void; /** * @deprecated */ startupKeyNavChildren(): void; /** * Setup for each child widget. * * Sets tabIndex=-1 on each child, so that the tab key will leave the container rather than visiting each child. * * 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. * * Note: see also _LayoutWidget.setupChild(), which is also called for each child widget. */ _startupChild(widget: _WidgetBase): void; /** * Returns the first child. */ _getFirst(): _Widget | null; /** * Returns the last descendant. */ _getLast(): _Widget | null; /** * Focus the next widget */ focusNext(): void; /** * Focus the last focusable node in the previous widget * * (ex: go to the ComboButton icon section rather than button section) */ focusPrev(): void; /** * Implement _KeyNavMixin.childSelector, to identify focusable child nodes. * * If we allowed a dojo/query dependency from this module this could more simply be a string "> *" instead of this function. */ childSelector(node: Element | Node): boolean | void | any; } interface _KeyNavContainerConstructor extends DojoJS.DojoClass<_KeyNavContainer> { } /* dijit/_MenuBase */ /** * Abstract base class for Menu and MenuBar. * Subclass should implement _onUpArrow(), _onDownArrow(), _onLeftArrow(), and _onRightArrow(). */ interface _MenuBase extends _Widget, _TemplatedMixin, _KeyNavContainer, _CssStateMixin { selected: MenuItem | null; _setSelectedAttr(item?: MenuItem | null): void; /** * 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. * * 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. */ activated: boolean; _setActivatedAttr(val: boolean): void; /** * pointer to menu that displayed me */ parentMenu: _Widget | null; /** * 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. */ popupDelay: number; /** * 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. */ passivePopupDelay: number; /** * 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. */ autoFocus: boolean; /** * 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. */ childSelector(node: Element | Node): boolean | void | Function; /** * 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. */ onExecute(): void; /** * Attach point for notification about when the user cancels the current menu * 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. */ onCancel(): void; /** * 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 */ _moveToPopup(evt: Event): void; /** * This handler is called when the mouse moves over the popup. */ _onPopupHover(evt?: MouseEvent): void; /** * Called when cursor is over a MenuItem. */ onItemHover(item: MenuItem): void; /** * Called when a child MenuItem becomes deselected. Setup timer to close its popup. */ _onChildDeselect(item: MenuItem): void; /** * Callback fires when mouse exits a MenuItem */ onItemUnhover(item: MenuItem): void; /** * Cancels the popup timer because the user has stop hovering on the MenuItem, etc. */ _stopPopupTimer(): void; /** * Cancels the pending-close timer because the close has been preempted */ _stopPendingCloseTimer(): void; /** * Returns the top menu in this chain of Menus */ _getTopMenu(): void; /** * Handle clicks on an item. */ onItemClick(item: _WidgetBase, evt: Event): void; /** * Open the popup to the side of/underneath the current menu item, and optionally focus first item */ _openItemPopup(fromItem: MenuItem, focus: boolean): void; /** * Callback when this menu is opened. * This is called by the popup manager as notification that the menu was opened. */ onOpen(evt?: Event): void; /** * Callback when this menu is closed. * This is called by the popup manager as notification that the menu was closed. */ onClose(): boolean; /** * Called when submenu is clicked or focus is lost. Close hierarchy of menus. */ _closeChild(): void; /** * Called when child of this Menu gets focus from: * * 1. clicking it * 2. tabbing into it * 3. being opened by a parent menu. * * This is not called just from mouse hover. */ _onItemFocus(item: MenuItem): void; /** * Called when focus is moved away from this Menu and it's submenus. */ _onBlur(): void; /** * Called when the user is done with this menu. Closes hierarchy of menus. */ _cleanUp(clearSelectedItem?: boolean): void; } interface _MenuBaseConstructor extends _WidgetBaseConstructor<_MenuBase> { } /* dijit/Dialog */ interface _DialogBase extends _TemplatedMixin, form._FormMixin, _DialogMixin, _CssStateMixin { _relativePosition?: { x: number; y: number; }; templateString: string; baseClass: string; cssStateNodes: CSSStateNodes; /** * True if Dialog is currently displayed on screen. */ open: boolean; /** * The time in milliseconds it takes the dialog to fade in and out */ duration: number; /** * A Toggle to modify the default focus behavior of a Dialog, which * is to re-focus the element which had focus before being opened. * False will disable refocusing. Default: true */ refocus: boolean; /** * A Toggle to modify the default focus behavior of a Dialog, which * is to focus on the first dialog element after opening the dialog. * False will disable autofocusing. Default: true */ autofocus: boolean; /** * Toggles the movable aspect of the Dialog. If true, Dialog * can be dragged by it's title. If false it will remain centered * in the viewport. */ draggable: boolean; /** * Maximum size to allow the dialog to expand to, relative to viewport size */ maxRatio: number; /** * Dialog show [x] icon to close itself, and ESC key will close the dialog. */ closable: boolean; postMixInProperties(): void; postCreate(): void; /** * Called when data has been loaded from an href. * Unlike most other callbacks, this function can be connected to (via `dojo.connect`) * but should *not* be overridden. */ onLoad(data?: any): void; focus(): void; /* Not entirely sure of the resolution type of these promises */ /** * Display the dialog */ show(): Promise; /** * Hide the dialog */ hide(): Promise; /** * Called with no argument when viewport scrolled or viewport size changed. Adjusts Dialog as * necessary to keep it visible. * * Can also be called with an argument (by dojox/layout/ResizeHandle etc.) to explicitly set the * size of the dialog. */ resize(dim?: { l: number; r: number; w: number; h: number; }): void; destroy(preserveDom?: boolean): void; } interface _DialogBaseConstructor extends _WidgetBaseConstructor<_DialogBase> { } interface Dialog extends layout.ContentPane, _DialogBase { /* overrides conflicting methods */ resize(dim?: { l: number; r: number; w: number; h: number; }): void; } interface DialogLevelManager { _beginZIndex: number; /** * Call right before fade-in animation for new dialog. * * Saves current focus, displays/adjusts underlay for new dialog, * and sets the z-index of the dialog itself. * * New dialog will be displayed on top of all currently displayed dialogs. * Caller is responsible for setting focus in new dialog after the fade-in * animation completes. */ show(dialog: _WidgetBase, underlayAttrs: Object): void; /** * Called when the specified dialog is hidden/destroyed, after the fade-out * animation ends, in order to reset page focus, fix the underlay, etc. * If the specified dialog isn't open then does nothing. * * Caller is responsible for either setting display:none on the dialog domNode, * or calling dijit/popup.hide(), or removing it from the page DOM. */ hide(dialog: _WidgetBase): void; /** * Returns true if specified Dialog is the top in the task */ isTop(dialog: _WidgetBase): boolean; } interface DialogConstructor extends _WidgetBaseConstructor { /** * for monkey patching and dojox/widget/DialogSimple */ _DialogBase: _DialogBaseConstructor; _DialogLevelManager: DialogLevelManager; _dialogStack: { dialog: _WidgetBase, focus: any, underlayAttrs: any }[]; } /* dijit/ConfirmDialog */ interface ConfirmDialog extends _ConfirmDialogMixin { } interface ConfirmDialogConstructor extends DialogConstructor { } /* dijit/DropDownMenu */ /** * A menu, without features for context menu (Meaning, drop down menu) */ interface DropDownMenu extends _MenuBase { } interface DropDownMenuConstructor extends _WidgetBaseConstructor { } /* dijit/Fieldset */ /** * An accessible fieldset that can be expanded or collapsed via * its legend. Fieldset extends `dijit.TitlePane`. */ interface Fieldset extends TitlePane { open: boolean; } interface FieldsetConstructor extends _WidgetBaseConstructor
{ } /* dijit/Menu */ /** * A context menu you can assign to multiple elements */ interface Menu extends DijitJS.DropDownMenu { /** * Array of dom node ids of nodes to attach to. * Fill this with nodeIds upon widget creation and it becomes context menu for those nodes. */ targetNodeIds: string[]; /** * CSS expression to apply this Menu to descendants of targetNodeIds, rather than to * the nodes specified by targetNodeIds themselves. Useful for applying a Menu to * a range of rows in a table, tree, etc. * * The application must require() an appropriate level of dojo/query to handle the selector. */ selector: string; /** * If true, right clicking anywhere on the window will cause this context menu to open. * If false, must specify targetNodeIds. */ contextMenuForWindow: boolean; /** * If true, menu will open on left click instead of right click, similar to a file menu. */ leftClickToOpen: boolean; /** * When this menu closes, re-focus the element which had focus before it was opened. */ refocus: boolean; /** * Attach menu to given node */ bindDomNode(node: string | Node): void; /** * Detach menu from given node */ unBindDomNode(nodeName: string | Node): void; } interface MenuConstructor extends _WidgetBaseConstructor { } /* dijit/MenuBar */ interface MenuBar extends _MenuBase { baseClass: 'dijitMenuBar'; popupDelay: number; _isMenuBar: true; _orient: string[]; _moveToPopup(evt: Event): void; focusChild(item: _WidgetBase): void; _onChildDeselect(item: _WidgetBase): void; _onLeftArrow(): void; _onRightArrow(): void; _onDownArrow(): void; _onUpArrow(): void; onItemClick(item: _WidgetBase, evt: Event): void; } interface MenuBarConstructor extends _WidgetBaseConstructor { } /* dijit/MenuBarItem */ interface MenuBarItem extends MenuItem { } interface MenuBarItemConstructor extends _WidgetBaseConstructor { } /* dijit/MenuItem */ interface MenuItem extends _Widget, _TemplatedMixin, _Contained, _CssStateMixin { /** * 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. * * Note that although Menu can display accelerator keys, there is no infrastructure to actually catch and execute those accelerators. */ accelKey: string; /** * If true, the menu item is disabled. * If false, the menu item is enabled. */ disabled: boolean; /** Menu text as HTML */ label: string; /** * Class to apply to DOMNode to make it display an icon. */ iconClass: string; /** * Hook for attr('accelKey', ...) to work. * Set accelKey on this menu item. */ _setAccelKeyAttr(value: string): void; /** * Hook for attr('disabled', ...) to work. * Enable or disable this menu item. */ _setDisabledAttr(value: boolean): void; _setLabelAttr(val: string): void; _setIconClassAttr(val: string): void; _fillContent(source: Element): void; /** * Indicate that this node is the currently selected one */ _setSelected(selected: boolean): void; focus(): void; /** * Deprecated. * Use set('disabled', bool) instead. */ setDisabled(disabled: boolean): void; /** * Deprecated. * Use set('label', ...) instead. */ setLabel(content: string): void; } interface MenuItemConstructor extends _WidgetBaseConstructor { } /* dijit/MenuSeparator */ interface MenuSeparator extends _WidgetBase, _TemplatedMixin, _Contained { } interface MenuSeparatorConstructor extends _WidgetBaseConstructor { } /* dijit/place */ interface PlacePosition { x: number; y: number; } interface PlaceWidthHeight { w: number; h: number; } interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { } type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL'; type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt'; interface PlaceChoice { corner: PlaceCorner; pos: PlacePosition; aroundCorner?: PlaceCorner; } interface PlaceLocation extends PlaceRectangle { corner: PlaceCorner; aroundCorner: PlaceCorner; overflow: number; spaceAvailable: PlaceWidthHeight; } interface LayoutNodeFunction { (node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number; } interface Place { /** * Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of * padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[] * where node is fully visible, or the corner where it's most visible. * * Node is assumed to be absolutely or relatively positioned. */ at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation; /** * Position node adjacent or kitty-corner to anchor * such that it's fully visible in viewport. */ around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation; } /* dijit/popup */ interface PopupOpenArgs { /** * widget to display */ popup?: _WidgetBase; /** * the button etc. that is displaying this popup */ parent?: _WidgetBase; /** * DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.) */ around?: HTMLElement; /** * Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.) */ x?: number; /** * Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.) */ y?: number; /** * When the around parameter is specified, orient should be a list of positions to try */ orient?: string | string[] | { BL?: string; TR?: string; TL?: string; BR?: string; }; /** * callback when user has canceled the popup by: * * 1. hitting ESC or * 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog); * i.e. whenever popupWidget.onCancel() is called, args.onCancel is called */ onCancel?: () => void; /** * callback whenever this popup is closed */ onClose?: () => void; /** * callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only) */ onExecute?: () => void; /** * adding a buffer around the opening position. This is only useful when around is not set. */ padding?: PlacePosition; /** * The max height for the popup. Any popup taller than this will have scrollbars. * Set to Infinity for no max height. Default is to limit height to available space in viewport, * above or below the aroundNode or specified x/y position. */ maxHeight?: number; } interface PopupManager { /** * Stack of currently popped up widgets. * (someone opened _stack[0], and then it opened _stack[1], etc.) */ _stack: _WidgetBase[]; /** * Z-index of the first popup. (If first popup opens other * popups they get a higher z-index.) */ _beginZIndex: number; _idGen: number; /** * If screen has been scrolled, reposition all the popups in the stack. * Then set timer to check again later. */ _repositionAll(): void; /** * Initialization for widgets that will be used as popups. * Puts widget inside a wrapper DIV (if not already in one), * and returns pointer to that wrapper DIV. */ _createWrapper(widget: _WidgetBase): HTMLDivElement; /** * Moves the popup widget off-screen. * Do not use this method to hide popups when not in use, because * that will create an accessibility issue: the offscreen popup is * still in the tabbing order. */ moveOffScreen(widget: _WidgetBase): HTMLDivElement; /** * Hide this popup widget (until it is ready to be shown). * Initialization for widgets that will be used as popups * * Also puts widget inside a wrapper DIV (if not already in one) * * If popup widget needs to layout it should * do so when it is made visible, and popup._onShow() is called. */ hide(widget: _WidgetBase): void; /** * Compute the closest ancestor popup that's *not* a child of another popup. * Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button. */ getTopPopup(): _WidgetBase; /** * Popup the widget at the specified position */ open(args: PopupOpenArgs): PlaceLocation; /** * Close specified popup and any popups that it parented. * If no popup is specified, closes all popups. */ close(popup?: boolean | _WidgetBase): void; } /* dijit/PopupMenuBarItem */ interface PopupMenuBarItem extends PopupMenuItem { } interface PopupMenuBarItemConstructor extends _WidgetBaseConstructor { } /** dijit/PopupMenuItem */ /** * An item in a Menu that spawn a drop down (usually a drop down menu) */ interface PopupMenuItem extends MenuItem { /** * When Menu is declared in markup, this code gets the menu label and the popup widget from the srcNodeRef. * * srcNodeRef.innerHTML contains both the menu item text and a popup widget * The first part holds the menu item text and the second part is the popup */ _fillContent(source: Element): void; /** * Open the popup to the side of/underneath this MenuItem, and optionally focus first item */ _openPopup(params: { around?: Element; popup?: Function }, focus?: boolean): void; _closePopup(): void; } interface PopupMenuItemConstructor extends _WidgetBaseConstructor { } /* dijit/registry */ interface Registry { /** * Number of registered widgets */ length: number; /** * Add a widget to the registry. If a duplicate ID is detected, a error is thrown. */ add(widget: _WidgetBase): void; /** * Remove a widget from the registry. Does not destroy the widget; simply * removes the reference. */ remove(id: string): void; /** * Find a widget by it's id. * If passed a widget then just returns the widget. */ byId(id: string | T): T; /** * Returns the widget corresponding to the given DOMNode */ byNode(node: Element | Node): T; /** * Convert registry into a true Array */ toArray(): _WidgetBase[]; /** * Generates a unique id for a given widgetType */ getUniqueId(widgetType: string): string; /** * Search subtree under root returning widgets found. * Doesn't search for nested widgets (ie, widgets inside other widgets). */ findWidgets(root: Node, skipNode?: Node): _WidgetBase[]; /** * Returns the widget whose DOM tree contains the specified DOMNode, or null if * the node is not contained within the DOM tree of any widget */ getEnclosingWidget(node: Element | Node): _WidgetBase; } /* dijit/TitlePane */ interface TitlePane extends DijitJS.layout.ContentPane, _TemplatedMixin, _CssStateMixin { /** * Whether pane can be opened or closed by clicking the title bar. */ toggleable: boolean; /** * Tabindex setting for the title (so users can tab to the title then use space/enter to open/close the title pane) */ tabIndex: string; /** * Time in milliseconds to fade in/fade out */ duration: number; /** * Don't change this parameter from the default value. * * 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. */ doLayout: boolean; /** * Switches between opened and closed state */ toggle(): void; /** * Set the open/close css state for the TitlePane */ _setCss(): void; /** * Handler for when user hits a key */ _onTitleKey(e: Event): void; /** * Handler when user clicks the title bar */ _onTitleClick(): void; /** * Deprecated. Use set('title', ...) instead. */ setTitle(): void; } interface TitlePaneConstructor extends _WidgetBaseConstructor { } /* dijit/Toolbar */ interface Toolbar extends DijitJS._Widget, DijitJS._TemplatedMixin, DijitJS._KeyNavContainer { } interface ToolbarConstructor extends _WidgetBaseConstructor { } /* dijit/ToolbarSeparator */ interface ToolbarSeparator extends DijitJS._Widget, DijitJS._TemplatedMixin { } interface ToolbarSeparatorConstructor extends _WidgetBaseConstructor { } /* dijit/Tooltip */ interface Tooltip extends Omit<_Widget, 'onShow'> { /** * HTML to display in the tooltip. * Specified as innerHTML when creating the widget from markup. */ label: string; /** * Number of milliseconds to wait after hovering over/focusing on the object, before * the tooltip is displayed. */ showDelay: number; /** * Number of milliseconds to wait after unhovering the object, before * the tooltip is hidden. Note that blurring an object hides the tooltip immediately. */ hideDelay: number; /** * Id of domNode(s) to attach the tooltip to. * When user hovers over specified dom node(s), the tooltip will appear. */ connectId: Node | string | Node | string[]; /** * See description of `dijit/Tooltip.defaultPosition` for details on position parameter. */ position: DijitJS.PlacePositions[]; /** * CSS expression to apply this Tooltip to descendants of connectIds, rather than to * the nodes specified by connectIds themselves. Useful for applying a Tooltip to * a range of rows in a table, tree, etc. Use in conjunction with getContent() parameter. * Ex: connectId: myTable, selector: "tr", getContent: function(node){ return ...; } * * The application must require() an appropriate level of dojo/query to handle the selector. */ selector: string; /** * Attach tooltip to specified node if it's not already connected */ addTarget(node: Node | string): void; /** * Detach tooltip from specified node */ removeTarget(node: Node | string): void; /** * User overridable function that return the text to display in the tooltip. */ getContent(node: Node): Node; /** * Display the tooltip; usually not called directly. */ open(target: Node): void; /** * Hide the tooltip or cancel timer for show of tooltip */ close(): void; /** * Called when the tooltip is shown */ onShow: (connectNode: any, position: DijitJS.PlacePositions[]) => void /** * Called when the tooltip is hidden */ onHide: () => void; _onHover(_connectNode: any): void; _onUnHover(_?: any): void; } interface TooltipConstructor extends _WidgetBaseConstructor { /** * This variable controls the position of tooltips, if the position is not specified to * the Tooltip widget or *TextBox widget itself. It's an array of strings with the values * possible for `dijit/place.around()`. The recommended values are: * * - before-centered: centers tooltip to the left of the anchor node/widget, or to the right * in the case of RTL scripts like Hebrew and Arabic * - after-centered: centers tooltip to the right of the anchor node/widget, or to the left * in the case of RTL scripts like Hebrew and Arabic * - above-centered: tooltip is centered above anchor node * - below-centered: tooltip is centered above anchor node * * The list is positions is tried, in order, until a position is found where the tooltip fits * within the viewport. * * Be careful setting this parameter. A value of "above-centered" may work fine until the user scrolls * the screen so that there's no room above the target node. Nodes with drop downs, like * DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure * that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there * is only room below (or above) the target node, but not both. */ defaultPosition: DijitJS.PlacePositions[]; _MasterTooltip: any; /** * Static method to display tooltip w/specified contents in specified position. * See description of dijit/Tooltip.defaultPosition for details on position parameter. * If position is not specified then dijit/Tooltip.defaultPosition is used. */ show(innerHTML: string, aroundNode: PlaceRectangle, position?: DijitJS.PlacePositions[], rtl?: boolean, textDir?: string, onMouseEnter?: Function, onMouseLeave?: Function): void; /** * Hide the tooltip */ hide(aroundNode: PlaceRectangle): void; } /* dijit/TooltipDialog */ interface TooltipDialog extends layout.ContentPane, _TemplatedMixin, form._FormMixin, _DialogMixin { /** * Description of tooltip dialog (required for a11y) */ title: string; closable: boolean; /** * Don't change this parameter from the default value. * This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog * is never a child of a layout container, nor can you specify the size of * TooltipDialog in order to control the size of an inner widget. */ doLayout: boolean; /** * A Toggle to modify the default focus behavior of a Dialog, which * is to focus on the first dialog element after opening the dialog. * False will disable autofocusing. Default: true. */ autofocus: boolean; /** * The pointer to the first focusable node in the dialog. */ _firstFocusItem: any; /** * The pointer to which node has focus prior to our dialog. */ _lastFocusItem: any; /** * Configure widget to be displayed in given position relative to the button. * * This is called from the dijit.popup code, and should not be called directly. */ orient(node: Node | HTMLElement, aroundCorner: PlaceCorner, tooltipCorner: PlaceCorner): void; /** * Focus on first field */ focus(): void; /** * Called when dialog is displayed. * * This is called from the dijit.popup code, and should not be called directly. */ onOpen(pos: { aroundCorner: PlaceCorner aroundNodePos: PlacePosition corner: PlaceCorner x: number y: number }): void; /** * Handler for keydown events * * Keep keyboard focus in dialog; close dialog on escape key */ _onKey(evt: KeyboardEvent): void; } interface TooltipDialogConstructor extends _WidgetBaseConstructor { } } // TODO: Correctly type and split namespace into the files. This is included here so that dojo typings are available. declare namespace DijitJS { namespace layout { /* dijit/_LayoutWidget */ /* tslint:disable:class-name */ interface _LayoutWidget extends _Widget, _Container, _Contained { /** * Base class for a _Container widget which is responsible for laying * out its children. Widgets which mixin this code must define layout() * to manage placement and sizing of the children. */ baseClass: string; /** * Indicates that this widget is going to call resize() on its * children widgets, setting their size, when they become visible. */ isLayoutContainer: boolean; /** * Call this to resize a widget, or after its size has changed. * * ####Change size mode: * * When changeSize is specified, changes the marginBox of this widget * and forces it to re-layout its contents accordingly. * changeSize may specify height, width, or both. * * If resultSize is specified it indicates the size the widget will * become after changeSize has been applied. * * ####Notification mode: * * When changeSize is null, indicates that the caller has already changed * the size of the widget, or perhaps it changed because the browser * window was resized. Tells widget to re-layout its contents accordingly. * * If resultSize is also specified it indicates the size the widget has * become. * * In either mode, this method also: * * 1. Sets this._borderBox and this._contentBox to the new size of * the widget. Queries the current domNode size if necessary. * 2. Calls layout() to resize contents (and maybe adjust child widgets). */ resize(changeSize?: { l?: number; t?: number; w?: number; h?: number }, resultSize?: DojoJS.DomGeometryWidthHeight): void; /** * Widgets override this method to size and position their contents/children. * When this is called, this._contentBox is guaranteed to be set (see resize()). * * This is called after startup(), and also when the widget's size has been * changed. */ layout(): void; } interface _LayoutWidgetConstructor extends _WidgetBaseConstructor<_LayoutWidget> { } /* dijit/layout/_TabContainerBase */ interface _TabContainerBase extends StackContainer, _TemplatedMixin { /** * Defines where tabs go relative to tab content. * "top", "bottom", "left-h", "right-h" */ tabPosition: string; // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h'; /** * Defines whether the tablist gets an extra class for layouting, putting a border/shading * around the set of tabs. Not supported by claro theme. */ tabStrip: boolean; /** * If true, use styling for a TabContainer nested inside another TabContainer. * For tundra etc., makes tabs look like links, and hides the outer * border since the outer TabContainer already has a border. */ nested: boolean; } /* dijit/layout/LayoutContainer */ interface LayoutContainer extends _LayoutWidget { /** * Which design is used for the layout: * * - "headline" (default) where the top and bottom extend the full width of the container * - "sidebar" where the left and right sides extend from top to bottom. * * However, a `layoutPriority` setting on child panes overrides the `design` attribute on the parent. * In other words, if the top and bottom sections have a lower `layoutPriority` than the left and right * panes, the top and bottom panes will extend the entire width of the box. */ design: string; // design: 'headline' | 'sidebar'; addChild(child: T, insertIndex?: number): void; removeChild(child: T): void; } interface LayoutContainerConstructor extends _WidgetBaseConstructor { } /* dijit/layout/AccordionContainer */ interface _AccordionButton extends _WidgetBase, _TemplatedMixin, _CssStateMixin { /** * Title of the pane. */ label: string; /** * Tooltip that appears on hover. */ title: string; /** * CSS class for icon to left of label. */ iconClassAttr: string; /** * Returns the height of the title dom node. */ getTitleHeight(): number; } interface _AccordionButtonConstructor extends _WidgetBaseConstructor<_AccordionButton> { } interface AccordionContainer extends StackContainer { /** * Amount of time (in ms) it takes to slide panes. */ duration: number; /** * The name of the widget used to display the title of each pane. */ buttonWidget: _AccordionButtonConstructor; } interface AccordionContainerConstructor extends _WidgetBaseConstructor { } /* dijit/layout/AccordionPane */ interface AccordionPane extends ContentPane { /** * Called when this pane is selected. */ onSelected(): void; } interface AccordionPaneConstructor extends _WidgetBaseConstructor { } /* dijit/layout/BorderContainer */ interface BorderContainer extends LayoutContainer { /** * Give each pane a border and margin. * Margin determined by domNode.paddingLeft. * When false, only resizable panes have a gutter (i.e. draggable splitter) for resizing. */ gutters: boolean; /** * Specifies whether splitters resize as you drag (true) or only upon mouseup (false) */ liveSplitters: boolean; /** * Save splitter positions in a cookie. */ persist: boolean; /** * Returns the widget responsible for rendering the splitter associated with region.with */ getSplitter(region: string): any; destroyRecursive(): void; } interface BorderContainerConstructor extends _WidgetBaseConstructor { } /* dijit/ContentPane */ interface ContentPane extends _Widget, _Container, _ContentPaneResizeMixin { /** * The href of the content that displays now * Set this at construction if you want to load data externally when th * pane is shown. (Set preload=true to load it immediately. * Changing href after creation doesn't have any effect; Use set('href', ...); */ href: string; /** * The innerHTML of the ContentPane * Note that the initialization parameter / argument to set("content", ... * can be a String, DomNode, Nodelist, or _Widget. */ content: string | Node | ArrayLike | DijitJS._Widget; /** * Extract visible content from inside of ` .... ` * I.e., strip `` and `` (and it's contents) from the href */ extractContent: boolean; /** * Parse content and create the widgets, if any. */ parseOnLoad: boolean; /** * Flag passed to parser. Root for attribute names to search for. If scopeName is dojo * will search for data-dojo-type (or dojoType). For backwards compatibilit * reasons defaults to dojo._scopeName (which is "dojo" except whe * multi-version support is used, when it will be something like dojo16, dojo20, etc.) */ parserScope: string; /** * Prevent caching of data from href's by appending a timestamp to the href. */ preventCache: boolean; /** * Force load of data on initialization even if pane is hidden. */ preload: boolean; /** * Refresh (re-download) content when pane goes from hidden to shown */ refreshOnShow: boolean; /** * Message that shows while downloading */ loadingMessage: string; /** * Message that shows if an error occurs */ errorMessage: string; /** * True if the ContentPane has data in it, either specifie * during initialization (via href or inline content), or se * via set('content', ...) / set('href', ... * False if it doesn't have any content, or if ContentPane i * still in the process of downloading href. */ isLoaded: boolean; baseClass: string; /** * Function that should grab the content specified via href. */ ioMethod(url: string, options?: DojoJS.request.XhrBaseOptions): DojoJS.Promise; /** * Parameters to pass to xhrGet() request, for example: * |
*/ ioArgs: { [arg: string]: string | number }; /** * This is the `dojo.Deferred` returned by set('href', ...) and refresh() * Calling onLoadDeferred.then() registers you * callback to be called only once, when the prior set('href', ...) call o * the initial href parameter to the constructor finishes loading * This is different than an onLoad() handler which gets called any time any hre * or content is loaded. */ onLoadDeferred: DojoJS.Deferred; /** * Flag to parser that I'll parse my contents, so it shouldn't. */ stopParser: boolean; /** * Flag from the parser that this ContentPane is inside a templat * so the contents are pre-parsed. */ template: boolean; markupFactory(params: any, node: HTMLElement, ctor: Constructor): T; postMixInProperties(): void; buildRendering(): void; /** * Call startup() on all children including non _Widget ones like dojo/dnd/Source objects */ startup(): void; /** * Deprecated. Use set('href', ...) instead. */ setHref(href: string | URL): ContentPane; /** * Deprecated. Use set('content', ...) instead. */ setContent(data: string | Node | ArrayLike): ContentPane; /** * Cancels an in-flight download of content */ cancel(): void; /** * [Re]download contents of href and display */ refresh(): DojoJS.Deferred; /** * Destroy all the widgets inside the ContentPane and empty containerNode */ destroyDescendants(preserveDom?: boolean): void; /** * Event hook, is called after everything is loaded and widgetified */ onLoad(data?: any): void; /** * Event hook, is called before old content is cleared */ onUnload(): void; /** * Called before download starts. */ onDownloadStart(): string; /** * Called on DOM faults, require faults etc. in content. * In order to display an error message in the pane, return * the error message from this method, as an HTML string. * By default (if this method is not overriden), it returns * nothing, so the error message is just printed to the console. */ onContentError(error: Error): void; /** * Called when download error occurs. * In order to display an error message in the pane, return * the error message from this method, as an HTML string. * Default behavior (if this method is not overriden) is to display * the error message inside the pane. */ onDownloadError(error: Error): void; /** * Called when download is finished. */ onDownloadEnd(): void; } interface ContentPaneConstructor extends _WidgetBaseConstructor { } /* dijit/layout/_ContentPaneResizeMixin */ /* tslint:disable:class-name */ interface _ContentPaneResizeMixin { /** * - false - don't adjust size of children * - true - if there is a single visible child widget, set it's size to however big the ContentPane is */ doLayout: boolean; /** * Indicates that this widget will call resize() on it's child widgets * when they become visible. */ isLayoutContainer: boolean; /** * See `dijit/layout/_LayoutWidget.startup()` for description. * Although ContentPane doesn't extend _LayoutWidget, it does implement * the same API. */ startup(): void; /** * See `dijit/layout/_LayoutWidget.resize()` for description. * Although ContentPane doesn't extend _LayoutWidget, it does implement * the same API. */ resize(changeSize?: { l?: number; t?: number; w?: number; h?: number }, resultSize?: DojoJS.DomGeometryWidthHeight): void; } interface _ContentPaneResizeMixinConstructor extends _WidgetBaseConstructor<_ContentPaneResizeMixin> { } /* dijit/layout/LinkPane */ interface LinkPane extends ContentPane, _TemplatedMixin { /** * A ContentPane with an href where (when declared in markup) the * title is specified as innerHTML rather than as a title attribute. */ } interface LinkPaneConstructor extends _WidgetBaseConstructor { } /* dijit/layout/ScrollingTabController */ interface ScrollingTabController extends TabController, _WidgetsInTemplateMixin { /** * True if a menu should be used to select tabs when they are too * wide to fit the TabContainer, false otherwise. */ useMenu: boolean; /** * True if a slider should be used to select tabs when they are too * wide to fit the TabContainer, false otherwise. */ useSlider: boolean; /** * The css class to apply to the tab strip, if it is visible. */ tabStripClass: string; /** * Creates an Animation object that smoothly scrolls the tab list * either to a fixed horizontal pixel value, or to the selected tab. */ createSmoothScroll(pixels?: number): DojoJS.Animation; /** * Scrolls the menu to the right. */ doSlideRight(e: MouseEvent): void; /** * Scrolls the menu to the left. */ doSlideLeft(e: MouseEvent): void; /** * Scrolls the tab list to the left or right by 75% of the widget * width. */ doSlide(direction: number, node: HTMLElement): void; } interface ScrollingTabControllerConstructor extends _WidgetBaseConstructor { } /* dijit/layout/StackContainer */ interface StackContainer extends _LayoutWidget { /** * If true, change the size of my currently displayed child to match my size. */ doLayout: boolean; /** * Remembers the selected child across sessions. */ persist: boolean; /** * References the currently selected child widget, if any. * Adjust selected child with selectChild() method. */ selectedChildWidget: _Widget; selectChild(page: T | string, animate: boolean): DojoJS.Promise; forward(): DojoJS.Promise; back(): DojoJS.Promise; closeChild(page: T): void; /** * Destroy all the widgets inside the StackContainer and empty containerNode */ destroyDescendants(preserveDom?: boolean): void; } interface StackContainerConstructor extends _WidgetBaseConstructor { } interface StackContainerChildWidget extends _WidgetBase { /** * Specifies that this widget should be the initially displayed pane. * Note: to change the selected child use `dijit/layout/StackContainer.selectChild` */ selected: boolean; /** * Specifies that the button to select this pane should be disabled. * Doesn't affect programmatic selection of the pane, nor does it deselect the pane if it is currently selected. */ disabled: boolean; /** * True if user can close (destroy) this child, such as (for example) clicking the X on the tab. */ closable: boolean; /** * CSS class specifying icon to use in label associated with this pane. */ iconClass: string; /** * When true, display title of this widget as tab label etc., rather than just using * icon specified in iconClass. */ showTitle: boolean; } /* dijit/layout/StackController */ interface _StackButton extends DijitJS.form.ToggleButton { /** * When true, display close button for this tab. */ closeButton: boolean; } interface _StackButtonConstructor extends _WidgetBaseConstructor<_StackButton> { } interface StackControllerBase extends _Widget, _TemplatedMixin, _Container { /** * The id of the page container I point to. */ containerId: string; /** * CSS class of [x] close icon used by event delegation code to tell when * the close button was clicked. */ buttonWidgetCloseClass: string; /** * Returns the button corresponding to the pane with the given id. */ pane2button(id: string): T; /** * Called after the StackContainer has finished initializing. */ onStartup(info: Object): void; /** * Called whenever a page is added to the container. Create button * corresponding to the page. */ onAddChild(page: T, insertIndex?: number): void; /** * Called whenever a page is removed from the container. Remove the * button corresponding to the page. */ onRemoveChild(page: T): void; /** * Called when a page has been selected in the StackContainer, either * by me or by another StackController. */ onSelectChild(page: T): void; /** * Called whenever one of my child buttons is pressed in an attempt to * select a page. */ onButtonClick(page: T): void; /** * Called whenever one of my child buttons [X] is pressed in an attempt * to close a page. */ onCloseButtonClick(page: T): void; /** * Helper for onkeydown to find next/previous button. */ adjacent(forward: boolean): _WidgetBase; /** * Handle keystrokes on the page list, for advancing to next/previous * button and closing the page in the page is closable. */ onkeydown(e: Event, fromContainer?: boolean): void; /** * Called when there was a keydown on the container. */ onContainerKeyDown(info: Object): void; } interface StackController extends StackControllerBase { /** * The button widget to create to correspond to each page. */ buttonWidget: _StackButtonConstructor; } interface StackControllerConstructor extends _WidgetBaseConstructor { } /* dijit/layout/TabContainer */ interface TabContainer extends _TabContainerBase { /** * True if a menu should be used to select tabs when they are too * wide to fit the TabContainer, false otherwise. */ useMenu: boolean; /** * True if a slider should be used to select tabs when they are too * wide to fit the TabContainer, false otherwise. */ useSlider: boolean; /** * An optional parameter to override the widget used to display the tab labels. */ controllerWidget: string; } interface TabContainerConstructor extends _WidgetBaseConstructor { } /* dijit/layout/TabController */ interface _TabButton extends _StackButton { } interface _TabButtonConstructor extends _WidgetBaseConstructor<_TabButton> { } interface TabController extends StackControllerBase { /** * Defines where tabs go relative to the content. * "top", "bottom", "left-h", "right-h" */ tabPosition: string; // tabPosition: 'top' | 'bottom' | 'left-h' | 'right-h'; /** * The tab widget to create to correspond to each page. */ buttonWidget: _TabButtonConstructor; /** * Class of [x] close icon, used by event delegation code to tell * when close button was clicked. */ buttonWidgetCloseClass: string; } interface TabControllerConstructor extends _WidgetBaseConstructor { TabButton: _TabButton; } } } // TODO: Correctly type and split namespace into the files. This is included here so that dijit.form typings are available. declare namespace DijitJS { namespace form { /* implied */ interface Constraints { [prop: string]: any; } interface ConstrainedValueFunction { /** * Returns a value that has been constrained by the constraints * @param value The value to constrain * @param constraints The constraints to use * @returns The constrained value */ (value: V, constraints: C): T; } interface ConstrainedValidFunction { /** * Returns true if the value is valid based on the constraints, otherwise * returns false. * @param value The value to check * @param constraints The constraints to use * @returns true if valid, otherwise false */ (value: any, constraints: C): boolean; } interface ConstraintsToRegExpString { /** * Takes a set of constraints and returns a RegExpString that can be used * to match values against * @param constraints The constraints to use * @returns The RegExpString that represents the constraints */ (constraints: C): string; } interface SerializationFunction { (val: any, options?: Object): string; } /* dijit/form/_AutoCompleterMixin */ /* tslint:disable:class-name */ interface _AutoCompleterMixin extends _SearchMixin { /** * This is the item returned by the dojo/store/api/Store implementation that * provides the data for this ComboBox, it's the currently selected item. */ item: T; /** * If user types in a partial string, and then tab out of the `` box, * automatically copy the first entry displayed in the drop down list to * the `` field */ autoComplete: boolean; /** * One of: "first", "all" or "none". */ highlightMatch: 'first' | 'all' | 'none'; /** * The entries in the drop down list come from this attribute in the * dojo.data items. * If not specified, the searchAttr attribute is used instead. */ labelAttr: string; /** * Specifies how to interpret the labelAttr in the data store items. * Can be "html" or "text". */ labelType: string; /** * Flags to _HasDropDown to limit height of drop down to make it fit in viewport */ maxHeight: number; /** * For backwards compatibility let onClick events propagate, even clicks on the down arrow button */ _stopClickEvents: boolean; _getCaretPos(element: HTMLElement): number; _setCaretPos(element: HTMLElement, location: number): void; /** * Overrides _HasDropDown.loadDropDown(). */ loadDropDown(loadCallback: () => void): void; /** * signal to _HasDropDown that it needs to call loadDropDown() to load the * drop down asynchronously before displaying it */ isLoaded(): boolean; /** * Overrides _HasDropDown.closeDropDown(). Closes the drop down (assuming that it's open). * This method is the callback when the user types ESC or clicking * the button icon while the drop down is open. It's also called by other code. */ closeDropDown(focus?: boolean): void; postMixInProperties(): void; postCreate(): void; /** * Highlights the string entered by the user in the menu. By default this * highlights the first occurrence found. Override this method * to implement your custom highlighting. */ doHighlight(label: string, find: string): string; reset(): void; labelFunc(item: T, store: any): string; set(name: 'value', value: string): this; set(name: 'item', value: T): this; set(name: 'disabled', value: boolean): this; set(name: string, value: any): this; set(values: Object): this; } /* dijit/form/_ButtonMixin */ interface _ButtonMixin { /** * A mixin to add a thin standard API wrapper to a normal HTML button */ label: string; /** * Type of button (submit, reset, button, checkbox, radio) */ type: string; postCreate(): void; /** * Callback for when button is clicked. * If type="submit", return true to perform submit, or false to cancel it. */ onClick(e: Event): boolean; onSetLabel(e: Event): void; } /* dijit/form/_CheckBoxMixin */ interface _CheckBoxMixin { /** * type attribute on `` node. * Overrides `dijit/form/Button.type`. Users should not change this value. */ type: string; /** * As an initialization parameter, equivalent to value field on normal checkbox * (if checked, the value is passed as the value when form is submitted). */ value: string; /** * Should this widget respond to user input? * In markup, this is specified as "readOnly". * Similar to disabled except readOnly form values are submitted. */ readOnly: boolean; reset: () => void; } /* dijit/form/_ComboBoxMenu */ interface _ComboBoxMenu extends _WidgetBase, _TemplatedMixin, _ListMouseMixin, _ComboBoxMenuMixin { templateString: string; baseClass: string; /** * Add hover CSS */ onHover(node: HTMLElement): void; /** * Remove hover CSS */ onUnhover(node: HTMLElement): void; /** * Add selected CSS */ onSelect(node: HTMLElement): void; /** * Remove selected CSS */ onDeselect(node: HTMLElement): void; /** * Handles page-up and page-down keypresses */ _page(up?: boolean): void; /** * Handle keystroke event forwarded from ComboBox, returning false if it's * a keystroke I recognize and process, true otherwise. */ handleKey(evt: KeyboardEvent): boolean; set(name: string, value: any): this; set(values: Object): this; } interface _ComboBoxMenuConstructor extends _WidgetBaseConstructor<_ComboBoxMenu> { new (params: Object, srcNodeRef: Node | string): _ComboBoxMenu; } /* dijit/form/_ComboBoxMenuMixin */ interface _ComboBoxMenuMixin { /** * Holds "next" and "previous" text for paging buttons on drop down */ _messages: { next: string; previous: string; }; onClick(node: HTMLElement): void; /** * Notifies ComboBox/FilteringSelect that user selected an option. */ onChange(direction: number): void; /** * Notifies ComboBox/FilteringSelect that user clicked to advance to next/previous page. */ onPage(direction: number): void; /** * Callback from dijit.popup code to this widget, notifying it that it closed */ onClose(): void; /** * Fills in the items in the drop down list */ createOptions(results: T[], options: DojoJS.QueryOptions, labelFunc: (item: T) => { html: boolean; label: string; }): void; /** * Clears the entries in the drop down list, but of course keeps the previous and next buttons. */ clearResultList(): void; /** * Highlight the first real item in the list (not Previous Choices). */ highlightFirstOption(): void; /** * Highlight the last real item in the list (not More Choices). */ highlightLastOption(): void; selectFirstNode(): void; selectLastNode(): void; getHighlightedOption(): HTMLElement; set(name: 'value', value: Object): this; set(name: string, value: any): this; set(values: Object): this; } /* dijit/form/_DateTimeTextBox */ interface DateLocaleFormatOptions { /** * choice of 'time','date' (default: date and time) */ selector?: 'time' | 'date'; /** * choice of long, short, medium or full (plus any custom additions). Defaults to 'short' */ formatLength?: 'long' | 'short' | 'medium' | 'full'; /** * override pattern with this string */ datePattern?: string; /** * override strings for am in times */ timePattern?: string; /** * override strings for pm in times */ am?: string; /** * override strings for pm in times */ pm?: string; /** * override the locale used to determine formatting rules */ locale?: string; /** * (format only) use 4 digit years whenever 2 digit years are called for */ fullYear?: boolean; /** * (parse only) strict parsing, off by default */ strict?: boolean; } interface DateTimeConstraints extends Constraints, DateLocaleFormatOptions { } interface _DateTimeTextBox extends RangeBoundTextBox, _HasDropDown { templateString: string; /** * Set this textbox to display a down arrow button, to open the drop down list. */ hasDownArrow: boolean; cssStateNodes: CSSStateNodes; /** * Despite the name, this parameter specifies both constraints on the input * (including starting/ending dates/times allowed) as well as * formatting options like whether the date is displayed in long (ex: December 25, 2005) * or short (ex: 12/25/2005) format. See `dijit/form/_DateTimeTextBox.__Constraints` for details. */ constraints: DateTimeConstraints; /** * The constraints without the min/max properties. Used by the compare() method */ _unboundedConstraints: DateTimeConstraints; pattern: (options?: DateLocaleFormatOptions | RangeBoundTextBoxConstraints) => string; /** * JavaScript namespace to find calendar routines. If unspecified, uses Gregorian calendar routines * at dojo/date and dojo/date/locale. */ datePackage: string; postMixInProperties(): void; compare(val1: Date, val2: Date): number; autoWidth: boolean; /** * Formats the value as a Date, according to specified locale (second argument) */ format: ConstrainedValueFunction; /** * Parses as string as a Date, according to constraints */ parse: ConstrainedValueFunction; serialize(val: any, options?: { /** * "date" or "time" for partial formatting of the Date object. * Both date and time will be formatted by default. */ selector?: 'time' | 'date'; /** * if true, UTC/GMT is used for a timezone */ zulu?: boolean; /** * if true, output milliseconds */ milliseconds?: boolean; }): string; /** * The default value to focus in the popupClass widget when the textbox value is empty. */ dropDownDefaultValue: Date; /** * The value of this widget as a JavaScript Date object. Use get("value") / set("value", val) to manipulate. * When passed to the parser in markup, must be specified according to `dojo/date/stamp.fromISOString()` */ value: Date; _blankValue: string; /** * Name of the popup widget class used to select a date/time. * Subclasses should specify this. */ popupClass: string | _WidgetBaseConstructor; /** * Specifies constraints.selector passed to dojo.date functions, should be either * "date" or "time". * Subclass must specify this. */ _selector: 'data' | 'time'; buildRendering(): void; /** * Runs various tests on the value, checking for invalid conditions */ _isInvalidDate(value: Date): boolean; get(name: 'displayedValue'): string; get(name: string): any; set(name: 'displayedValue', value: string): this; set(name: 'dropDownDefaultValue', value: Date): this; set(name: 'value', value: Date | string): this; set(name: 'constraints', value: DateTimeConstraints): this; set(name: string, value: any): this; set(values: Object): this; } interface _DateTimeTextBoxConstructor extends _WidgetBaseConstructor<_DateTimeTextBox> { } /* dijit/form/_ExpandingTextAreaMixin */ interface _ExpandingTextAreaMixin { postCreate(): void; startup(): void; resize(): void; } /* dijit/form/_FormMixin */ interface OnValidStateChange { (isValid?: boolean): void; } interface _FormMixin { /** * Will be "Error" if one or more of the child widgets has an invalid value, * "Incomplete" if not all of the required child widgets are filled in. Otherwise, "", * which indicates that the form is ready to be submitted. */ state: '' | 'Error' | 'Incomplete'; /** * Returns all form widget descendants, searching through non-form child widgets like BorderContainer */ _getDescendantFormWidgets(children?: _WidgetBase[]): _FormWidget[]; reset(): void; /** * returns if the form is valid - same as isValid - but * provides a few additional (ui-specific) features: * * 1. it will highlight any sub-widgets that are not valid * 2. it will call focus() on the first invalid sub-widget */ validate(): boolean; setValues(val: any): _FormMixin; getValues(): any; /** * Returns true if all of the widgets are valid. * Deprecated, will be removed in 2.0. Use get("state") instead. */ isValid(): boolean; /** * Stub function to connect to if you want to do something * (like disable/enable a submit button) when the valid * state changes on the form as a whole. * * Deprecated. Will be removed in 2.0. Use watch("state", ...) instead. */ onValidStateChange: OnValidStateChange; /** * Compute what this.state should be based on state of children */ _getState(): '' | 'Error' | 'Incomplete'; /** * Deprecated method. Applications no longer need to call this. Remove for 2.0. */ disconnectChildren(): void; /** * You can call this function directly, ex. in the event that you * programmatically add a widget to the form *after* the form has been * initialized. */ connectChildren(inStartup?: boolean): void; /** * Called when child's value or disabled state changes */ _onChildChange(attr?: string): void; startup(): void; destroy(preserveDom?: boolean): void; } interface _FormMixinConstructor extends DojoJS.DojoClass<_FormMixin> { } /* dijit/form/_FormSelectWidget */ interface SelectOption { value?: string; label: string; selected?: boolean; disabled?: boolean; } interface _FormSelectWidget extends _FormValueWidget { /** * Whether or not we are multi-valued */ multiple: boolean; /** * The set of options for our select item. Roughly corresponds to * the html `