forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ember.d.ts
3492 lines (3336 loc) · 149 KB
/
ember.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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for Ember.js 1.11.3
// Project: http://emberjs.com/
// Definitions by: Jed Mao <https://github.com/jedmao>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../handlebars/handlebars-1.0.0.d.ts" />
declare var Handlebars: HandlebarsStatic;
declare namespace EmberStates {
interface Transition {
targetName: string;
urlMethod: string;
intent: any;
params: {}|any;
pivotHandler: any;
resolveIndex: number;
handlerInfos: any;
resolvedModels: {}|any;
isActive: boolean;
state: any;
queryParams: {}|any;
queryParamsOnly: boolean;
isTransition: boolean;
/**
The Transition's internal promise. Calling `.then` on this property
is that same as calling `.then` on the Transition object itself, but
this property is exposed for when you want to pass around a
Transition's promise, but not the Transition object itself, since
Transition object can be externally `abort`ed, while the promise
cannot.
*/
promise: Ember.RSVP.Promise;
/**
Custom state can be stored on a Transition's `data` object.
This can be useful for decorating a Transition within an earlier
hook and shared with a later hook. Properties set on `data` will
be copied to new transitions generated by calling `retry` on this
transition.
*/
data: any;
/**
A standard promise hook that resolves if the transition
succeeds and rejects if it fails/redirects/aborts.
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@arg {Function} onFulfilled
@arg {Function} onRejected
@arg {String} label optional string for labeling the promise. Useful for tooling.
@return {Promise}
*/
then(onFulfilled: Function, onRejected?: Function, label?: string): Ember.RSVP.Promise;
/**
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@method catch
@arg {Function} onRejection
@arg {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise}
*/
catch(onRejection: Function, label?: string): Ember.RSVP.Promise;
/**
Forwards to the internal `promise` property which you can
use in situations where you want to pass around a thennable,
but not the Transition itself.
@method finally
@arg {Function} callback
@arg {String} label optional string for labeling the promise.
Useful for tooling.
@return {Promise}
*/
finally(callback: Function, label?: string): Ember.RSVP.Promise;
/**
Aborts the Transition. Note you can also implicitly abort a transition
by initiating another transition while a previous one is underway.
*/
abort(): EmberStates.Transition;
normalize(manager: Ember.StateManager, contexts: any[]): void;
/**
Retries a previously-aborted transition (making sure to abort the
transition if it's still active). Returns a new transition that
represents the new attempt to transition.
*/
retry(): EmberStates.Transition;
/**
Sets the URL-changing method to be employed at the end of a
successful transition. By default, a new Transition will just
use `updateURL`, but passing 'replace' to this method will
cause the URL to update using 'replaceWith' instead. Omitting
a parameter will disable the URL change, allowing for transitions
that don't update the URL at completion (this is also used for
handleURL, since the URL has already changed before the
transition took place).
@arg {String} method the type of URL-changing method to use
at the end of a transition. Accepted values are 'replace',
falsy values, or any other non-falsy value (which is
interpreted as an updateURL transition).
@return {Transition} this transition
*/
method(method: string): EmberStates.Transition;
/**
Fires an event on the current list of resolved/resolving
handlers within this transition. Useful for firing events
on route hierarchies that haven't fully been entered yet.
Note: This method is also aliased as `send`
@arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error
@arg {String} name the name of the event to fire
*/
trigger(ignoreFailure:boolean, eventName: string): void;
/**
Fires an event on the current list of resolved/resolving
handlers within this transition. Useful for firing events
on route hierarchies that haven't fully been entered yet.
Note: This method is also aliased as `send`
@arg {String} name the name of the event to fire
*/
trigger(eventName: string): void;
/**
Transitions are aborted and their promises rejected
when redirects occur; this method returns a promise
that will follow any redirects that occur and fulfill
with the value fulfilled by any redirecting transitions
that occur.
@return {Promise} a promise that fulfills with the same
value that the final redirecting transition fulfills with
*/
followRedirects(): Ember.RSVP.Promise;
}
}
declare namespace EmberTesting {
namespace Test {
class Adapter {
asyncEnd(): void;
asyncStart(): void;
exception(error: string): void;
}
class QUnitAdapter extends Adapter { }
}
}
interface Function {
observes(...args: string[]): Function;
observesBefore(...args: string[]): Function;
on(...args: string[]): Function;
property(...args: string[]): Function;
}
interface String {
camelize(): string;
capitalize(): string;
classify(): string;
dasherize(): string;
decamelize(): string;
fmt(...args: string[]): string;
htmlSafe(): typeof Handlebars.SafeString;
loc(...args: string[]): string;
underscore(): string;
w(): string[];
}
interface Array<T> {
constructor(arr: any[]): void;
activate(): void;
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: any): boolean;
clear(): any[];
compact(): any[];
contains(obj: any): boolean;
enumerableContentDidChange(start: number, removing: number, adding: number): any;
enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: number): any;
enumerableContentDidChange(start: number, removing: number, adding: Ember.Enumerable): any;
enumerableContentDidChange(start: number, removing: Ember.Enumerable, adding: Ember.Enumerable): any;
enumerableContentDidChange(removing: number, adding: number): any;
enumerableContentDidChange(removing: Ember.Enumerable, adding: number): any;
enumerableContentDidChange(removing: number, adding: Ember.Enumerable): any;
enumerableContentDidChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any;
enumerableContentWillChange(removing: number, adding: number): any[];
enumerableContentWillChange(removing: Ember.Enumerable, adding: number): any[];
enumerableContentWillChange(removing: number, adding: Ember.Enumerable): any[];
enumerableContentWillChange(removing: Ember.Enumerable, adding: Ember.Enumerable): any[];
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: any): boolean;
filter(callback: Function, target?: any): any[];
filterBy(key: string, value?: string): any[];
/**
Returns the first item in the array for which the callback returns true.
This method works similar to the `filter()` method defined in JavaScript 1.6
except that it will stop working on the array once a match is found.
The callback method you provide should have the following signature (all
parameters are optional):
```javascript
function(item, index, enumerable);
```
- `item` is the current item in the iteration.
- `index` is the current index in the iteration.
- `enumerable` is the enumerable object itself.
It should return the `true` to include the item in the results, `false`
otherwise.
Note that in addition to a callback, you can also pass an optional target
object that will be set as `this` on the context. This is a good way
to give your iterator function access to the current object.
@function find
@arg callback The callback to execute
@arg {Object} [target] The target object to use
@return {Object} Found item or `undefined`.
*/
find(callback: Function, target?: any): any;
findBy(key: string, value?: string): any;
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt?: number): number;
insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...args: any[]): any[];
lastIndexOf(object: any, startAt?: number): number;
map(callback: Function, target?: any): any[];
mapBy(key: string): any[];
nextObject(index: number, previousObject: any, context: any): any;
objectAt(idx: number): any;
objectsAt(...args: number[]): any[];
popObject(): any;
pushObject(obj: any): any;
pushObjects(...args: any[]): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[];
replace(idx: number, amt: number, objects: any[]): void;
reverseObjects(): any[];
setEach(key: string, value?: any): any;
setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): any[];
unshiftObject(object: any): any;
unshiftObjects(objects: any[]): any[];
without(value: any): any[];
'[]': any[];
'@each': Ember.EachProxy;
Boolean: boolean;
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
addObject(object: any): any;
addObjects(objects: Ember.Enumerable): any[];
removeObject(object: any): any;
removeObjects(objects: Ember.Enumerable): any[];
addObserver: ModifyObserver;
beginPropertyChanges(): any[];
cacheFor(keyName: string): any;
decrementProperty(keyName: string, decrement?: number): number;
endPropertyChanges(): any[];
get(keyName: string): any;
getProperties(...args: string[]): {};
getProperties(keys: string[]): {};
getWithDefault(keyName: string, defaultValue: any): any;
hasObserverFor(key: string): boolean;
incrementProperty(keyName: string, increment?: number): number;
notifyPropertyChange(keyName: string): any[];
propertyDidChange(keyName: string): any[];
propertyWillChange(keyName: string): any[];
removeObserver(key: string, target: any, method: string): Ember.Observable;
removeObserver(key: string, target: any, method: Function): Ember.Observable;
set(keyName: string, value: any): any[];
setProperties(hash: {}): any[];
toggleProperty(keyName: string): any;
copy(deep: boolean): any[];
frozenCopy(): any[];
// 1.3
isAny(key: string, value?: string): boolean;
isEvery(key: string, value?: string): boolean;
}
interface ApplicationCreateArguments {
customEvents?: {};
rootElement?: string;
/**
Basic logging of successful transitions.
**/
LOG_TRANSITIONS?: boolean;
/**
Detailed logging of all routing steps.
**/
LOG_TRANSITIONS_INTERNAL?: boolean;
}
interface ApplicationInitializerArguments {
name?: string;
initialize?: ApplicationInitializerFunction;
}
interface ApplicationInitializerFunction {
(container: Ember.Container, application: Ember.Application): void;
}
interface CoreObjectArguments {
/**
An overridable method called when objects are instantiated. By default, does nothing unless it is
overridden during class definition. NOTE: If you do override init for a framework class like Ember.View
or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember
may not have an opportunity to do important setup work, and you'll see strange behavior in your application.
**/
init?: Function;
/**
Override to implement teardown.
**/
willDestroy?: Function;
[propName: string]: any;
}
interface EnumerableConfigurationOptions {
willChange?: boolean ;
didChange?: boolean ;
}
interface ItemIndexEnumerableCallbackTarget {
(callback: ItemIndexEnumerableCallback, target?: any): any[];
}
interface ItemIndexEnumerableCallback {
(item: any, index: number, enumerable: Ember.Enumerable): void;
}
interface ReduceCallback {
(previousValue: any, item: any, index: number, enumerable: Ember.Enumerable): void;
}
interface TransitionsHash {
contexts: any[];
exitStates: Ember.State[];
enterStates: Ember.State[];
resolveState: Ember.State;
}
interface ActionsHash {
willTransition?: Function;
error?: Function;
}
interface DisconnectOutletOptions {
outlet?: string;
parentView?: string;
}
interface RenderOptions {
into?: string;
controller?: string;
model?: any;
outlet?: string;
view?: string;
}
interface ModifyObserver {
(obj: any, path: string, target: any, method?: Function): void;
(obj: any, path: string, target: any, method?: string): void;
(obj: any, path: string, func: Function, method?: Function): void;
(obj: any, path: string, func: Function, method?: string): void;
}
declare namespace Ember {
/**
Alias for jQuery.
**/
// ReSharper disable once DuplicatingLocalDeclaration
var $: JQueryStatic;
/**
Creates an Ember.NativeArray from an Array like object. Does not modify the original object.
Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is
recommended that you use Ember.A when creating addons for ember or when you can not garentee
that Ember.EXTEND_PROTOTYPES will be true.
**/
function A(arr?: any[]): NativeArray;
/**
The Ember.ActionHandler mixin implements support for moving an actions property to an _actions
property at extend time, and adding _actions to the object's mergedProperties list.
**/
class ActionHandlerMixin {
/**
Triggers a named action on the ActionHandler
**/
send(name: string, ...args: any[]): void;
/**
The collection of functions, keyed by name, available on this ActionHandler as action targets.
**/
actions: ActionsHash;
}
/**
An instance of Ember.Application is the starting point for every Ember application. It helps to
instantiate, initialize and coordinate the many objects that make up your app.
**/
class Application extends Namespace {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
static initializer(args?: ApplicationInitializerArguments): void;
/**
Call advanceReadiness after any asynchronous setup logic has completed.
Each call to deferReadiness must be matched by a call to advanceReadiness
or the application will never become ready and routing will not begin.
**/
advanceReadiness(): void;
/**
Use this to defer readiness until some condition is true.
This allows you to perform asynchronous setup logic and defer
booting your application until the setup has finished.
However, if the setup requires a loading UI, it might be better
to use the router for this purpose.
*/
deferReadiness(): void;
/**
defines an injection or typeInjection
**/
inject(factoryNameOrType: string, property: string, injectionName: string): void;
/**
This injects the test helpers into the window's scope. If a function of the
same name has already been defined it will be cached (so that it can be reset
if the helper is removed with `unregisterHelper` or `removeTestHelpers`).
Any callbacks registered with `onInjectHelpers` will be called once the
helpers have been injected.
**/
injectTestHelpers(): void;
/**
registers a factory for later injection
@param fullName type:name (e.g., 'model:user')
@param factory (e.g., App.Person)
**/
register(fullName: string, factory: Function, options?: {}): void;
/**
This removes all helpers that have been registered, and resets and functions
that were overridden by the helpers.
**/
removeTestHelpers(): void;
/**
Reset the application. This is typically used only in tests.
**/
reset(): void;
/**
This hook defers the readiness of the application, so that you can start
the app when your tests are ready to run. It also sets the router's
location to 'none', so that the window's location will not be modified
(preventing both accidental leaking of state between tests and interference
with your testing framework).
**/
setupForTesting(): void;
/**
The DOM events for which the event dispatcher should listen.
*/
customEvents: {};
/**
The Ember.EventDispatcher responsible for delegating events to this application's views.
**/
eventDispatcher: EventDispatcher;
/**
Set this to provide an alternate class to Ember.DefaultResolver
**/
resolver: DefaultResolver;
/**
The root DOM element of the Application. This can be specified as an
element or a jQuery-compatible selector string.
This is the element that will be passed to the Application's, eventDispatcher,
which sets up the listeners for event delegation. Every view in your application
should be a child of the element you specify here.
**/
rootElement: HTMLElement;
/**
Called when the Application has become ready.
The call will be delayed until the DOM has become ready.
**/
ready: Function;
/**
Application's router.
**/
Router: Router;
}
/**
This module implements Observer-friendly Array-like behavior. This mixin is picked up by the
Array class as well as other controllers, etc. that want to appear to be arrays.
**/
class Array implements Enumerable {
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: string): boolean;
compact(): any[];
contains(obj: any): boolean;
enumerableContentDidChange(start: number, removing: number, adding: number): any;
enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any;
enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any;
enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any;
enumerableContentDidChange(removing: number, adding: number): any;
enumerableContentDidChange(removing: Enumerable, adding: number): any;
enumerableContentDidChange(removing: number, adding: Enumerable): any;
enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any;
enumerableContentWillChange(removing: number, adding: number): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable;
enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable;
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: string): boolean;
filter(callback: Function, target: any): any[];
filterBy(key: string, value?: string): any[];
find(callback: Function, target?: any): any;
findBy(key: string, value?: string): any;
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
invoke(methodName: string, ...args: any[]): any[];
lastIndexOf(object: any, startAt: number): number;
map: ItemIndexEnumerableCallbackTarget;
mapBy(key: string): any[];
nextObject(index: number, previousObject: any, context: any): any;
objectAt(idx: number): any;
objectsAt(...args: number[]): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
setEach(key: string, value?: any): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): Enumerable;
without(value: any): Enumerable;
'@each': EachProxy;
Boolean: boolean;
'[]': any[];
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
length: number;
}
/**
Provides a way for you to publish a collection of objects so that you can easily bind to the
collection from a Handlebars #each helper, an Ember.CollectionView, or other controllers.
**/
class ArrayController extends ArrayProxy implements SortableMixin, ControllerMixin {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
lookupItemController(object: any): string;
arrangedContent: any;
itemController: string;
sortAscending: boolean;
sortFunction: Comparable;
sortProperties: any[];
replaceRoute(name: string, ...args: any[]): void;
transitionToRoute(name: string, ...args: any[]): void;
controllers: {};
needs: string[];
target: any;
model: any;
queryParams: any;
send(name: string, ...args: any[]): void;
actions: {};
}
/**
Array polyfills to support ES5 features in older browsers.
**/
var ArrayPolyfills: {
map: typeof Array.prototype.map;
forEach: typeof Array.prototype.forEach;
indexOf: typeof Array.prototype.indexOf;
};
/**
An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray,
forwarding all requests. This makes it very useful for a number of binding use cases or other cases
where being able to swap out the underlying array is useful.
**/
class ArrayProxy extends Object implements MutableArray {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[];
addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
any(callback: Function, target?: any): boolean;
anyBy(key: string, value?: string): boolean;
arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[];
arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[];
someProperty(key: string, value?: string): boolean;
clear(): any[];
compact(): any[];
contains(obj: any): boolean;
enumerableContentDidChange(start: number, removing: number, adding: number): any;
enumerableContentDidChange(start: number, removing: Enumerable, adding: number): any;
enumerableContentDidChange(start: number, removing: number, adding: Enumerable): any;
enumerableContentDidChange(start: number, removing: Enumerable, adding: Enumerable): any;
enumerableContentDidChange(removing: number, adding: number): any;
enumerableContentDidChange(removing: Enumerable, adding: number): any;
enumerableContentDidChange(removing: number, adding: Enumerable): any;
enumerableContentDidChange(removing: Enumerable, adding: Enumerable): any;
enumerableContentWillChange(removing: number, adding: number): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: number): Enumerable;
enumerableContentWillChange(removing: number, adding: Enumerable): Enumerable;
enumerableContentWillChange(removing: Enumerable, adding: Enumerable): Enumerable;
every(callback: Function, target?: any): boolean;
everyBy(key: string, value?: string): boolean;
everyProperty(key: string, value?: string): boolean;
filter(callback: Function, target: any): any[];
filterBy(key: string, value?: string): any[];
find(callback: Function, target: any): any;
findBy(key: string, value?: string): any;
forEach(callback: Function, target?: any): any;
getEach(key: string): any[];
indexOf(object: any, startAt: number): number;
insertAt(idx: number, object: any): any[];
invoke(methodName: string, ...args: any[]): any[];
lastIndexOf(object: any, startAt: number): number;
map: ItemIndexEnumerableCallbackTarget;
mapBy(key: string): any[];
nextObject(index: number, previousObject: any, context: any): any;
objectAt(idx: number): any;
objectAtContent(idx: number): any;
objectsAt(...args: number[]): any[];
popObject(): any;
pushObject(obj: any): any;
pushObjects(...args: any[]): any[];
reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any;
reject: ItemIndexEnumerableCallbackTarget;
rejectBy(key: string, value?: string): any[];
removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[];
removeAt(start: number, len: number): any;
removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable;
replace(idx: number, amt: number, objects: any[]): any;
replaceContent(idx: number, amt: number, objects: any[]): void;
reverseObjects(): any[];
setEach(key: string, value?: any): any;
setObjects(objects: any[]): any[];
shiftObject(): any;
slice(beginIndex?: number, endIndex?: number): any[];
some(callback: Function, target?: any): boolean;
toArray(): any[];
uniq(): Enumerable;
unshiftObject(object: any): any;
unshiftObjects(objects: any[]): any[];
without(value: any): Enumerable;
'[]': any[];
'@each': EachProxy;
Boolean: boolean;
firstObject: any;
hasEnumerableObservers: boolean;
lastObject: any;
length: number;
addObject(object: any): any;
addObjects(objects: Enumerable): MutableEnumberable;
removeObject(object: any): any;
removeObjects(objects: Enumerable): MutableEnumberable;
}
var BOOTED: boolean;
/**
Connects the properties of two objects so that whenever the value of one property changes,
the other property will be changed also.
**/
class Binding {
constructor(toPath: string, fromPath: string);
connect(obj: any): Binding;
copy(): Binding;
disconnect(obj: any): Binding;
from(path: string): Binding;
static oneWay(from: string, flag?: boolean): Binding;
to(path: string): Binding;
to(pathTuple: any[]): Binding;
toString(): string;
}
class Button extends View implements TargetActionSupport {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
triggerAction(opts: {}): boolean;
}
/**
The internal class used to create text inputs when the {{input}} helper is used
with type of checkbox. See Handlebars.helpers.input for usage details.
**/
class Checkbox extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
}
/**
An Ember.View descendent responsible for managing a collection (an array or array-like object)
by maintaining a child view object and associated DOM representation for each item in the array
and ensuring that child views and their associated rendered HTML are updated when items in the
array are added, removed, or replaced.
**/
class CollectionView extends ContainerView {
arrayDidChange(content: any[], start: number, removed: number, added: number): void;
arrayWillChange(content: any[], start: number, removed: number): void;
createChildView(viewClass: {}, attrs?: {}): CollectionView;
destroy(): CollectionView;
init(): void;
static CONTAINER_MAP: {};
content: any[];
emptyView: View;
itemViewClass: View;
}
/**
Implements some standard methods for comparing objects. Add this mixin to any class
you create that can compare its instances.
**/
class Comparable {
compare(a: any, b: any): number;
}
/**
A view that is completely isolated. Property access in its templates go to the view object
and actions are targeted at the view object. There is no access to the surrounding context or
outer controller; all contextual information is passed in.
**/
class Component extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
sendAction(action: string, context: any): void;
targetObject: Controller;
}
/**
A computed property transforms an objects function into a property.
By default the function backing the computed property will only be called once and the result
will be cached. You can specify various properties that your computed property is dependent on.
This will force the cached result to be recomputed if the dependencies are modified.
**/
class ComputedProperty {
cacheable(aFlag?: boolean): ComputedProperty;
get(keyName: string): any;
meta(meta: {}): ComputedProperty;
property(...args: string[]): ComputedProperty;
readOnly(): ComputedProperty;
set(keyName: string, newValue: any, oldValue: string): any;
// ReSharper disable UsingOfReservedWord
volatile(): ComputedProperty;
// ReSharper restore UsingOfReservedWord
}
class Container {
constructor(parent: Container);
parent: Container;
children: any[];
resolver: Function;
registry: {};
cache: {};
typeInjections: {};
injections: {};
child(): Container;
set(object: {}, key: string, value: any): void;
/**
registers a factory for later injection
@param fullName type:name (e.g., 'model:user')
@param factory (e.g., App.Person)
**/
register(fullName: string, factory: Function, options?: {}): void;
unregister(fullName: string): void;
resolve(fullName: string): Function;
describe(fullName: string): string;
normalize(fullName: string): string;
makeToString(factory: any, fullName: string): Function;
lookup(fullName: string, options?: {}): any;
lookupFactory(fullName: string): any;
has(fullName: string): boolean;
optionsForType(type: string, options: {}): void;
options(type: string, options: {}): void;
injection(factoryName: string, property: string, injectionName: string): void;
factoryInjection(factoryName: string, property: string, injectionName: string): void;
destroy(): void;
reset(): void;
}
/**
An Ember.View subclass that implements Ember.MutableArray allowing programatic
management of its child views.
**/
class ContainerView extends View {
static detect(obj: any): boolean;
static detectInstance(obj: any): boolean;
/**
Iterate over each computed property for the class, passing its name and any
associated metadata (see metaForProperty) to the callback.
**/
static eachComputedProperty(callback: Function, binding: {}): void;
/**
Returns the original hash that was passed to meta().
@param key property name
**/
static metaForProperty(key: string): {};
static isClass: boolean;
static isMethod: boolean;
}
class Controller extends Object implements ControllerMixin {
replaceRoute(name: string, ...args: any[]): void;
transitionToRoute(name: string, ...args: any[]): void;
controllers: {};
model: any;
needs: string[];
queryParams: any;
target: any;
send(name: string, ...args: any[]): void;
actions: ActionsHash;
}
/**
Additional methods for the ControllerMixin.
**/
class ControllerMixin extends ActionHandlerMixin {
replaceRoute(name: string, ...args: any[]): void;
transitionToRoute(name: string, ...args: any[]): void;
controllers: {};
model : any;
needs: string[];
queryParams: any;
target: any;
}
/**
Implements some standard methods for copying an object. Add this mixin to any object you
create that can create a copy of itself. This mixin is added automatically to the built-in array.
You should generally implement the copy() method to return a copy of the receiver.
Note that frozenCopy() will only work if you also implement Ember.Freezable.
**/
class Copyable {
copy(deep: boolean): Copyable;
frozenCopy(): Copyable;
}
class CoreObject {
/**
An overridable method called when objects are instantiated. By default,
does nothing unless it is overridden during class definition.
@method init
**/
init(): void;
/**
Defines the properties that will be concatenated from the superclass (instead of overridden).
@property concatenatedProperties
@type Array
@default null
**/
concatenatedProperties: any[];
/**
Destroyed object property flag. If this property is true the observers and bindings were
already removed by the effect of calling the destroy() method.
@property isDestroyed
@default false
**/
isDestroyed: boolean;
/**
Destruction scheduled flag. The destroy() method has been called. The object stays intact
until the end of the run loop at which point the isDestroyed flag is set.
@property isDestroying
@default false
**/
isDestroying: boolean;
/**
Destroys an object by setting the `isDestroyed` flag and removing its
metadata, which effectively destroys observers and bindings.
If you try to set a property on a destroyed object, an exception will be
raised.
Note that destruction is scheduled for the end of the run loop and does not
happen immediately. It will set an isDestroying flag immediately.
@method destroy
@return {Ember.Object} receiver
*/
destroy(): CoreObject;
/**
Override to implement teardown.
@method willDestroy
*/
willDestroy(): void;
/**
Returns a string representation which attempts to provide more information than Javascript's toString
typically does, in a generic way for all Ember objects (e.g., "<App.Person:ember1024>").
@method toString
@return {String} string representation
**/
toString(): string;
static isClass: boolean;
static isMethod: boolean;
/**
Creates a new subclass.
@method extend
@static