From 5afc680bd0fc76c5a1419a2d1f4446aecd8b3534 Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Tue, 13 Dec 2016 13:42:35 +0100 Subject: [PATCH 1/5] Remove gitigore to keep tsconfig.json --- uikit/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 uikit/.gitignore diff --git a/uikit/.gitignore b/uikit/.gitignore deleted file mode 100644 index 7c794a3533..0000000000 --- a/uikit/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -tsconfig.json -.idea/ \ No newline at end of file From d971501f0089154a43cafcb5efb2aec525d550c4 Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Tue, 13 Dec 2016 13:49:23 +0100 Subject: [PATCH 2/5] Increase version number --- uikit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uikit/index.d.ts b/uikit/index.d.ts index 3c2f8ceb73..3bb6087bb7 100644 --- a/uikit/index.d.ts +++ b/uikit/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for uikit 2.23.0 +// Type definitions for uikit 2.27.2 // Project: http://getuikit.org // Definitions by: Giovanni Silva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From d87badd90939de5669625fb1e6c21b80b25ad353 Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Tue, 13 Dec 2016 14:09:53 +0100 Subject: [PATCH 3/5] Update type definitions for UIkit.Modal --- uikit/index.d.ts | 70 ++++++++++++++++++++++++++++++++++++-------- uikit/uikit-tests.ts | 17 +++++++++-- 2 files changed, 72 insertions(+), 15 deletions(-) diff --git a/uikit/index.d.ts b/uikit/index.d.ts index 3bb6087bb7..7c04863cca 100644 --- a/uikit/index.d.ts +++ b/uikit/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for uikit 2.27.2 // Project: http://getuikit.org -// Definitions by: Giovanni Silva +// Definitions by: Giovanni Silva , Ivo Senner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -21,6 +21,43 @@ declare namespace UIkit { */ isActive(): boolean } + interface ModalOptions { + /** + * Allows controls from keyboard (ESC to close) + * @default true + *

Possible value

