From 131270a2bbc4e1ad03856a32d0699f218a9a7982 Mon Sep 17 00:00:00 2001 From: rorticus Date: Thu, 30 Apr 2020 11:54:44 -0400 Subject: [PATCH] Select and Standby typings (#164) * Add dijit/form/Select typings. (#80) * Add dojox/widget/Standby typings. (#150) * Fixing implicit anys Co-authored-by: hparkertt --- dijit/1.11/form.d.ts | 96 +++++++++++++++++++++++++++++++++++++++++ dijit/1.11/modules.d.ts | 6 +++ dojox/1.11/modules.d.ts | 6 +++ dojox/1.11/widget.d.ts | 91 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 199 insertions(+) diff --git a/dijit/1.11/form.d.ts b/dijit/1.11/form.d.ts index 3aa53ab..4257197 100644 --- a/dijit/1.11/form.d.ts +++ b/dijit/1.11/form.d.ts @@ -1682,6 +1682,102 @@ declare namespace dijit { interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor { } + /* dijit/form/Select */ + + interface Select extends _FormSelectWidget, _HasDropDown, _KeyNavMixin { + baseClass: string; + + /** + * What to display in an "empty" drop down. + */ + emptyLabel: string; + + /** + * Specifies how to interpret the labelAttr in the data store items. + */ + labelType: string; + + /** + * Currently displayed error/prompt message + */ + message: string; + + /** + * Can be true or false, default is false. + */ + required: boolean; + + /** + * "Incomplete" if this select is required but unset (i.e. blank value), "" otherwise + */ + state: string; + + /** + * Order fields are traversed when user hits the tab key + */ + tabIndex: any; + templateString: any; + + /** + * See the description of dijit/Tooltip.defaultPosition for details on this parameter. + */ + tooltipPosition: any; + + childSelector(node: Element | Node): boolean; + destroy(preserveDom: boolean): void; + focus(): void; + + /** + * Sets the value to the given option, used during search by letter. + * @param widget Reference to option's widget + */ + focusChild(widget: dijit._WidgetBase): void; + isLoaded(): boolean; + + /** + * Whether or not this is a valid value. + * @param isFocused + */ + isValid(isFocused: boolean): boolean; + + /** + * populates the menu + * @param loadCallback + */ + loadDropDown(loadCallback: () => any): void; + postCreate(): void; + + /** + * set the missing message + */ + postMixInProperties(): void; + + /** + * Overridden so that the state will be cleared. + */ + reset(): void; + startup(): void; + + /** + * Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes + * @param isFocused + */ + validate(isFocused: boolean): boolean; + + /** + * When a key is pressed that matches a child item, + * this method is called so that a widget can take + * appropriate action is necessary. + * @param item + * @param evt + * @param searchString + * @param numMatches + */ + onKeyboardSearch(item: dijit._WidgetBase, evt: Event, searchString: string, numMatches: number): void; + } + + interface SelectConstructor extends _WidgetBaseConstructor> { } + /* dijit/form/SimpleTextarea */ interface SimpleTextarea extends TextBox { diff --git a/dijit/1.11/modules.d.ts b/dijit/1.11/modules.d.ts index 6d90723..2f745ca 100644 --- a/dijit/1.11/modules.d.ts +++ b/dijit/1.11/modules.d.ts @@ -366,6 +366,12 @@ declare module 'dijit/form/RangeBoundTextBox' { export = RangeBoundTextBox; } +declare module 'dijit/form/Select' { + type Select = dijit.form.Select; + const Select: dijit.form.SelectConstructor; + export = Select; +} + declare module 'dijit/form/SimpleTextarea' { type SimpleTextarea = dijit.form.SimpleTextarea; const SimpleTextarea: dijit.form.SimpleTextareaConstructor; diff --git a/dojox/1.11/modules.d.ts b/dojox/1.11/modules.d.ts index 88b9bad..32d0e99 100644 --- a/dojox/1.11/modules.d.ts +++ b/dojox/1.11/modules.d.ts @@ -47,3 +47,9 @@ declare module 'dojox/widget/Toaster' { const Toaster: dojox.widget.ToasterConstructor; export = Toaster; } + +declare module 'dojox/widget/Standby' { + type Standby = dojox.widget.Standby; + const Standby: dojox.widget.StandbyConstructor; + export = Standby; +} diff --git a/dojox/1.11/widget.d.ts b/dojox/1.11/widget.d.ts index e497519..4c54d68 100644 --- a/dojox/1.11/widget.d.ts +++ b/dojox/1.11/widget.d.ts @@ -120,5 +120,96 @@ declare namespace dojox { } interface ToasterConstructor extends dijit._WidgetBaseConstructor {} + + interface Standby extends dijit._Widget, dijit._TemplatedMixin { + + /** + * Property to define if the image and its alt text should be used, or a simple Text/HTML noe should be used. + */ + centerIndicator: string; + + /** + * The color to set the overlay. + */ + color: string; + + /** + * Integer defining how long the show and hide effects should take in milliseconds. + */ + duration: number; + + /** + * A URL to an image to center within the blocking overlay. + */ + image: string; + + /** + * Text to set on the ALT tag of the image. + */ + imageText: string; + + /** + * The opacity to make the overlay when it is displayed/faded in. + */ + opacity: number; + + /** + * The target to overlay when active. + */ + target: string; + + /** + * The template string defining out the basics of the widget. + */ + templateString: string; + + /** + * Text/HTML to display in the center of the overlay This is used if image center is disabled. + */ + text: string; + + /** + * Control that lets you specify if the zIndex for the overlay shold be auto-computed based off parent zIndex, or should be set to a particular value. + */ + zIndex: string; + + /** + * Function to hide the blocking overlay and status icon or text. + */ + hide(): void; + + /** + * Helper function so you can test if the widget is already visible or not. + */ + isVisible(): boolean; + + /** + * Function to display the blocking overlay and busy/status icon or text. + */ + show(): void; + + /** + * Over-ride of the basic widget startup function. + * @param args + */ + startup(): void; + + /** + * Over-ride to hide the widget, which clears intervals, before cleanup. + */ + uninitialize(): boolean; + + /** + * Event that fires when the display of the Standby completes. + */ + onHide(): void; + + /** + * Event that fires when the display of the Standby completes. + */ + onShow(): void; + } + + interface StandbyConstructor extends dijit._WidgetBaseConstructor { } } }