| @@ -0,0 +1,33 | |||||
| 
             | 
        1 | # dojo-typings | |||
| 
             | 
        2 | ||||
| 
             | 
        3 | This project is forked from the original `dojo-typings` package to | |||
| 
             | 
        4 | improve it with more tight and customizable type definitions. | |||
| 
             | 
        5 | ||||
| 
             | 
        6 | The primary aims are | |||
| 
             | 
        7 | ||||
| 
             | 
        8 | * Parametrize collections with items type. | |||
| 
             | 
        9 | * Distinguish sync and async methods in stores. | |||
| 
             | 
        10 | * Parametrize widget typings with event and attribute maps. | |||
| 
             | 
        11 | ||||
| 
             | 
        12 | ## Changes | |||
| 
             | 
        13 | ||||
| 
             | 
        14 | ### 1.0.1 | |||
| 
             | 
        15 | ||||
| 
             | 
        16 | Maintenance release | |||
| 
             | 
        17 | ||||
| 
             | 
        18 | * `NodeList-fx` added overloads to all methods to distinguish returned values | |||
| 
             | 
        19 | of different types (`Animation | this`). | |||
| 
             | 
        20 | * Added missing signatures to `NodeList` constructor | |||
| 
             | 
        21 | * Improved `dijit.form._FormWidgetMixin` | |||
| 
             | 
        22 | * Added module declarations `dijit/form/_FormWidgetMixin`, | |||
| 
             | 
        23 | `dijit/form/_FormValueMixin`, `dijit/_HasDropDown` | |||
| 
             | 
        24 | ||||
| 
             | 
        25 | ### 1.0.0 | |||
| 
             | 
        26 | ||||
| 
             | 
        27 | Initial release | |||
| 
             | 
        28 | ||||
| 
             | 
        29 | * Parametrized `dojo/Stateful`, `diji/_WidgetBase` | |||
| 
             | 
        30 | * split `dojo.store.api.Store` in two `SyncStore` and `AsyncStore` interfaces | |||
| 
             | 
        31 | * `dojo/store/Memory` implements `SyncStore` and can be used synchronously, | |||
| 
             | 
        32 | * `dojo/store/Rest` implements `AsyncStore` and all its methods are | |||
| 
             | 
        33 | returning explicit promises. | |||
| @@ -0,0 +1,8 | |||||
| 
             | 
        1 | import "dojo/NodeList-fx"; | |||
| 
             | 
        2 | ||||
| 
             | 
        3 | declare const nl: dojo.NodeList<Node>; | |||
| 
             | 
        4 | ||||
| 
             | 
        5 | const anim: dojo._base.Animation = nl.fadeIn(); | |||
| 
             | 
        6 | const anim2: dojo._base.Animation = nl.fadeIn({duration: 500}); | |||
| 
             | 
        7 | const nl2: typeof nl = nl.fadeOut({auto: true, onEnd: () => {}}); | |||
| 
             | 
        8 | const other = nl.fadeOut({auto: false}); No newline at end of file | |||
