Skip to content

Commit

Permalink
Add dijit/form/Select typings. (dojo#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
hparkertt committed May 3, 2019
1 parent cdd3248 commit 3374072
Show file tree
Hide file tree
Showing 2 changed files with 102 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);
destroy(preserveDom);
focus();

/**
* Sets the value to the given option, used during search by letter.
* @param widget Reference to option's widget
*/
focusChild(widget: dijit._WidgetBase);
isLoaded();

/**
* Whether or not this is a valid value.
* @param isFocused
*/
isValid(isFocused: boolean);

/**
* populates the menu
* @param loadCallback
*/
loadDropDown(loadCallback: () => any);
postCreate();

/**
* set the missing message
*/
postMixInProperties();

/**
* Overridden so that the state will be cleared.
*/
reset();
startup();

/**
* Called by oninit, onblur, and onkeypress, and whenever required/disabled state changes
* @param isFocused
*/
validate(isFocused: 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);
}

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

0 comments on commit 3374072

Please sign in to comment.