+ * boolean + */ + keyboard?: boolean + /** + * Allow modal to close automatically when clicking on the modal overlay + * @default true + *

Possible value

+ * boolean + */ + bgclose?: boolean + /** + * Set the height for overflow container to start scrolling + * @default 150 + *

Possible value

+ * integer + */ + minScrollHeight?: number + /** + * Vertically center the modal + * @default false + *

Possible value

+ * boolean + */ + center?: boolean + /** + * Close currently opened modals on opening modal + * @default true + *

Possible value

+ * boolean + */ + modal?: boolean + } /** * Create modal dialogs with different styles and transitions * Documentation: {@link http://getuikit.org/docs/modal.html} @@ -66,31 +103,40 @@ declare namespace UIkit { */ alert(message:string): void /** - * Create a confirm dialog and execute the function on positive confirmation + * Create a confirm dialog * @param {string} message The message to display. Can be Html - * @param {function} fn A function to execute on confirmation + * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - confirm(message:string, fn:() => any): void + confirm(message: string, options?: ModalOptions): void /** - * Create a prompt dialog, where the user enter information + * Create a confirm dialog and execute onconfirm on confirmation * @param {string} message The message to display. Can be Html - * @param {function} fn A function to execute on confirmation. The function - * receive the new value as a parameter + * @param {function} onconfirm A function to execute on confirmation + * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - prompt(message:string, fn:(newValue:string) => any): void + confirm(message:string, onconfirm:() => any, options?:ModalOptions): void + /** + * Create a confirm dialog and execute onconfirm on confirmation and oncancel on cancelation. + * @param {string} message The message to display. Can be Html + * @param {function} onconfirm A function to execute on confirmation + * @param {function} oncancel A function to execute on cancelation + * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options + */ + confirm(message:string, onconfirm:() => any, oncancel?:() => any, options?:ModalOptions): void /** * Create a prompt dialog, where the user enter information * @param {string} message The message to display. Can be Html * @param {string} value A value to init the input - * @param {function} fn A function to execute on confirmation. The function - * receive the new value as a parameter + * @param {function} fn A function to execute on submission. The function receive the new value as a parameter + * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - prompt(message:string, value:string, fn:(newValue:string) => any): void + prompt(message:string, value:string, onsubmit?:(newValue:string) => any, options?:ModalOptions): void /** * Create a modal that blocks the entire page * @param {string} content A content to display. Can be Html + * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - blockUI(content:string): ModalElement + blockUI(content:string, options?:ModalOptions): ModalElement /** * Select a modal element on page and return it. * @example diff --git a/uikit/uikit-tests.ts b/uikit/uikit-tests.ts index 402ae18d2f..8b634edc33 100644 --- a/uikit/uikit-tests.ts +++ b/uikit/uikit-tests.ts @@ -2,9 +2,20 @@ function testModal() { UIkit.modal.alert("Attention!"); - UIkit.modal.confirm("Are you sure?", function () { - // will be executed on confirm. - }); + + let options: UIkit.ModalOptions = { + keyboard: true, + bgclose: true, + minScrollHeight: 150, + center: false, + modal: true + }; + UIkit.modal.confirm("Are you sure?", () => {}); + UIkit.modal.confirm("Are you sure?", () => {}, {}); + UIkit.modal.confirm("Are you sure?", () => {}, () => {}); + UIkit.modal.confirm("Are you sure?", () => {}, () => {}, {}); + UIkit.modal.confirm("Are you sure?", () => {}, {}); + UIkit.modal.prompt("Name:", 'value', function (newvalue:string) { // will be executed on submit. }); From ce7d989b7d3f7c317b6f68caa62381fe449570ca Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Tue, 13 Dec 2016 15:08:32 +0100 Subject: [PATCH 4/5] Add tsconfig.json and tslint.json --- uikit/tsconfig.json | 19 +++++++++++++++++++ uikit/tslint.json | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 uikit/tsconfig.json create mode 100644 uikit/tslint.json diff --git a/uikit/tsconfig.json b/uikit/tsconfig.json new file mode 100644 index 0000000000..9c36affeab --- /dev/null +++ b/uikit/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "uikit-tests.ts" + ] +} diff --git a/uikit/tslint.json b/uikit/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/uikit/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From 9b5404d3c38d561de55e903e5d9ecc81441913d0 Mon Sep 17 00:00:00 2001 From: Ivo Senner Date: Tue, 13 Dec 2016 15:09:16 +0100 Subject: [PATCH 5/5] Make type definition pass linter --- uikit/index.d.ts | 513 ++++++++++++++++++----------------------------- 1 file changed, 197 insertions(+), 316 deletions(-) diff --git a/uikit/index.d.ts b/uikit/index.d.ts index 7c04863cca..cf2930bdaa 100644 --- a/uikit/index.d.ts +++ b/uikit/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for uikit 2.27.2 +// Type definitions for uikit 2.27 // Project: http://getuikit.org // Definitions by: Giovanni Silva , Ivo Senner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,16 +10,16 @@ declare namespace UIkit { /** * Show the modal */ - show(): void + show(): void; /** * Hide the modal */ - hide(): void + hide(): void; /** * Return if the modal is active on the page * @return {boolean} True if the modal is current active on the page, false otherwise */ - isActive(): boolean + isActive(): boolean; } interface ModalOptions { /** @@ -28,35 +28,35 @@ declare namespace UIkit { *

Possible value

* boolean */ - keyboard?: boolean + keyboard?: boolean; /** * Allow modal to close automatically when clicking on the modal overlay * @default true *

Possible value

* boolean */ - bgclose?: boolean + bgclose?: boolean; /** * Set the height for overflow container to start scrolling * @default 150 *

Possible value

* integer */ - minScrollHeight?: number + minScrollHeight?: number; /** * Vertically center the modal * @default false *

Possible value

* boolean */ - center?: boolean + center?: boolean; /** * Close currently opened modals on opening modal * @default true *

Possible value

* boolean */ - modal?: boolean + modal?: boolean; } /** * Create modal dialogs with different styles and transitions @@ -101,20 +101,20 @@ declare namespace UIkit { * Create a alert dialog * @param {string} message The message to display. Can be Html */ - alert(message:string): void + alert(message: string): void; /** * Create a confirm dialog * @param {string} message The message to display. Can be Html * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - confirm(message: string, options?: ModalOptions): void + confirm(message: string, options?: ModalOptions): void; /** * Create a confirm dialog and execute onconfirm on confirmation * @param {string} message The message to display. Can be Html * @param {function} onconfirm A function to execute on confirmation * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - confirm(message:string, onconfirm:() => any, options?:ModalOptions): void + confirm(message: string, onconfirm: () => any, options?: ModalOptions): void; /** * Create a confirm dialog and execute onconfirm on confirmation and oncancel on cancelation. * @param {string} message The message to display. Can be Html @@ -122,7 +122,7 @@ declare namespace UIkit { * @param {function} oncancel A function to execute on cancelation * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - confirm(message:string, onconfirm:() => any, oncancel?:() => any, options?:ModalOptions): void + confirm(message: string, onconfirm: () => any, oncancel?: () => any, options?: ModalOptions): void; /** * Create a prompt dialog, where the user enter information * @param {string} message The message to display. Can be Html @@ -130,13 +130,13 @@ declare namespace UIkit { * @param {function} fn A function to execute on submission. The function receive the new value as a parameter * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - prompt(message:string, value:string, onsubmit?:(newValue:string) => any, options?:ModalOptions): void + prompt(message: string, value: string, onsubmit?: (newValue: string) => any, options?: ModalOptions): void; /** * Create a modal that blocks the entire page * @param {string} content A content to display. Can be Html * @param {ModalOptions} [options={bgclose: true, keyboard: false, modal: false}] The modal options */ - blockUI(content:string, options?:ModalOptions): ModalElement + blockUI(content: string, options?: ModalOptions): ModalElement; /** * Select a modal element on page and return it. * @example @@ -150,7 +150,7 @@ declare namespace UIkit { * } * */ - (selector:string|JQuery): ModalElement + (selector: string|JQuery): ModalElement; } /** * Create a smooth off-canvas sidebar that slides in and out of the page @@ -179,41 +179,41 @@ declare namespace UIkit { * Show an off-canvas matching the passed CSS selector * @param {string} selector A CSS selector */ - show(selector:string): void + show(selector: string): void; /** * Hide any active offcanvas. Set force to true, if you don't want any * animation * @param {boolean} force When seted to true do not run animations. * @default false */ - hide(force?:boolean): void + hide(force?: boolean): void; } interface LightBoxOptions { /** * Group name to group elements as a gallery to show. * @default false */ - group?: string + group?: string; /** * Animation duration between gallery item change * @default 400 */ - duration?: number + duration?: number; /** * Allow keyboard navigation * @default true */ - keyboard?: boolean + keyboard?: boolean; } interface LightBoxItem { - source: string - type: string + source: string; + type: string; } interface LightBoxElement { /** * Open the lightbox */ - show(): void + show(): void; } /** * Create a fancy lightbox for images and videos utilizing the @see {@link modal|Modal Component} @@ -235,38 +235,38 @@ declare namespace UIkit { interface LightBox { /** * Create dynamic lightbox - * @param {Array} items Group of items on the lightbox + * @param {LightBoxItem[]} items Group of items on the lightbox * @return {LightBoxElement} The lightbox element to show */ - create(items:Array): LightBoxElement + create(items: LightBoxItem[]): LightBoxElement; /** * Init element manually */ - (element:string|JQuery, options?:LightBoxOptions): LightBoxElement + (element: string|JQuery, options?: LightBoxOptions): LightBoxElement; } - type CallbackAutoComplete = () => string + type CallbackAutoComplete = () => string; interface AutoCompleteOptions { /** * Data source * @default [] */ - source?: string|string[]|CallbackAutoComplete + source?: string|string[]|CallbackAutoComplete; /** * Min. input length before triggering autocomplete * @default 3 */ - minLength?: number + minLength?: number; /** * Query name when sending ajax request * @default search */ - param?: string + param?: string; /** * Delay time after stop typing * @default 300 */ - delay?: number + delay?: number; } /** * Create inputs that allow users to choose from a list of pre-generated values while typing @@ -289,37 +289,32 @@ declare namespace UIkit { * On autocomplete dropdown show * * + * @param element + * @param options */ - interface AutoComplete { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options?:AutoCompleteOptions): any - } + type AutoComplete = (element: string|JQuery, options?: AutoCompleteOptions) => any; interface DatePickerOptions { /** * Start of the week * integer (0..6) * @default 1 */ - weekstart?: number + weekstart?: number; /** * Language string definitions * @default { months:['January',...], weekdays:['Sun',..,'Sat'] } */ - i18n?: {} + i18n?: {}; /** * Date format string * @default 'DD.MM.YYYY' */ - format?: string + format?: string; /** * Offset to the input value * @default 5 */ - offsettop?: number + offsettop?: number; /** * Min. date * bool (false to ignore the option) @@ -327,7 +322,7 @@ declare namespace UIkit { * integer (offset in days from current date) * @default false */ - minDate?: string|boolean|number + minDate?: string|boolean|number; /** * Max. date * bool (false to ignore the option) @@ -335,13 +330,13 @@ declare namespace UIkit { * integer (offset in days from current date) * @default false */ - maxDate?: string|boolean|number + maxDate?: string|boolean|number; /** * Position of the datepicker * 'auto', 'top', 'bottom' * @default 'auto' */ - pos?: string + pos?: string; } /** @@ -371,90 +366,76 @@ declare namespace UIkit { * * */ - interface DatePicker { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options?:DatePickerOptions): any - } + type DatePicker = (element: string|JQuery, options?: DatePickerOptions) => any; interface HtmlEditorOptions { /** * View mode * Possible values 'split','tab' * @default 'split' */ - mode?: string + mode?: string; /** * Button list to appear in the toolbar * @default [ "bold", "italic", "strike", "link", "picture", ... ] */ - toolbar?: string[] + toolbar?: string[]; /** * Min. browser width when to switch to responsive tab mode when in split mode * @default 1000 */ - maxsplitsize?: number + maxsplitsize?: number; /** * Label string for preview mode * @default 'Preview' */ - lblPreview?: string + lblPreview?: string; /** * Label string for code mode * @default 'Markdown' */ - lblCodeview?: string + lblCodeview?: string; } /** * Create a rich HTML or markdown editor with an immediate preview and syntax highlighting * Documentation {@link http://getuikit.org/docs/htmleditor.html} */ - interface HtmlEditor { - /** - * Init element manually - * @param element - * @param options - */ - (element: string|JQuery, options?: HtmlEditorOptions): any - } + type HtmlEditor = (element: string|JQuery, options?: HtmlEditorOptions) => any; interface SliderOptions { /** * Center items mode * @default false */ - center?: boolean + center?: boolean; /** * Mouse movement threshold in pixel until trigger element dragging * @default true */ - threshold?: boolean + threshold?: boolean; /** * Infinite scrolling * @default true */ - infinite?: boolean + infinite?: boolean; /** * Class added on active item in center mode * @default uk-active */ - activecls?: string + activecls?: string; /** * Defines whether or not the slider items should switch automatically * @default false */ - autoplay?: boolean + autoplay?: boolean; /** * Pause autoplay when hovering a slider * @default true */ - pauseOnHover?: boolean + pauseOnHover?: boolean; /** * Defines the timespan between switching slider items * @default 7000 */ - autoplayInterval?: number + autoplayInterval?: number; } /** * Create a list of items to use as a responsive carousel slider @@ -473,75 +454,68 @@ declare namespace UIkit { * * */ - interface Slider { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options?:SliderOptions): any - } + type Slider = (element: string|JQuery, options?: SliderOptions) => any; interface SlideSetOptions { /** * Default visible items in a set * @default 1 */ - default?: number + default?: number; /** * Visible items in a set at small breakpoint * @default null */ - small?: number + small?: number; /** * Visible items in a set at medium breakpoint * @default null */ - medium?: number + medium?: number; /** * Visible items in a set at large breakpoint * @default null */ - large?: number + large?: number; /** * Visible items in a set at xlarge breakpoint * @default null */ - xlarge?: number + xlarge?: number; /** * Animation name * @default 'fade' */ - animation?: string + animation?: string; /** * Animation duration in ms * @default 200 */ - duration?: number + duration?: number; /** * Animation delay between items in a set * @default 100 */ - delay?: number + delay?: number; /** * Items filter * @default "" */ - filter?: string + filter?: string; /** * Defines whether or not the slideset items should switch automatically. * @default false */ - autoplay?: boolean + autoplay?: boolean; /** * Pause autoplay when hovering a slideset. * @default true */ - pauseOnHover?: boolean + pauseOnHover?: boolean; /** * Defines the timespan between switching slideset items. * @default 7000 */ - autoplayInterval?: number + autoplayInterval?: number; } /** * Create sets and groups of items, allowing to loop through the sets. @@ -560,87 +534,80 @@ declare namespace UIkit { * * */ - interface SlideSet { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options?:SlideSetOptions): any - } + type SlideSet = (element: string|JQuery, options?: SlideSetOptions) => any; interface SlideShowOptions { /** * Defines the preferred transition between items. * @default 'fade */ - animation?: string + animation?: string; /** * Defines the transition duration. * @default 500 */ - duration?: number + duration?: number; /** * Defines the slideshow height. * @default 'auto' */ - height?: string + height?: string; /** * Defines the first slideshow item to be displayed. * @default 0 */ - start?: number + start?: number; /** * Defines whether or not the slideshow items should switch automatically. * @default false */ - autoplay?: boolean + autoplay?: boolean; /** * Pause autoplay when hovering a slideshow. * @default true */ - pauseOnHover?: boolean + pauseOnHover?: boolean; /** * Defines the timespan between switching slideshow items. * @default 7000 */ - autoplayInterval?: number + autoplayInterval?: number; /** * Defines whether or not a video starts automatically. * @default true */ - videoautoplay?: boolean + videoautoplay?: boolean; /** * Defines whether or not a video is muted. * @default false */ - videomute?: boolean + videomute?: boolean; /** * Defines whether or not the Ken Burns effect is active. If kenburns is a numeric value, it will be used as * the animation duration. * @default false */ - kenburns?: boolean + kenburns?: boolean; /** * Animation series. * @default 'uk-animation-middle-left, uk-animation-top-right, uk-animation-bottom-left, uk-animation-top-center,uk-animation-bottom-right' */ - kenburnsanimations?: string + kenburnsanimations?: string; /** * Defines the number of slices, if a "Slice" transition is set. * @default 15 */ - slices?: number + slices?: number; } /** * Create a responsive image or video slideshow with stunning transition effects, fullscreen mode and overlays. @@ -659,54 +626,40 @@ declare namespace UIkit { * * */ - interface SlideShow { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:SlideShowOptions): any - } + type SlideShow = (element: string|JQuery, options: SlideShowOptions) => any; interface ParallaxOptions { /** * Animation velocity during scrolling * @default 0.5 */ - velocity?: number + velocity?: number; /** * Element dimension reference for animation duration. * @default false */ - target?: boolean + target?: boolean; /** * Animation range depending on the viewport. *

Possible value

* float (0 to 1) * @default false */ - viewport?: number + viewport?: number; /** * Condition for the active status with a width as integer (e.g. 640) or a css media query * @default false *

Possible Value

* integer / string */ - media?: number|string + media?: number|string; } /** * Animate CSS properties depending on the scroll position of the document. * Documentation {@link http://getuikit.org/docs/parallax.html} */ - interface Parallax { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:ParallaxOptions): any - } + type Parallax = (element: string|JQuery, options: ParallaxOptions) => any; interface AccordionOptions { /** * Show first item on init @@ -714,56 +667,56 @@ declare namespace UIkit { *

Possible value

* boolean */ - showfirst?: boolean + showfirst?: boolean; /** * Allow multiple open items * @default true *

Possible value

* boolean */ - collapse?: boolean + collapse?: boolean; /** * Animate toggle * @default true *

Possible value

* boolean */ - animate?: boolean + animate?: boolean; /** * Animation function * @default swing *

Possible value

* string */ - easing?: string + easing?: string; /** * Animation duration * @default 300 *

Possible value

* integer */ - duration?: number + duration?: number; /** * Css selector for toggles * @default .uk-accordion-title *

Possible value

* string */ - toggle?: string + toggle?: string; /** * Css selector for content containers * @default .uk-accordion-content *

Possible value

* string */ - containers?: string + containers?: string; /** * Class to add when an item is active * @default uk-active *

Possible value

* string */ - clsactive?: string + clsactive?: string; } /** * Create a list of items, allowing each item's content to be expanded and collapsed by clicking its header. @@ -782,20 +735,12 @@ declare namespace UIkit { * * */ - interface Accordion { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:AccordionOptions): any - } - + type Accordion = (element: string|JQuery, options: AccordionOptions) => any; interface NotifyOptions { /** * The message to display */ - message?: string + message?: string; /** * A notification can be styled by adding a status to the message to indicate an info, success, warning or a @@ -805,13 +750,13 @@ declare namespace UIkit { * If you want to create one set its style with the CSS class uk-notify-message-yourStatus * @default 'info' */ - status?: string + status?: string; /** * Amount of tiem in milliseconds a messa is visible. Set to 0 for sticky message * @default 5000 */ - timeout?: number + timeout?: number; /** * Adjust the notification's position to different corners. @@ -820,7 +765,7 @@ declare namespace UIkit { * top-center, top-left, top-right, bottom-center, bottom-left, bottom-right * If you want to create one value set its style with the CSS uk-notify-yourPosition */ - pos?: string + pos?: string; } /** * Create toggleable notifications that fade out automatically @@ -828,27 +773,16 @@ declare namespace UIkit { */ interface Notify { /** - * Show a message with default options + * Show a notification * @param message The html message + * @param {string|NotifyOptions} [status] The status or options */ - (message:string): any + (message: string, status?: string|NotifyOptions): any; /** - * Show a message with a different status - * @param message The html message - * @param status The string status - */ - (message:string, status:string): any - /** - * Show a message with diferente options - * @param message The html message + * Show a notification * @param options Options */ - (message:string, options:NotifyOptions): any - /** - * Show a message with diferent options - * @param options Options - */ - (options:NotifyOptions): any + (options: NotifyOptions): any; } interface SearchOptions { /** @@ -857,7 +791,7 @@ declare namespace UIkit { *

Possible value

* string */ - source?: string + source?: string; /** * Min. input length before triggering autocomplete @@ -865,7 +799,7 @@ declare namespace UIkit { *

Possible value

* integer */ - minLength?: number + minLength?: number; /** * Query name when sending ajax request @@ -873,7 +807,7 @@ declare namespace UIkit { *

Possible value

* string */ - param?: string + param?: string; /** * Delay time after stop typing @@ -881,21 +815,14 @@ declare namespace UIkit { *

Possible value

* integer */ - delay?: number + delay?: number; } /** * Easily create a nicely looking search. * Documentation {@link http://getuikit.org/docs/search.html} */ - interface Search { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:SearchOptions): any - } + type Search = (element: string|JQuery, options: SearchOptions) => any; interface NestableOptions { /** * List group @@ -903,98 +830,98 @@ declare namespace UIkit { *

Possible value

* string */ - group?: string + group?: string; /** * Max nesting level * @default 10 *

Possible value

* integer */ - maxDepth?: number + maxDepth?: number; /** * Pixel threshold before starting to drag * @default 20 *

Possible value

* integer */ - threshold?: number + threshold?: number; /** * List node name * @default ul *

Possible value

* string */ - listNodeName?: string + listNodeName?: string; /** * Item node name * @default li *

Possible value

* string */ - itemNodeName?: string + itemNodeName?: string; /** * List base class * @default uk-nestable *

Possible value

* string */ - listBaseClass?: string + listBaseClass?: string; /** * List class * @default uk-nestable-list *

Possible value

* string */ - listClass?: string + listClass?: string; /** * List item class * @default uk-nestable-list-item *

Possible value

* string */ - listitemClass?: string + listitemClass?: string; /** * Item class * @default uk-nestable-item *

Possible value

* string */ - itemClass?: string + itemClass?: string; /** * Class added to dragged list * @default uk-nestable-list-dragged *

Possible value

* string */ - dragClass?: string + dragClass?: string; /** * Class added to <html> when moving * @default uk-nestable-moving *

Possible value

* string */ - movingClass?: string + movingClass?: string; /** * Class for drag handle * @default uk-nestable-handle *

Possible value

* string */ - handleClass?: string + handleClass?: string; /** * Class for collapsed items * @default uk-nestable-collapsed *

Possible value

* string */ - collapsedClass?: string + collapsedClass?: string; /** * Class for placeholder of currently dragged element * @default uk-nestable-placeholder *

Possible value

* string */ - placeClass?: string + placeClass?: string; /** * Elements with this class will not trigger dragging. Useful when having the complete item draggable and not * just the handle. @@ -1002,14 +929,14 @@ declare namespace UIkit { *

Possible value

* string */ - noDragClass?: string + noDragClass?: string; /** * Class for empty lists * @default uk-nestable-empty *

Possible value

* string */ - emptyClass?: string + emptyClass?: string; } /** @@ -1044,14 +971,7 @@ declare namespace UIkit { * * */ - interface Nestable { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:NestableOptions): any - } + type Nestable = (element: string|JQuery, options: NestableOptions) => any; interface SortableOptions { /** * List group @@ -1059,35 +979,35 @@ declare namespace UIkit { *

Possible value

* string */ - group?: string + group?: string; /** * Animation speed in ms * @default 150 *

Possible value

* integer */ - animation?: string + animation?: string; /** * Mouse movement threshold in pixel until trigger element dragging * @default 10 *

Possible value

* integer */ - threshold?: string + threshold?: string; /** * Custom class to define elements which can trigger sorting * @default '' *

Possible value

* string */ - handleClass?: string + handleClass?: string; /** * Custom class added to the dragged element * @default '' *

Possible value

* string */ - dragCustomClass?: string + dragCustomClass?: string; } /** @@ -1122,14 +1042,7 @@ declare namespace UIkit { * * */ - interface Sortable { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:SortableOptions): any - } + type Sortable = (element: string|JQuery, options: SortableOptions) => any; interface StickyOptions { /** * Top offset whent sticky should be triggered @@ -1137,70 +1050,70 @@ declare namespace UIkit { *

Possible value

* integer */ - top?: number + top?: number; /** * UIkit animation class * @default '' *

Possible value

* string */ - animation?: string + animation?: string; /** * Init class when the element is sticky for the first time * @default uk-sticky-init *

Possible value

* string */ - clsinit?: string + clsinit?: string; /** * Active class to add, when element is sticky * @default uk-active *

Possible value

* string */ - clsactive?: string + clsactive?: string; /** * Class to add, when element is not sticky * @default '' *

Possible value

* string */ - clsinactive?: string + clsinactive?: string; /** * Css selector where to get the width from in sticky mode. By default it takes the width from the created wrapper element. * @default '' *

Possible value

* string */ - getWidthFrom?: string + getWidthFrom?: string; /** * Condition for the active status with a width as integer (e.g. 640) or a css media query * @default false *

Possible value

* integer / string */ - media?: number|string + media?: number|string; /** * Make sure that a sticky element is not over a targeted element via location hash on dom-ready. * @default false *

Possible value

* boolean */ - target?: boolean + target?: boolean; /** * Show sticky element only when scrolling up. * @default false *

Possible value

* boolean */ - showup?: boolean + showup?: boolean; /** * Set to true to bind sticky to the parent or a Css selector to bind sticky to a specific element. * @default false *

Possible value

* mixed */ - boundary?: boolean|string + boundary?: boolean|string; } /** @@ -1225,14 +1138,7 @@ declare namespace UIkit { * * */ - interface Sticky { - /** - * Init the element manually - * @param element - * @param options - */ - (element:string|JQuery, options:StickyOptions): any - } + type Sticky = (element: string|JQuery, options: StickyOptions) => any; interface TimepickerOptions { /** * Defines the preferred time notation @@ -1240,35 +1146,28 @@ declare namespace UIkit { *

Possible value

* '24h' or '12h' */ - format?: string + format?: string; /** * Start time * @default 0 *

Possible value

* Integer between 0 and 24 */ - start?: number + start?: number; /** * End time * @default 24 *

Possible value

* Integer between 0 and 24 */ - end?: number + end?: number; } /** * Create a timepicker which can easily be used by selecting a time value from a pre filled dropdown. * Documentation {@link http://getuikit.org/docs/timepicker.html} */ - interface Timepicker { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:TimepickerOptions): any - } + type Timepicker = (element: string|JQuery, options: TimepickerOptions) => any; interface TooltipOptions { /** * Offset to the source element @@ -1276,56 +1175,49 @@ declare namespace UIkit { *

Possible value

* integer */ - offset?: number + offset?: number; /** * Tooltip position * @default 'top' *

Possible value

* string */ - pos?: string + pos?: string; /** * Fade in tooltip * @default false *

Possible value

* boolean */ - animation?: boolean + animation?: boolean; /** * Delay tooltip show in ms * @default 0 *

Possible value

* integer */ - delay?: number + delay?: number; /** * Custom class to add on show * @default '' *

Possible value

* string */ - cls?: string + cls?: string; /** * Toggled active class * @default 'uk-active' *

Possible value

* string */ - activeClass?: string + activeClass?: string; } /** * Easily create a nicely looking tooltip. * Documentation {@link http://getuikit.org/docs/tooltip.html} */ - interface Tooltip { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:TooltipOptions): any - } + type Tooltip = (element: string|JQuery, options: TooltipOptions) => any; interface UploadOptions { /** * Target url for the upload @@ -1333,62 +1225,62 @@ declare namespace UIkit { *

Possible value

* string */ - action?: string + action?: string; /** * Send each file one by one * @default true *

Possible value

* boolean */ - single?: boolean + single?: boolean; /** * Post query name * @default files[] *

Possible value

* string */ - param?: string + param?: string; /** * Additional request parameters * @default {} *

Possible value

* JSON Object */ - params?: {} + params?: {}; /** * File filter * @default *.* *

Possible value

* string */ - allow?: string + allow?: string; /** * Limit the number of files to upload * @default false *

Possible value

* integer */ - filelimit?: number + filelimit?: number; /** * Response type from server * @default text *

Possible Value

* (text|json) */ - "type"?: string - before?: (settings: UploadOptions, files: string|string[]) => any - beforeAll?: (files: string|string[]) => any - beforeSend?: (xhr: XMLHttpRequest) => any - progress?: (percent: number) => any - complete?: (response: any, xhr: XMLHttpRequest) => any - allcomplete?: (response: any, xhr: XMLHttpRequest) => any - notallowed?: (file: string|string[], settings: UploadOptions) => any - loadstart?: (event: any) => any - load?: (event: any) => any - loadend?: (event: any) => any - error?: (event: any) => any - abort?: (event: any) => any - readystatechange?: (event: any) => any + "type"?: string; + before?: (settings: UploadOptions, files: string|string[]) => any; + beforeAll?: (files: string|string[]) => any; + beforeSend?: (xhr: XMLHttpRequest) => any; + progress?: (percent: number) => any; + complete?: (response: any, xhr: XMLHttpRequest) => any; + allcomplete?: (response: any, xhr: XMLHttpRequest) => any; + notallowed?: (file: string|string[], settings: UploadOptions) => any; + loadstart?: (event: any) => any; + load?: (event: any) => any; + loadend?: (event: any) => any; + error?: (event: any) => any; + abort?: (event: any) => any; + readystatechange?: (event: any) => any; } /** @@ -1454,36 +1346,25 @@ declare namespace UIkit { * * */ - interface Upload { - /** - * Init element manually - * @param element - * @param options - */ - (element:string|JQuery, options:UploadOptions): any - } - export var modal:Modal; - export var lightbox:LightBox; - export var offcanvas:OffCanvas; - export var autocomplete:AutoComplete; - export var datepicker:DatePicker; - export var htmleditor:HtmlEditor; - export var slider:Slider; - export var slideset:SlideSet; - export var slideshow:SlideShow; - export var parallax:Parallax; - export var accordion:Accordion; - export var notify:Notify; - export var search:Search; - export var nestable:Nestable; - export var sortable:Sortable; - export var sticky:Sticky; - export var timepicker:Timepicker; - export var tooltip:Tooltip; - export var uploadSelect: Upload; - export var uploadDrop: Upload; -} - -declare module 'uikit' { - export = UIkit + type Upload = (element: string|JQuery, options: UploadOptions) => any; + var modal: Modal; + var lightbox: LightBox; + var offcanvas: OffCanvas; + var autocomplete: AutoComplete; + var datepicker: DatePicker; + var htmleditor: HtmlEditor; + var slider: Slider; + var slideset: SlideSet; + var slideshow: SlideShow; + var parallax: Parallax; + var accordion: Accordion; + var notify: Notify; + var search: Search; + var nestable: Nestable; + var sortable: Sortable; + var sticky: Sticky; + var timepicker: Timepicker; + var tooltip: Tooltip; + var uploadSelect: Upload; + var uploadDrop: Upload; }