| @@ -729,83 +729,88 declare namespace dijit { | |||||
| 729 | 
             | 
        729 | |||
| 730 | 
            
             | 
        
             | 
        730 | /* dijit/form/_FormWidgetMixin */ | |
| 731 | 
             | 
        731 | |||
| 
             | 
        732 | /** | |||
| 
             | 
        733 | * Mixin for widgets corresponding to native HTML elements such as `<checkbox>` or `<button>`, | |||
| 
             | 
        734 | * which can be children of a `<form>` node or a `dijit/form/Form` widget. | |||
| 
             | 
        735 | * | |||
| 
             | 
        736 | * Represents a single HTML element. | |||
| 
             | 
        737 | * All these widgets should have these attributes just like native HTML input elements. | |||
| 
             | 
        738 | * You can set them during widget construction or afterwards, via `dijit/_WidgetBase.set()`. | |||
| 
             | 
        739 | * | |||
| 
             | 
        740 | * They also share some common methods. | |||
| 
             | 
        741 | */ | |||
| 732 | 
            
             | 
        
             | 
        742 | interface _FormWidgetMixin { | |
| 733 | /** | 
             | 
        743 | /** | |
| 734 | 
            
             | 
        
             | 
        744 | * Name used when submitting form; same as "name" attribute or plain HTML elements | |
| 735 | */ | 
             | 
        745 | */ | |
| 736 | 
            
             | 
        
             | 
        746 | name: string; | |
| 737 | 
             | 
        747 | |||
| 738 | /** | 
             | 
        748 | ||
| 739 | 
            
             | 
        
             | 
        749 | /** Corresponds to the native HTML `<input>` element's attribute. */ | |
| 740 | */ | 
             | 
        |||
| 741 | 
            
             | 
        
             | 
        750 | alt: string; | |
| 742 | 
             | 
        751 | |||
| 743 | /** | 
             | 
        752 | /** Corresponds to the native HTML `<input>` element's attribute. */ | |
| 744 | * Corresponds to the native HTML `<input>` element's attribute. | 
             | 
        |||
| 745 | */ | 
             | 
        |||
| 746 | value: any; | 
             | 
        753 | value: any; | |
| 747 | 
             | 
        754 | |||
| 748 | /** | 
             | 
        755 | /** Corresponds to the native HTML `<input>` element's attribute. */ | |
| 749 | * Corresponds to the native HTML `<input>` element's attribute. | 
             | 
        |||
| 750 | */ | 
             | 
        |||
| 751 | 
            
             | 
        
             | 
        756 | type: string; | |
| 752 | 
             | 
        757 | |||
| 753 | /** | 
             | 
        758 | /** Apply aria-label in markup to the widget's focusNode */ | |
| 754 | * Apply aria-label in markup to the widget's focusNode | 
             | 
        759 | "aria-label": "focusNode"; | |
| 755 | */ | 
             | 
        |||
| 756 | 'aria-label': string; | 
             | 
        |||
| 757 | 
             | 
        760 | |||
| 758 | /** | 
             | 
        761 | /** Order fields are traversed when user hits the tab key */ | |
| 759 | * Order fields are traversed when user hits the tab key | 
             | 
        |||
| 760 | */ | 
             | 
        |||
| 761 | 
            
             | 
        
             | 
        762 | tabIndex: number; | |
| 762 | 
             | 
        763 | |||
| 763 | /** | 
             | 
        764 | /** Should this widget respond to user input? | |
| 764 | * Should this widget respond to user input? | 
             | 
        |||
| 765 | 
            
             | 
        
             | 
        765 | * In markup, this is specified as "disabled='disabled'", or just "disabled". | |
| 766 | */ | 
             | 
        766 | */ | |
| 767 | 
            
             | 
        
             | 
        767 | disabled: boolean; | |
| 768 | 
             | 
        768 | |||
| 769 | /** | 
             | 
        769 | /** Fires onChange for each value change or only on demand */ | |
| 770 | * Fires onChange for each value change or only on demand | 
             | 
        |||
| 771 | */ | 
             | 
        |||
| 772 | 
            
             | 
        
             | 
        770 | intermediateChanges: boolean; | |
| 773 | 
             | 
        771 | |||
| 774 | /** | 
             | 
        772 | /** On focus, should this widget scroll into view? */ | |
| 775 | * On focus, should this widget scroll into view? | 
             | 
        |||
| 776 | */ | 
             | 
        |||
| 777 | 
            
             | 
        
             | 
        773 | scrollOnFocus: boolean; | |
| 778 | 
             | 
        774 | |||
| 779 | /** | 
             | 
        775 | _setDisabledAttr(value: boolean): void; | |
| 780 | * Tells if this widget is focusable or not. Used internally by dijit. | 
             | 
        776 | ||
| 
             | 
        777 | _onFocus(by: string): void; | |||
| 
             | 
        778 | ||||
| 
             | 
        779 | /** Tells if this widget is focusable or not. Used internally by dijit. | |||
| 
             | 
        780 | * @protected | |||
| 781 | */ | 
             | 
        781 | */ | |
| 782 | 
            
             | 
        
             | 
        782 | isFocusable(): boolean; | |
| 783 | 
             | 
        783 | |||
| 784 | /** | 
             | 
        784 | /** Put focus on this widget */ | |
| 785 | * Put focus on this widget | 
             | 
        |||
| 786 | */ | 
             | 
        |||
| 787 | 
            
             | 
        
             | 
        785 | focus(): void; | |
| 788 | 
             | 
        786 | |||
| 789 | /** | 
             | 
        787 | /** Compare 2 values (as returned by get('value') for this widget). | |
| 790 | * Compare 2 values (as returned by get('value') for this widget). | 
             | 
        788 | * @protected | |
| 791 | */ | 
             | 
        789 | */ | |
| 792 | 
            
             | 
        
             | 
        790 | compare(val1: any, val2: any): number; | |
| 793 | 
             | 
        791 | |||
| 794 | /** | 
             | 
        792 | onChange(newValue: any): void; | |
| 795 | * Callback when this widget's value is changed. | 
             | 
        |||
| 796 | */ | 
             | 
        |||
| 797 | onChange(value: string): void; | 
             | 
        |||
| 798 | 
             | 
        793 | |||
| 799 | /** | 
             | 
        794 | /** | |
| 800 | * Overrides _Widget.create() | 
             | 
        795 | * Hook so set('value', value) works. | |
| 
             | 
        796 | * | |||
| 
             | 
        797 | * Sets the value of the widget. | |||
| 
             | 
        798 | * If the value has changed, then fire onChange event, unless priorityChange | |||
| 
             | 
        799 | * is specified as null (or false?) | |||
| 
             | 
        800 | * | |||
| 
             | 
        801 | * @param value | |||
| 
             | 
        802 | * @param priorityChange | |||
| 801 | */ | 
             | 
        803 | */ | |
| 802 | create(params?: any, srcNodeRef?: HTMLElement): void; | 
             | 
        804 | _setValueAttr(value: any, priorityChange?: boolean); | |
| 803 | 
             | 
        805 | |||
| 804 | destroy(preserveDom?: boolean): void; | 
             | 
        806 | /** | |
| 805 | 
             | 
        807 | * Called when the value of the widget has changed. Saves the new value in this.value, | ||
| 806 | // set(name: 'disabled', value: boolean): this; | 
             | 
        808 | * and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details. | |
| 807 | // set(name: string, value: any): this; | 
             | 
        809 | * | |
| 808 | // set(values: Object): this; | 
             | 
        810 | * @param newValue | |
| 
             | 
        811 | * @param priorityChange | |||
| 
             | 
        812 | */ | |||
| 
             | 
        813 | _handleOnChange(newValue: any, priorityChange?: boolean); | |||
| 809 | } | 
             | 
        814 | } | |
