forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-ui-bootstrap.d.ts
750 lines (631 loc) · 18.7 KB
/
angular-ui-bootstrap.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
// Type definitions for Angular UI Bootstrap 0.13.3
// Project: https://github.com/angular-ui/bootstrap
// Definitions by: Brian Surowiec <https://github.com/xt0rted>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
// Support for AMD require
declare module 'angular-bootstrap' {
let _: string;
export = _;
}
declare module 'angular-ui-bootstrap' {
let _: string;
export = _;
}
declare module angular.ui.bootstrap {
interface IAccordionConfig {
/**
* Controls whether expanding an item will cause the other items to close.
*
* @default true
*/
closeOthers?: boolean;
}
interface IButtonConfig {
/**
* @default: 'active'
*/
activeClass?: string;
/**
* @default: 'Click'
*/
toggleEvent?: string;
}
interface IDatepickerConfig {
/**
* Format of day in month.
*
* @default 'dd'
*/
formatDay?: string;
/**
* Format of month in year.
*
* @default 'MMM'
*/
formatMonth?: string;
/**
* Format of year in year range.
*
* @default 'yyyy'
*/
formatYear?: string;
/**
* Format of day in week header.
*
* @default 'EEE'
*/
formatDayHeader?: string;
/**
* Format of title when selecting day.
*
* @default 'MMM yyyy'
*/
formatDayTitle?: string;
/**
* Format of title when selecting month.
*
* @default 'yyyy'
*/
formatMonthTitle?: string;
/**
* Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode.
*
* @default 'day'
*/
datepickerMode?: string;
/**
* Set a lower limit for mode.
*
* @default 'day'
*/
minMode?: string;
/**
* Set an upper limit for mode.
*
* @default 'year'
*/
maxMode?: string;
/**
* Whether to display week numbers.
*
* @default true
*/
showWeeks?: boolean;
/**
* Starting day of the week from 0-6 where 0=Sunday and 6=Saturday.
*
* @default 0
*/
startingDay?: number;
/**
* Number of years displayed in year selection.
*
* @default 20
*/
yearRange?: number;
/**
* Defines the minimum available date.
*
* @default null
*/
minDate?: any;
/**
* Defines the maximum available date.
*
* @default null
*/
maxDate?: any;
/**
* An option to disable or enable shortcut's event propagation
*
* @default false
*/
shortcutPropagation?: boolean;
}
interface IDatepickerPopupConfig {
/**
* The format for displayed dates.
*
* @default 'yyyy-MM-dd'
*/
datepickerPopup?: string;
/**
* Allows overriding of default template of the popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerPopupTemplateUrl?: string;
/**
* Allows overriding of default template of the datepicker used in popup.
*
* @default 'template/datepicker/popup.html'
*/
datepickerTemplateUrl?: string;
/**
* Allows overriding of the default format for html5 date inputs.
*/
html5Types?: {
date?: string;
'datetime-local'?: string;
month?: string;
};
/**
* The text to display for the current day button.
*
* @default 'Today'
*/
currentText?: string;
/**
* The text to display for the clear button.
*
* @default 'Clear'
*/
clearText?: string;
/**
* The text to display for the close button.
*
* @default 'Done'
*/
closeText?: string;
/**
* Whether to close calendar when a date is chosen.
*
* @default true
*/
closeOnDateSelection?: boolean;
/**
* Append the datepicker popup element to `body`, rather than inserting after `datepicker-popup`.
*
* @default false
*/
appendToBody?: boolean;
/**
* Whether to display a button bar underneath the datepicker.
*
* @default true
*/
showButtonBar?: boolean;
/**
* Whether to focus the datepicker popup upon opening.
*
* @default true
*/
onOpenFocus?: boolean;
}
interface IModalProvider {
/**
* Default options all modals will use.
*/
options: IModalSettings;
}
interface IModalService {
/**
* @param {IModalSettings} options
* @returns {IModalServiceInstance}
*/
open(options: IModalSettings): IModalServiceInstance;
}
interface IModalServiceInstance {
/**
* A method that can be used to close a modal, passing a result. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
close(result?: any): void;
/**
* A method that can be used to dismiss a modal, passing a reason. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*/
dismiss(reason?: any): void;
/**
* A promise that is resolved when a modal is closed and rejected when a modal is dismissed.
*/
result: angular.IPromise<any>;
/**
* A promise that is resolved when a modal gets opened after downloading content's template and resolving all variables.
*/
opened: angular.IPromise<any>;
/**
* A promise that is resolved when a modal is rendered.
*/
rendered: angular.IPromise<any>;
}
interface IModalScope extends angular.IScope {
/**
* Dismiss the dialog without assigning a value to the promise output. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$dismiss(reason?: any): boolean;
/**
* Close the dialog resolving the promise to the given value. If `preventDefault` is called on the `modal.closing` event then the modal will remain open.
*
* @returns true if the modal was closed; otherwise false
*/
$close(result?: any): boolean;
}
interface IModalSettings {
/**
* a path to a template representing modal's content
*/
templateUrl?: string | (() => string);
/**
* inline template representing the modal's content
*/
template?: string;
/**
* a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope).
* Defaults to `$rootScope`.
*/
scope?: angular.IScope|IModalScope;
/**
* a controller for a modal instance - it can initialize scope used by modal.
* A controller can be injected with `$modalInstance`
*/
controller?: any;
/**
* an alternative to the controller-as syntax, matching the API of directive definitions.
* Requires the controller option to be provided as well
*/
controllerAs?: string;
/**
* When used with controllerAs and set to true, it will bind the controller properties onto the $scope directly.
*
* @default false
*/
bindToController?: boolean;
/**
* members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes
*/
resolve?: any;
/**
* Set to false to disable animations on new modal/backdrop. Does not toggle animations for modals/backdrops that are already displayed.
*
* @default true
*/
animation?: boolean;
/**
* controls the presence of a backdrop
* Allowed values:
* - true (default)
* - false (no backdrop)
* - 'static' backdrop is present but modal window is not closed when clicking outside of the modal window
*
* @default true
*/
backdrop?: boolean | string;
/**
* indicates whether the dialog should be closable by hitting the ESC key
*
* @default true
*/
keyboard?: boolean;
/**
* additional CSS class(es) to be added to a modal backdrop template
*/
backdropClass?: string;
/**
* additional CSS class(es) to be added to a modal window template
*/
windowClass?: string;
/**
* Optional suffix of modal window class. The value used is appended to the `modal-` class, i.e. a value of `sm` gives `modal-sm`.
*/
size?: string;
/**
* a path to a template overriding modal's window template
*/
windowTemplateUrl?: string;
/**
* The class added to the body element when the modal is opened.
*
* @default 'model-open'
*/
openedClass?: string;
}
interface IModalStackService {
/**
* Opens a new modal instance.
*/
open(modalInstance: IModalServiceInstance, modal: any): void;
/**
* Closes a modal instance with an optional result.
*/
close(modalInstance: IModalServiceInstance, result?: any): void;
/**
* Dismisses a modal instance with an optional reason.
*/
dismiss(modalInstance: IModalServiceInstance, reason?: any): void;
/**
* Dismiss all open modal instances with an optional reason that will be passed to each instance.
*/
dismissAll(reason?: any): void;
/**
* Gets the topmost modal instance that is open.
*/
getTop(): IModalStackedMapKeyValuePair;
}
interface IModalStackedMapKeyValuePair {
key: IModalServiceInstance;
value: any;
}
interface IPaginationConfig {
/**
* Total number of items in all pages.
*/
totalItems?: number;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
* @default 10
*/
itemsPerPage?: number;
/**
* Limit number for pagination size.
*
* @default: null
*/
maxSize?: number;
/**
* An optional expression assigned the total number of pages to display.
*
* @default angular.noop
*/
numPages?: number;
/**
* Whether to keep current page in the middle of the visible ones.
*
* @default true
*/
rotate?: boolean;
/**
* Whether to display Previous / Next buttons.
*
* @default true
*/
directionLinks?: boolean;
/**
* Text for Previous button.
*
* @default 'Previous'
*/
previousText?: string;
/**
* Text for Next button.
*
* @default 'Next'
*/
nextText?: string;
/**
* Whether to display First / Last buttons.
*
* @default false
*/
boundaryLinks?: boolean;
/**
* Text for First button.
*
* @default 'First'
*/
firstText?: string;
/**
* Text for Last button.
*
* @default 'Last'
*/
lastText?: string;
/**
* Override the template for the component with a custom provided template.
*
* @default 'template/pagination/pagination.html'
*/
templateUrl?: string;
}
interface IPagerConfig {
/**
* Whether to align each link to the sides.
*
* @default true
*/
align?: boolean;
/**
* Maximum number of items per page. A value less than one indicates all items on one page.
*
* @default 10
*/
itemsPerPage?: number;
/**
* Text for Previous button.
*
* @default '« Previous'
*/
previousText?: string;
/**
* Text for Next button.
*
* @default 'Next »'
*/
nextText?: string;
}
interface IPositionCoordinates {
width?: number;
height?: number;
top?: number;
left?: number;
}
interface IPositionService {
/**
* Provides a read-only equivalent of jQuery's position function.
*/
position(element: JQuery): IPositionCoordinates;
/**
* Provides a read-only equivalent of jQuery's offset function.
*/
offset(element: JQuery): IPositionCoordinates;
}
interface IProgressConfig {
/**
* Whether bars use transitions to achieve the width change.
*
* @default: true
*/
animate?: boolean;
/**
* A number that specifies the total value of bars that is required.
*
* @default: 100
*/
max?: number;
}
interface IRatingConfig {
/**
* Changes the number of icons.
*
* @default: 5
*/
max?: number;
/**
* A variable used in the template to specify the state for selected icons.
*
* @default: null
*/
stateOn?: string;
/**
* A variable used in the template to specify the state for unselected icons.
*
* @default: null
*/
stateOff?: string;
/**
* An array of strings defining titles for all icons.
*
* @default: ["one", "two", "three", "four", "five"]
*/
titles?: Array<string>;
}
interface ITimepickerConfig {
/**
* Number of hours to increase or decrease when using a button.
*
* @default 1
*/
hourStep?: number;
/**
* Number of minutes to increase or decrease when using a button.
*
* @default 1
*/
minuteStep?: number;
/**
* Whether to display 12H or 24H mode.
*
* @default true
*/
showMeridian?: boolean;
/**
* Meridian labels based on locale. To override you must supply an array like ['AM', 'PM'].
*
* @default null
*/
meridians?: Array<string>;
/**
* Whether the user can type inside the hours & minutes input.
*
* @default false
*/
readonlyInput?: boolean;
/**
* Whether the user can scroll inside the hours & minutes input to increase or decrease it's values.
*
* @default true
*/
mousewheel?: boolean;
/**
* Whether the user can use up/down arrowkeys inside the hours & minutes input to increase or decrease it's values.
*
* @default true
*/
arrowkeys?: boolean;
/**
* Shows spinner arrows above and below the inputs.
*
* @default true
*/
showSpinners?: boolean;
}
interface ITooltipOptions {
/**
* Where to place it? Defaults to 'top', but also accepts 'right', 'bottom', or 'left'.
*
* @default 'top'
*/
placement?: string;
/**
* Should the modal fade in and out?
*
* @default true
*/
animation?: boolean;
/**
* For how long should the user have to have the mouse over the element before the tooltip shows (in milliseconds)?
*
* @default 0
*/
popupDelay?: number;
/**
* Should the tooltip be appended to `$body` instead of the parent element?
*
* @default false
*/
appendToBody?: boolean;
/**
* What should trigger a show of the tooltip? Supports a space separated list of event names.
*
* @default 'mouseenter' for tooltip, 'click' for popover
*/
trigger?: string;
/**
* Should an expression on the scope be used to load the content?
*
* @default false
*/
useContentExp?: boolean;
}
interface ITooltipProvider {
/**
* Provide a set of defaults for certain tooltip and popover attributes.
*/
options(value: ITooltipOptions): void;
/**
* Extends the default trigger mappings with mappings of your own. E.g. `{ 'openTrigger': 'closeTrigger' }`.
*/
setTriggers(triggers: Object): void;
}
/**
* WARNING: $transition is now deprecated. Use $animate from ngAnimate instead.
*/
interface ITransitionService {
/**
* The browser specific animation event name.
*/
animationEndEventName: string;
/**
* The browser specific transition event name.
*/
transitionEndEventName: string;
/**
* Provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete.
*
* @param element The DOMElement that will be animated
* @param trigger The thing that will cause the transition to start:
* - As a string, it represents the css class to be added to the element.
* - As an object, it represents a hash of style attributes to be applied to the element.
* - As a function, it represents a function to be called that will cause the transition to occur.
* @param options Optional settings for the transition.
*
* @return A promise that is resolved when the transition finishes.
*/
(element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise<angular.IAugmentedJQuery>;
}
interface ITransitionServiceOptions {
animation?: boolean;
}
}