Skip to content

Commit

Permalink
Select and Standby typings (#164)
Browse files Browse the repository at this point in the history
* Add dijit/form/Select typings. (#80)

* Add dojox/widget/Standby typings. (#150)

* Fixing implicit anys

Co-authored-by: hparkertt <[email protected]>
  • Loading branch information
rorticus and hparkertt authored Apr 30, 2020
1 parent 2a09f3a commit 131270a
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 0 deletions.
96 changes: 96 additions & 0 deletions dijit/1.11/form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1682,6 +1682,102 @@ declare namespace dijit {

interface RangeBoundTextBoxConstructor extends _WidgetBaseConstructor<RangeBoundTextBox> { }

/* dijit/form/Select */

interface Select<T extends Object, Q extends dojo.store.api.BaseQueryType, O extends dojo.store.api.QueryOptions, U extends dijit._WidgetBase> extends _FormSelectWidget<T, Q, O>, _HasDropDown<U>, _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<Select<any, any, any, any>> { }

/* dijit/form/SimpleTextarea */

interface SimpleTextarea extends TextBox {
Expand Down
6 changes: 6 additions & 0 deletions dijit/1.11/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ declare module 'dijit/form/RangeBoundTextBox' {
export = RangeBoundTextBox;
}

declare module 'dijit/form/Select' {
type Select<T, Q, O, U extends dijit._WidgetBase> = dijit.form.Select<T, Q, O, U>;
const Select: dijit.form.SelectConstructor;
export = Select;
}

declare module 'dijit/form/SimpleTextarea' {
type SimpleTextarea = dijit.form.SimpleTextarea;
const SimpleTextarea: dijit.form.SimpleTextareaConstructor;
Expand Down
6 changes: 6 additions & 0 deletions dojox/1.11/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
91 changes: 91 additions & 0 deletions dojox/1.11/widget.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,96 @@ declare namespace dojox {
}

interface ToasterConstructor extends dijit._WidgetBaseConstructor<Toaster> {}

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<Standby> { }
}
}

0 comments on commit 131270a

Please sign in to comment.