| 810 | 
             | 
        815 | |||
| 811 | 
            
             | 
        
             | 
        816 | /* dijit/form/_ListBase */ | |
| @@ -1807,15 +1812,7 declare namespace dijit { | |||||
| 1807 | 
            
             | 
        
             | 
        1812 | /* dijit/form/TextBox */ | |
| 1808 | 
             | 
        1813 | |||
| 1809 | 
            
             | 
        
             | 
        1814 | interface TextBox extends _FormValueWidget, _TextBoxMixin<Constraints> { | |
| 1810 | // set(name: 'displayedValue', value: string): this; | 
             | 
        |||
| 1811 | // set(name: 'disabled', value: boolean): this; | 
             | 
        |||
| 1812 | // set(name: 'value', value: string): this; | 
             | 
        |||
| 1813 | // set(name: string, value: any): this; | 
             | 
        |||
| 1814 | // set(values: Object): this; | 
             | 
        |||
| 1815 | 
            
             | 
        
             | 
        1815 | ||
| 1816 | // get(name: 'displayedValue'): string; | 
             | 
        |||
| 1817 | // get(name: 'value'): string; | 
             | 
        |||
| 1818 | // get(name: string): any; | 
             | 
        |||
| 1819 | } | 
             | 
        1816 | } | |
| 1820 | 
             | 
        1817 | |||
| 1821 | 
            
             | 
        
             | 
        1818 | interface TextBoxConstructor extends _WidgetBaseConstructor<TextBox> { } | |
| @@ -1826,10 +1823,6 declare namespace dijit { | |||||
| 1826 | 
            
             | 
        
             | 
        1823 | baseClass: string; | |
| 1827 | 
             | 
        1824 | |||
| 1828 | 
            
             | 
        
             | 
        1825 | setChecked(checked: boolean): void; | |
| 1829 | 
             | 
        ||||
| 1830 | // set(name: 'checked', value: boolean): this; | 
             | 
        |||
| 1831 | // set(name: string, value: any): this; | 
             | 
        |||
| 1832 | // set(values: Object): this; | 
             | 
        |||
| 1833 | } | 
             | 
        1826 | } | |
| 1834 | 
             | 
        1827 | |||
| 1835 | 
            
             | 
        
             | 
        1828 | interface ToggleButtonConstructor extends _WidgetBaseConstructor<ToggleButton> { } | |
| @@ -1866,20 +1859,6 declare namespace dijit { | |||||
| 1866 | 
            
             | 
        
             | 
        1859 | reset(): void; | |
| 1867 | 
             | 
        1860 | |||
| 1868 | 
            
             | 
        
             | 
        1861 | destroy(preserveDom?: boolean): void; | |
| 1869 | 
             | 
        ||||
| 1870 | // set(name: 'constraints', value: Constraints): this; | 
             | 
        |||
| 1871 | // set(name: 'disabled', value: boolean): this; | 
             | 
        |||
| 1872 | // set(name: 'message', value: string): this; | 
             | 
        |||
| 1873 | // set(name: 'pattern', value: string | ConstraintsToRegExpString<C>): this; | 
             | 
        |||
| 1874 | // set(name: 'regExp', value: string): this; | 
             | 
        |||
| 1875 | // set(name: 'regExpGen', value: Constraints): this; | 
             | 
        |||
| 1876 | // set(name: 'required', value: boolean): this; | 
             | 
        |||
| 1877 | // set(name: 'value', value: string): this; | 
             | 
        |||
| 1878 | // set(name: string, value: any): this; | 
             | 
        |||
| 1879 | // set(values: Object): this; | 
             | 
        |||
| 1880 | 
             | 
        ||||
| 1881 | // get(name: 'pattern'): string | ConstraintsToRegExpString<C>; | 
             | 
        |||
| 1882 | // get(name: string): any; | 
             | 
        |||
| 1883 | } | 
             | 
        1862 | } | |
| 1884 | 
             | 
        1863 | |||
| 1885 | 
            
             | 
        
             | 
        1864 | interface ValidationTextBoxConstructor extends _WidgetBaseConstructor<ValidationTextBox<Constraints>> { | |
| @@ -102,6 +102,13 declare module 'dijit/Dialog' { | |||||
| 102 | export = Dialog; | 
             | 
        102 | export = Dialog; | |
| 103 | } | 
             | 
        103 | } | |
| 104 | 
             | 
        104 | |||
| 
             | 
        105 | declare module "dijit/_HasDropDown" { | |||
| 
             | 
        106 | type _HasDropDown<T extends dijit._WidgetBase = dijit._WidgetBase> = dijit._HasDropDown<T>; | |||
| 
             | 
        107 | const _HasDropDown: dijit._WidgetBaseConstructor<_HasDropDown>; | |||
| 
             | 
        108 | ||||
| 
             | 
        109 | export = _HasDropDown; | |||
| 
             | 
        110 | } | |||
| 
             | 
        111 | ||||
| 105 | declare module 'dijit/DropDownMenu' { | 
             | 
        112 | declare module 'dijit/DropDownMenu' { | |
| 106 | type DropDownMenu = dijit.DropDownMenu; | 
             | 
        113 | type DropDownMenu = dijit.DropDownMenu; | |
| 107 | const DropDownMenu: dijit.DropDownMenuConstructor; | 
             | 
        114 | const DropDownMenu: dijit.DropDownMenuConstructor; | |
| @@ -252,6 +259,18 declare module 'dijit/form/_FormMixin' { | |||||
| 252 | export = _FormMixin; | 
             | 
        259 | export = _FormMixin; | |
| 253 | } | 
             | 
        260 | } | |
| 254 | 
             | 
        261 | |||
| 
             | 
        262 | declare module "dijit/form/_FormWidgetMixin" { | |||
| 
             | 
        263 | type _FormWidgetMixin = dijit.form._FormWidgetMixin; | |||
| 
             | 
        264 | const _FormWidgetMixin: dijit._WidgetBaseConstructor<_FormWidgetMixin>; | |||
| 
             | 
        265 | export = _FormWidgetMixin; | |||
| 
             | 
        266 | } | |||
| 
             | 
        267 | ||||
| 
             | 
        268 | declare module "dijit/form/_FormValueMixin" { | |||
| 
             | 
        269 | type _FormValueMixin = dijit.form._FormValueMixin; | |||
| 
             | 
        270 | const _FormValueMixin: dijit._WidgetBaseConstructor<_FormValueMixin>; | |||
| 
             | 
        271 | export = _FormValueMixin; | |||
| 
             | 
        272 | } | |||
| 
             | 
        273 | ||||
| 255 | declare module 'dijit/form/_FormValueWidget' { | 
             | 
        274 | declare module 'dijit/form/_FormValueWidget' { | |
| 256 | type _FormValueWidget = dijit.form._FormValueWidget; | 
             | 
        275 | type _FormValueWidget = dijit.form._FormValueWidget; | |
| 257 | const _FormValueWidget: dijit.form._FormValueWidgetConstructor; | 
             | 
        276 | const _FormValueWidget: dijit.form._FormValueWidgetConstructor; | |
| @@ -4,43 +4,55 | |||||
| 4 | 
             | 
        4 | |||
| 5 | declare namespace dojo { | 
             | 
        5 | declare namespace dojo { | |
| 6 | 
             | 
        6 | |||
| 7 | 
            
             | 
        
             | 
        7 | interface NodeListAnimationArgs extends Omit<_base.AnimationArguments, "node"> { | |
| 8 | auto?: boolean; | 
             | 
        8 | auto?: false; | |
| 
             | 
        9 | } | |||
| 
             | 
        10 | ||||
| 
             | 
        11 | interface NodeListAutoAnimationArgs extends Omit<_base.AnimationArguments, "node"> { | |||
| 
             | 
        12 | auto: true; | |||
| 9 | } | 
             | 
        13 | } | |
| 10 | 
             | 
        14 | |||
| 11 | 
            
             | 
        
             | 
        15 | interface NodeList<T extends Node> { | |
| 12 | _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation | this; | 
             | 
        16 | ||
| 
             | 
        17 | _anim(obj: any, method: string, args?: NodeListAnimationArgs): _base.Animation; | |||
| 
             | 
        18 | _anim(obj: any, method: string, args: NodeListAutoAnimationArgs): this; | |||
| 13 | 
             | 
        19 | |||
| 14 | /** | 
             | 
        20 | /** | |
| 15 | 
            
             | 
        
             | 
        21 | * wipe in all elements of this NodeList via `dojo/fx.wipeIn()` | |
| 16 | */ | 
             | 
        22 | */ | |
| 17 | 
            
             | 
        
             | 
        23 | wipeIn(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        24 | wipeIn(args: NodeListAutoAnimationArgs): this; | |||
| 18 | 
             | 
        25 | |||
| 19 | /** | 
             | 
        26 | /** | |
| 20 | 
            
             | 
        
             | 
        27 | * wipe out all elements of this NodeList via `dojo/fx.wipeOut()` | |
| 21 | */ | 
             | 
        28 | */ | |
| 22 | 
            
             | 
        
             | 
        29 | wipeOut(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        30 | wipeOut(args: NodeListAutoAnimationArgs): this; | |||
| 23 | 
             | 
        31 | |||
| 24 | /** | 
             | 
        32 | /** | |
| 25 | 
            
             | 
        
             | 
        33 | * slide all elements of the node list to the specified place via `dojo/fx.slideTo()` | |
| 26 | */ | 
             | 
        34 | */ | |
| 27 | 
            
             | 
        
             | 
        35 | slideTo(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        36 | slideTo(args: NodeListAutoAnimationArgs): this; | |||
| 28 | 
             | 
        37 | |||
| 29 | /** | 
             | 
        38 | /** | |
| 30 | 
            
             | 
        
             | 
        39 | * fade in all elements of this NodeList via `dojo.fadeIn` | |
| 31 | */ | 
             | 
        40 | */ | |
| 32 | 
            
             | 
        
             | 
        41 | fadeIn(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        42 | fadeIn(args: NodeListAutoAnimationArgs): this; | |||
| 33 | 
             | 
        43 | |||
| 34 | /** | 
             | 
        44 | /** | |
| 35 | 
            
             | 
        
             | 
        45 | * fade out all elements of this NodeList via `dojo.fadeOut` | |
| 36 | */ | 
             | 
        46 | */ | |
| 37 | 
            
             | 
        
             | 
        47 | fadeOut(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        48 | fadeOut(args: NodeListAutoAnimationArgs): this; | |||
| 38 | 
             | 
        49 | |||
| 39 | /** | 
             | 
        50 | /** | |
| 40 | 
            
             | 
        
             | 
        51 | * Animate all elements of this NodeList across the properties specified. | |
| 41 | 
            
             | 
        
             | 
        52 | * syntax identical to `dojo.animateProperty` | |
| 42 | */ | 
             | 
        53 | */ | |
| 43 | 
            
             | 
        
             | 
        54 | animateProperty(args?: NodeListAnimationArgs): _base.Animation; | |
| 
             | 
        55 | animateProperty(args: NodeListAutoAnimationArgs): this; | |||
| 44 | 
             | 
        56 | |||
| 45 | /** | 
             | 
        57 | /** | |
| 46 | 
            
             | 
        
             | 
        58 | * Animate one or more CSS properties for all nodes in this list. | |
| @@ -1726,9 +1726,9 declare namespace dojo { | |||||
| 1726 | } | 
             | 
        1726 | } | |
| 1727 | 
             | 
        1727 | |||
| 1728 | interface NodeListConstructor { | 
             | 
        1728 | interface NodeListConstructor { | |
| 1729 | new <T extends Node>(array: number | Array<T>): NodeList<T>; | 
             | 
        1729 | new <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>; | |
| 1730 | new <T extends Node>(...args: T[]): NodeList<T>; | 
             | 
        1730 | new <T extends Node>(...args: T[]): NodeList<T>; | |
| 1731 | <T extends Node>(array: number | Array<T>): NodeList<T>; | 
             | 
        1731 | <T extends Node>(array: number | Array<T> | NodeListOf<T>): NodeList<T>; | |
| 1732 | <T extends Node>(...args: T[]): NodeList<T>; | 
             | 
        1732 | <T extends Node>(...args: T[]): NodeList<T>; | |
| 1733 | 
             | 
        1733 | |||
| 1734 | prototype: NodeList<any>; | 
             | 
        1734 | prototype: NodeList<any>; | |
| @@ -1770,6 +1770,9 declare namespace dojo { | |||||
| 1770 | * the search by. Returns an instance of NodeList. | 
             | 
        1770 | * the search by. Returns an instance of NodeList. | |
| 1771 | */ | 
             | 
        1771 | */ | |
| 1772 | <T extends Node>(query: string, root?: NodeOrString): NodeList<T>; | 
             | 
        1772 | <T extends Node>(query: string, root?: NodeOrString): NodeList<T>; | |
| 
             | 
        1773 | <T extends Node>(root: Node): NodeList<T>; | |||
| 
             | 
        1774 | ||||
| 
             | 
        1775 | NodeList: NodeListConstructor; | |||
| 1773 | 
             | 
        1776 | |||
| 1774 | /** | 
             | 
        1777 | /** | |
| 1775 | * Test to see if a node matches a selector | 
             | 
        1778 | * Test to see if a node matches a selector | |
        
        General Comments 0
    
    
  
  
                      You need to be logged in to leave comments.
                      Login now
                    
                