-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
3277 lines (3277 loc) · 154 KB
/
index.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
declare namespace Ember {
/**
* Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only). Ember build tools will remove any calls to `Ember.deprecate()` when doing a production build.
*/
export function deprecate(message: string, test: boolean, options: {});
/**
* Define an assertion that will throw an exception if the condition is not met. Ember build tools will remove any calls to `Ember.assert()` when doing an Ember.js framework production build and will make the assertion a no-op for an application production build. Example:
*/
export function assert(desc: string, test: boolean);
/**
* Display a debug notice. Ember build tools will remove any calls to `Ember.debug()` when doing a production build.
*/
export function debug(message: string);
/**
* Run a function meant for debugging. Ember build tools will remove any calls to `Ember.runInDebug()` when doing a production build.
*/
export function runInDebug(func: Function);
/**
* Display a warning with the provided message. Ember build tools will remove any calls to `Ember.warn()` when doing a production build.
*/
export function warn(message: string, test: boolean, options: {});
/**
* Copy properties from a source object to a target object.
*/
export function assign(original: {}, args: {}): {};
/**
* Debug parameter you can turn on. This will log all bindings that fire to the console. This should be disabled in production code. Note that you can also enable this from the console or temporarily.
*/
export var LOG_BINDINGS: boolean;
/**
* Global helper method to create a new binding. Just pass the root object along with a `to` and `from` path to create and connect the binding.
*/
export function bind(obj: {}, to: string, from: string): Binding;
/**
* Returns the cached value for a property, if one exists. This can be useful for peeking at the value of a computed property that is generated lazily, without accidentally causing it to be created.
*/
export function cacheFor(obj: {}, key: string): {};
/**
* The semantic version.
*/
export var VERSION: string;
/**
* The hash of environment variables used to control various configuration settings. To specify your own or override default settings, add the desired properties to a global hash named `EmberENV` (or `ENV` for backwards compatibility with earlier versions of Ember). The `EmberENV` hash must be created before loading Ember.
*/
export var ENV: {};
/**
* Determines whether Ember should add to `Array`, `Function`, and `String` native object prototypes, a few extra methods in order to provide a more friendly API.
*/
export var EXTEND_PROTOTYPES: boolean;
/**
* The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log a full stack trace during deprecation warnings.
*/
export var LOG_STACKTRACE_ON_DEPRECATION: boolean;
/**
* The `LOG_VERSION` property, when true, tells Ember to log versions of all dependent libraries in use.
*/
export var LOG_VERSION: boolean;
/**
* An empty function useful for some operations. Always returns `this`.
*/
export function K(): {};
/**
* Add an event listener
*/
export function addListener(obj: any, eventName: string, target: {}|Function, method: Function|string, once: boolean);
/**
* Remove an event listener
*/
export function removeListener(obj: any, eventName: string, target: {}|Function, method: Function|string);
/**
* Send an event. The execution of suspended listeners is skipped, and once listeners are removed. A listener without a target is executed on the passed object. If an array of actions is not passed, the actions stored on the passed object are invoked.
*/
export function sendEvent(obj: any, eventName: string, params: any[], actions: any[]): void;
/**
* Define a property as a function that should be executed when a specified event or events are triggered.
*/
export function on(eventNames: string, func: Function): void;
/**
* To get multiple properties at once, call `Ember.getProperties` with an object followed by a list of strings or an array:
*/
export function getProperties(obj: {}, ...list: string[]): {};
/**
* A value is blank if it is empty or a whitespace string.
*/
export function isBlank(obj: {}): boolean;
/**
* Verifies that a value is `null` or an empty string, empty array, or empty function.
*/
export function isEmpty(obj: {}): boolean;
/**
* Returns true if the passed value is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing.
*/
export function isNone(obj: {}): boolean;
/**
* A value is present if it not `isBlank`.
*/
export function isPresent(obj: {}): boolean;
/**
* Merge the contents of two objects together into the first object.
*/
export function merge(original: {}, updates: {}): {};
/**
* Makes a method available via an additional name.
*/
export function aliasMethod(methodName: string);
/**
* Specify a method that observes property changes.
*/
export function observer(propertyNames: string, func: Function): void;
export function addObserver(obj: any, _path: string, target: {}|Function, method: Function|string);
export function removeObserver(obj: any, path: string, target: {}|Function, method: Function|string);
/**
* Gets the value of a property on an object. If the property is computed, the function will be invoked. If the property is not defined but the object implements the `unknownProperty` method then that will be invoked.
*/
export function get(obj: {}, keyName: string): {};
/**
* Retrieves the value of a property from an Object, or a default value in the case that the property returns `undefined`.
*/
export function getWithDefault(obj: {}, keyName: string, defaultValue: {}): {};
/**
* Sets the value of a property on an object, respecting computed properties and notifying observers and other listeners of the change. If the property is not defined but the object implements the `setUnknownProperty` method then that will be invoked as well.
*/
export function set(obj: {}, keyName: string, value: {}): {};
/**
* Error-tolerant form of `Ember.set`. Will not blow up if any part of the chain is `undefined`, `null`, or destroyed.
*/
export function trySet(root: {}, path: string, value: {});
/**
* Set a list of properties on an object. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered.
*/
export function setProperties(obj: any, properties: {}): void;
/**
* Returns a unique id for the object. If the object does not yet have a guid, one will be assigned to it. You can call this on any object, `Ember.Object`-based or not, but be aware that it will add a `_guid` property.
*/
export function guidFor(obj: {}): string;
/**
* Checks to see if the `methodName` exists on the `obj`, and if it does, invokes it with the arguments passed.
*/
export function tryInvoke(obj: {}, methodName: string, args: any[]): any;
/**
* 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 guarantee that `Ember.EXTEND_PROTOTYPES` will be `true`.
*/
export function A(): NativeArray;
/**
* Compares two javascript values and returns:
*/
export function compare(v: {}, w: {}): number;
/**
* Creates a shallow copy of the passed object. A deep copy of the object is returned if the optional `deep` argument is `true`.
*/
export function copy(obj: {}, deep: boolean): {};
/**
* Compares two objects, returning true if they are equal.
*/
export function isEqual(a: {}, b: {}): boolean;
/**
* Returns true if the passed object is an array or Array-like.
*/
export function isArray(obj: {}): boolean;
/**
* Returns a consistent type for the passed object.
*/
export function typeOf(item: {}): string;
/**
* Alias for jQuery
*/
export function $();
export namespace RSVP {
export class EventTarget {
}
/**
* Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise’s eventual value or the reason why the promise cannot be fulfilled.
*/
export class Promise {
/**
* The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled.
*/
then(onFulfillment: Function, onRejection: Function, label: string): Ember.RSVP.Promise;
/**
* `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement.
*/
catch(onRejection: Function, label: string): Ember.RSVP.Promise;
/**
* `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves
*/
finally(callback: Function, label: string): Ember.RSVP.Promise;
}
}
export namespace ApplicationInstance {
/**
* A list of boot-time configuration options for customizing the behavior of an `Ember.ApplicationInstance`.
*/
export class BootOptions {
/**
* Run in a full browser environment.
*/
isBrowser: boolean;
/**
* Disable rendering completely.
*/
shouldRender: boolean;
/**
* If present, render into the given `Document` object instead of the global `window.document` object.
*/
document: Document;
/**
* If present, overrides the application's `rootElement` property on the instance. This is useful for testing environment, where you might want to append the root view to a fixture area.
*/
rootElement: string|Element;
/**
* If present, overrides the router's `location` property with this value. This is useful for environments where trying to modify the URL would be inappropriate.
*/
location: string;
}
}
export namespace streams {
export namespace Ember {
export class stream {
}
}
export class Dependency {
}
export class Subscriber {
}
}
export namespace stream {
export class Stream {
}
}
export namespace Test {
/**
* Loads a route, sets up any controllers, and renders any templates associated with the route as though a real user had triggered the route change while using your app.
*/
export function visit(url: string): Ember.RSVP.Promise;
/**
* Clicks an element and triggers any actions triggered by the element's `click` event.
*/
export function click(selector: string): Ember.RSVP.Promise;
/**
* Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
*/
export function keyEvent(selector: string, type: string, keyCode: number): Ember.RSVP.Promise;
/**
* Fills in an input element with some text.
*/
export function fillIn(selector: string, text: string): Ember.RSVP.Promise;
/**
* Finds an element in the context of the app's container element. A simple alias for `app.$(selector)`.
*/
export function find(selector: string): {};
/**
* Like `find`, but throws an error if the element selector returns no results.
*/
export function findWithAssert(selector: string): {};
/**
* Causes the run loop to process any pending events. This is used to ensure that any async operations from other helpers (or your assertions) have been processed.
*/
export function wait(value: {}): Ember.RSVP.Promise;
/**
* Returns the currently active route name.
*/
export function currentRouteName(): {};
/**
* Returns the current path.
*/
export function currentPath(): {};
/**
* Returns the current URL.
*/
export function currentURL(): {};
/**
* Pauses the current test - this is useful for debugging while testing or for test-driving. It allows you to inspect the state of your application at any point.
*/
export function pauseTest(): {};
/**
* Triggers the given DOM event on the element identified by the provided selector.
*/
export function triggerEvent(selector: string, context: string, type: string, options: {}): Ember.RSVP.Promise;
/**
* 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).
*/
export function setupForTesting();
/**
* `registerHelper` is used to register a test helper that will be injected when `App.injectTestHelpers` is called.
*/
export function registerHelper(name: string, helperMethod: Function, options: {});
/**
* `registerAsyncHelper` is used to register an async test helper that will be injected when `App.injectTestHelpers` is called.
*/
export function registerAsyncHelper(name: string, helperMethod: Function);
/**
* Remove a previously added helper method.
*/
export function unregisterHelper(name: string);
/**
* Used to register callbacks to be fired whenever `App.injectTestHelpers` is called.
*/
export function onInjectHelpers(callback: Function);
/**
* This returns a thenable tailored for testing. It catches failed `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` callback in the last chained then.
*/
export function promise(resolver: Function, label: string);
/**
* Used to allow ember-testing to communicate with a specific testing framework.
*/
export var adapter: any;
/**
* Replacement for `Ember.RSVP.resolve` The only difference is this uses an instance of `Ember.Test.Promise`
*/
export function resolve(The: any);
/**
* This allows ember-testing to play nicely with other asynchronous events, such as an application that is waiting for a CSS3 transition or an IndexDB transaction.
*/
export function registerWaiter(context: {}, callback: Function);
/**
* `unregisterWaiter` is used to unregister a callback that was registered with `registerWaiter`.
*/
export function unregisterWaiter(context: {}, callback: Function);
/**
* This property contains the testing helpers for the current application. These are created once you call `injectTestHelpers` on your `Ember.Application` instance. The included helpers are also available on the `window` object by default, but can be used from this object on the individual application also.
*/
export var testHelpers: {};
/**
* This property indicates whether or not this application is currently in testing mode. This is set when `setupForTesting` is called on the current application.
*/
export var testing: boolean;
/**
* This injects the test helpers into the `helperContainer` object. If an object is provided it will be used as the helperContainer. If `helperContainer` is not set it will default to `window`. 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`).
*/
export function injectTestHelpers();
/**
* This removes all helpers that have been registered, and resets and functions that were overridden by the helpers.
*/
export function removeTestHelpers();
/**
* The primary purpose of this class is to create hooks that can be implemented by an adapter for various test frameworks.
*/
export class Adapter {
/**
* This callback will be called whenever an async operation is about to start.
*/
asyncStart();
/**
* This callback will be called whenever an async operation has completed.
*/
asyncEnd();
/**
* Override this method with your testing framework's false assertion. This function is called whenever an exception occurs causing the testing promise to fail.
*/
exception(error: string);
}
/**
* This class implements the methods defined by Ember.Test.Adapter for the QUnit testing framework.
*/
export class QUnitAdapter extends Adapter {
}
}
/**
* The `ApplicationInstance` encapsulates all of the stateful aspects of a running `Application`.
*/
export class ApplicationInstance extends EngineInstance {
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): ApplicationInstance;
}
/**
* 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.
*/
export class Application extends Engine implements RegistryProxyMixin {
/**
* The root DOM element of the Application. This can be specified as an element or a [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).
*/
rootElement: DOMElement;
/**
* The `Ember.EventDispatcher` responsible for delegating events to this application's views.
*/
eventDispatcher: EventDispatcher;
/**
* The DOM events for which the event dispatcher should listen.
*/
customEvents: {};
/**
* Use this to defer readiness until some condition is true.
*/
deferReadiness();
/**
* 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();
/**
* Reset the application. This is typically used only in tests. It cleans up the application in the following order:
*/
reset();
/**
* Boot a new instance of `Ember.ApplicationInstance` for the current application and navigate it to the given `url`. Returns a `Promise` that resolves with the instance when the initial routing and rendering is complete, or rejects with any error that occured during the boot process.
*/
visit(url: string, options: ApplicationInstance.BootOptions): Promise<Ember.ApplicationInstance|Error>;
/**
* This creates a registry with the default Ember naming conventions.
*/
static buildRegistry(namespace: Application): Registry;
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): Application;
/**
* Given a fullName return the corresponding factory.
*/
resolveRegistration(fullName: string): Function;
/**
* Registers a factory that can be used for dependency injection (with `inject`) or for service lookup. Each factory is registered with a full name including two parts: `type:name`.
*/
register(fullName: string, factory: Function, options: {});
/**
* Unregister a factory.
*/
unregister(fullName: string);
/**
* Check if a factory is registered.
*/
hasRegistration(fullName: string): boolean;
/**
* Register an option for a particular factory.
*/
registerOption(fullName: string, optionName: string, options: {});
/**
* Return a specific registered option for a particular factory.
*/
registeredOption(fullName: string, optionName: string): {};
/**
* Register options for a particular factory.
*/
registerOptions(fullName: string, options: {});
/**
* Return registered options for a particular factory.
*/
registeredOptions(fullName: string): {};
/**
* Allow registering options for all factories of a type.
*/
registerOptionsForType(type: string, options: {});
/**
* Return the registered options for all factories of a type.
*/
registeredOptionsForType(type: string): {};
/**
* Define a dependency injection onto a specific factory or all factories of a type.
*/
inject(factoryNameOrType: string, property: string, injectionName: string);
}
/**
* The `EngineInstance` encapsulates all of the stateful aspects of a running `Engine`.
*/
export class EngineInstance extends Ember.Object implements RegistryProxyMixin, ContainerProxyMixin {
/**
* Unregister a factory.
*/
unregister(fullName: string);
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): EngineInstance;
/**
* Given a fullName return the corresponding factory.
*/
resolveRegistration(fullName: string): Function;
/**
* Registers a factory that can be used for dependency injection (with `inject`) or for service lookup. Each factory is registered with a full name including two parts: `type:name`.
*/
register(fullName: string, factory: Function, options: {});
/**
* Check if a factory is registered.
*/
hasRegistration(fullName: string): boolean;
/**
* Register an option for a particular factory.
*/
registerOption(fullName: string, optionName: string, options: {});
/**
* Return a specific registered option for a particular factory.
*/
registeredOption(fullName: string, optionName: string): {};
/**
* Register options for a particular factory.
*/
registerOptions(fullName: string, options: {});
/**
* Return registered options for a particular factory.
*/
registeredOptions(fullName: string): {};
/**
* Allow registering options for all factories of a type.
*/
registerOptionsForType(type: string, options: {});
/**
* Return the registered options for all factories of a type.
*/
registeredOptionsForType(type: string): {};
/**
* Define a dependency injection onto a specific factory or all factories of a type.
*/
inject(factoryNameOrType: string, property: string, injectionName: string);
/**
* Returns an object that can be used to provide an owner to a manually created instance.
*/
ownerInjection(): {};
/**
* Given a fullName return a corresponding instance.
*/
lookup(fullName: string, options: {}): any;
}
/**
* The `Engine` class contains core functionality for both applications and engines.
*/
export class Engine extends Namespace {
/**
* The goal of initializers should be to register dependencies and injections. This phase runs once. Because these initializers may load code, they are allowed to defer application readiness and advance it. If you need to access the container or store you should use an InstanceInitializer that will be run after all initializers and therefore after all code is loaded and the app is ready.
*/
initializer(initializer: {});
/**
* Instance initializers run after all initializers have run. Because instance initializers run after the app is fully set up. We have access to the store, container, and other items. However, these initializers run after code has loaded and are not allowed to defer readiness.
*/
instanceInitializer(instanceInitializer: any);
/**
* This creates a registry with the default Ember naming conventions.
*/
static buildRegistry(namespace: Application): Registry;
/**
* Set this to provide an alternate class to `Ember.DefaultResolver`
*/
resolver: any;
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): Engine;
}
/**
* The DefaultResolver defines the default lookup rules to resolve container lookups before consulting the container for registered items:
*/
export class DefaultResolver extends Ember.Object {
/**
* This will be set to the Application instance when it is created.
*/
namespace: any;
/**
* This method is called via the container's resolver method. It parses the provided `fullName` and then looks up and returns the appropriate template or class.
*/
resolve(fullName: string): {};
/**
* Convert the string name of the form 'type:name' to a Javascript object with the parsed aspects of the name broken out.
*/
parseName(fullName: string);
/**
* Returns a human-readable description for a fullName. Used by the Application namespace in assertions to describe the precise name of the class that Ember is looking for, rather than container keys.
*/
lookupDescription(fullName: string);
/**
* Given a parseName object (output from `parseName`), apply the conventions expected by `Ember.Router`
*/
useRouterNaming(parsedName: {});
/**
* Look up the template in Ember.TEMPLATES
*/
resolveTemplate(parsedName: {});
/**
* Lookup the view using `resolveOther`
*/
resolveView(parsedName: {});
/**
* Lookup the controller using `resolveOther`
*/
resolveController(parsedName: {});
/**
* Lookup the route using `resolveOther`
*/
resolveRoute(parsedName: {});
/**
* Lookup the model on the Application namespace
*/
resolveModel(parsedName: {});
/**
* Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application)
*/
resolveHelper(parsedName: {});
/**
* Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application)
*/
resolveOther(parsedName: {});
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): DefaultResolver;
}
export class Debug {
/**
* Allows for runtime registration of handler functions that override the default deprecation behavior. Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). The following example demonstrates its usage by registering a handler that throws an error if the message contains the word "should", otherwise defers to the default handler.
*/
static registerDeprecationHandler(handler: Function);
/**
* Allows for runtime registration of handler functions that override the default warning behavior. Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). The following example demonstrates its usage by registering a handler that does nothing overriding Ember's default warning behavior.
*/
static registerWarnHandler(handler: Function);
}
/**
* The `ContainerDebugAdapter` helps the container and resolver interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox.
*/
export class ContainerDebugAdapter extends Ember.Object {
/**
* The resolver instance of the application being debugged. This property will be injected on creation.
*/
resolver: any;
/**
* Returns true if it is possible to catalog a list of available classes in the resolver for a given type.
*/
canCatalogEntriesByType(type: string): boolean;
/**
* Returns the available classes a given type.
*/
catalogEntriesByType(type: string): any[];
/**
* Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
*/
static create(args: any): ContainerDebugAdapter;
}
/**
* The `DataAdapter` helps a data persistence library interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox.
*/
export class DataAdapter {
/**
* The container-debug-adapter which is used to list all models.
*/
containerDebugAdapter: any;
/**
* Ember Data > v1.0.0-beta.18 requires string model names to be passed around instead of the actual factories.
*/
acceptsModelName: any;
/**
* Specifies how records can be filtered. Records returned will need to have a `filterValues` property with a key for every name in the returned array.
*/
getFilters(): any[];
/**
* Fetch the model types and observe them for changes.
*/
watchModelTypes(typesAdded: Function, typesUpdated: Function): Function;
/**
* Fetch the records of a given type and observe them for changes.
*/
watchRecords(modelName: string, recordsAdded: Function, recordsUpdated: Function, recordsRemoved: Function): Function;
}
export class HTMLBars {
}
/**
* Defines string helper methods including string formatting and localization. Unless `Ember.EXTEND_PROTOTYPES.String` is `false` these methods will also be added to the `String.prototype` as well.
*/
export class String {
/**
* Mark a string as safe for unescaped output with Ember templates. If you return HTML from a helper, use this function to ensure Ember's rendering layer does not escape the HTML.
*/
static htmlSafe(): Handlebars.SafeString;
/**
* DEPRECATED: Use ES6 template strings instead: http://babeljs.io/docs/learn-es2015/#template-strings
* Apply formatting options to the string. This will look for occurrences of "%@" in your string and substitute them with the arguments you pass into this method. If you want to control the specific order of replacement, you can add a number after the key as well to indicate which argument you want to insert.
*/
fmt(str: string, formats: any[]): string;
/**
* Formats the passed string, but first looks up the string in the localized strings hash. This is a convenient way to localize text. See `Ember.String.fmt()` for more information on formatting.
*/
loc(str: string, formats: any[]): string;
/**
* Splits a string into separate units separated by spaces, eliminating any empty strings in the process. This is a convenience method for split that is mostly useful when applied to the `String.prototype`.
*/
w(str: string): any[];
/**
* Converts a camelized string into all lower case separated by underscores.
*/
decamelize(str: string): string;
/**
* Replaces underscores, spaces, or camelCase with dashes.
*/
dasherize(str: string): string;
/**
* Returns the lowerCamelCase form of a string.
*/
camelize(str: string): string;
/**
* Returns the UpperCamelCase form of a string.
*/
classify(str: string): string;
/**
* More general than decamelize. Returns the lower\_case\_and\_underscored form of a string.
*/
underscore(str: string): string;
/**
* Returns the Capitalized form of a string
*/
capitalize(str: string): string;
}
/**
* Ember Helpers are functions that can compute values, and are used in templates. For example, this code calls a helper named `format-currency`:
*/
export class Helper {
/**
* On a class-based helper, it may be useful to force a recomputation of that helpers value. This is akin to `rerender` on a component.
*/
recompute();
/**
* Override this function when writing a class-based helper.
*/
compute(params: any[], hash: {});
/**
* In many cases, the ceremony of a full `Ember.Helper` class is not required. The `helper` method create pure-function helpers without instances. For example:
*/
static helper(helper: Function);
}
/**
* An `Ember.Binding` connects the properties of two objects so that whenever the value of one property changes, the other property will be changed also.
*/
export class Binding {
/**
* This copies the Binding so it can be connected to another object.
*/
copy(): Binding;
/**
* This will set `from` property path to the specified value. It will not attempt to resolve this property path to an actual object until you connect the binding.
*/
from(path: string): Binding;
/**
* This will set the `to` property path to the specified value. It will not attempt to resolve this property path to an actual object until you connect the binding.
*/
to(path: string|any[]): Binding;
/**
* Configures the binding as one way. A one-way binding will relay changes on the `from` side to the `to` side, but not the other way around. This means that if you change the `to` side directly, the `from` side may have a different value.
*/
oneWay(): Binding;
toString(): string;
/**
* Attempts to connect this binding instance so that it can receive and relay changes. This method will raise an exception if you have not set the from/to properties yet.
*/
connect(obj: {}): Binding;
/**
* Disconnects the binding instance. Changes will no longer be relayed. You will not usually need to call this method.
*/
disconnect(): Binding;
}
/**
* A computed property transforms an object literal with object's accessor function(s) into a property.
*/
export class ComputedProperty {
/**
* Call on a computed property to set it into non-cached mode. When in this mode the computed property will not automatically cache the return value.
*/
volatile(): ComputedProperty;
/**
* Call on a computed property to set it into read-only mode. When in this mode the computed property will throw an error when set.
*/
readOnly(): ComputedProperty;
/**
* Sets the dependent keys on this computed property. Pass any number of arguments containing key paths that this computed property depends on.
*/
property(path: string): ComputedProperty;
/**
* In some cases, you may want to annotate computed properties with additional metadata about how they function or what values they operate on. For example, computed property functions may close over variables that are then no longer available for introspection.
*/
meta(meta: {});
/**
* Access the value of the function backing the computed property. If this property has already been cached, return the cached result. Otherwise, call the function passing the property name as an argument.
*/
get(keyName: string): {};
/**
* Set the value of a computed property. If the function that backs your computed property does not accept arguments then the default action for setting would be to define the property on the current object, and set the value of the property to the value being set.
*/
set(keyName: string, newValue: {}): {};
}
/**
* This helper returns a new property descriptor that wraps the passed computed property function. You can use this helper to define properties with mixins or via `Ember.defineProperty()`.
*/
export class computed {
/**
* A computed property that returns true if the value of the dependent property is null, an empty string, empty array, or empty function.
*/
empty(dependentKey: string): ComputedProperty;
/**
* A computed property that returns true if the value of the dependent property is NOT null, an empty string, empty array, or empty function.
*/
notEmpty(dependentKey: string): ComputedProperty;
/**
* A computed property that returns true if the value of the dependent property is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing.
*/
none(dependentKey: string): ComputedProperty;
/**
* A computed property that returns the inverse boolean value of the original value for the dependent property.
*/
not(dependentKey: string): ComputedProperty;
/**
* A computed property that converts the provided dependent property into a boolean value.
*/
bool(dependentKey: string): ComputedProperty;
/**
* A computed property which matches the original value for the dependent property against a given RegExp, returning `true` if the value matches the RegExp and `false` if it does not.
*/
match(dependentKey: string, regexp: RegExp): ComputedProperty;
/**
* A computed property that returns true if the provided dependent property is equal to the given value.
*/
equal(dependentKey: string, value: string|number|{}): ComputedProperty;
/**
* A computed property that returns true if the provided dependent property is greater than the provided value.
*/
gt(dependentKey: string, value: number): ComputedProperty;
/**
* A computed property that returns true if the provided dependent property is greater than or equal to the provided value.
*/
gte(dependentKey: string, value: number): ComputedProperty;
/**
* A computed property that returns true if the provided dependent property is less than the provided value.
*/
lt(dependentKey: string, value: number): ComputedProperty;
/**
* A computed property that returns true if the provided dependent property is less than or equal to the provided value.
*/
lte(dependentKey: string, value: number): ComputedProperty;
/**
* A computed property that performs a logical `and` on the original values for the provided dependent properties.
*/
and(dependentKey: string): ComputedProperty;
/**
* A computed property which performs a logical `or` on the original values for the provided dependent properties.
*/
or(dependentKey: string): ComputedProperty;
/**
* Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property.
*/
alias(dependentKey: string): ComputedProperty;
/**
* Where `computed.alias` aliases `get` and `set`, and allows for bidirectional data flow, `computed.oneWay` only provides an aliased `get`. The `set` will not mutate the upstream property, rather causes the current property to become the value set. This causes the downstream property to permanently diverge from the upstream property.
*/
oneWay(dependentKey: string): ComputedProperty;
/**
* This is a more semantically meaningful alias of `computed.oneWay`, whose name is somewhat ambiguous as to which direction the data flows.
*/
reads(dependentKey: string): ComputedProperty;
/**
* Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides a readOnly one way binding. Very often when using `computed.oneWay` one does not also want changes to propagate back up, as they will replace the value.
*/
readOnly(dependentKey: string): ComputedProperty;
/**
* Creates a new property that is an alias for another property on an object. Calls to `get` or `set` this property behave as though they were called on the original property, but also print a deprecation warning.
*/
deprecatingAlias(dependentKey: string): ComputedProperty;
/**
* A computed property that returns the sum of the values in the dependent array.
*/
sum(dependentKey: string): ComputedProperty;
/**
* A computed property that calculates the maximum value in the dependent array. This will return `-Infinity` when the dependent array is empty.
*/
max(dependentKey: string): ComputedProperty;
/**
* A computed property that calculates the minimum value in the dependent array. This will return `Infinity` when the dependent array is empty.
*/
min(dependentKey: string): ComputedProperty;
/**
* Returns an array mapped via the callback
*/
map(dependentKey: string, callback: Function): ComputedProperty;
/**
* Returns an array mapped to the specified key.
*/
mapBy(dependentKey: string, propertyKey: string): ComputedProperty;
/**
* Filters the array by the callback.
*/
filter(dependentKey: string, callback: Function): ComputedProperty;
/**
* Filters the array by the property and value
*/
filterBy(dependentKey: string, propertyKey: string, value: any): ComputedProperty;
/**
* A computed property which returns a new array with all the unique elements from one or more dependent arrays.
*/
uniq(propertyKey: string): ComputedProperty;
/**
* Alias for [Ember.computed.uniq](/api/#method_computed_uniq).
*/
union(propertyKey: string): ComputedProperty;
/**
* A computed property which returns a new array with all the duplicated elements from two or more dependent arrays.
*/
intersect(propertyKey: string): ComputedProperty;
/**
* A computed property which returns a new array with all the properties from the first dependent array that are not in the second dependent array.
*/
setDiff(setAProperty: string, setBProperty: string): ComputedProperty;
/**
* A computed property that returns the array of values for the provided dependent properties.
*/
collect(dependentKey: string): ComputedProperty;
/**
* A computed property which returns a new array with all the properties from the first dependent array sorted based on a property or sort function.
*/
sort(itemsKey: string, sortDefinition: string): ComputedProperty;
}
/**
* A subclass of the JavaScript Error object for use in Ember.
*/
export class Error {
}
/**
* The hash of enabled Canary features. Add to this, any canary features before creating your application.
*/
export class FEATURES {
/**
* Determine whether the specified `feature` is enabled. Used by Ember's build tools to exclude experimental features from beta/stable builds.
*/
isEnabled(feature: string): boolean;
}
/**
* Read-only property that returns the result of a container lookup.
*/
export class InjectedProperty {
}
/**
* The purpose of the Ember Instrumentation module is to provide efficient, general-purpose instrumentation for Ember.
*/
export class Instrumentation {
}
/**
* Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality.
*/
export class Logger {
/**
* Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space.
*/
log(args: any);
/**
* Prints the arguments to the console with a warning icon. You can pass as many arguments as you want and they will be joined together with a space.
*/
warn(args: any);
/**
* Prints the arguments to the console with an error icon, red text and a stack trace. You can pass as many arguments as you want and they will be joined together with a space.
*/
error(args: any);
/**
* Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space.
*/
info(args: any);
/**
* Logs the arguments to the console in blue text. You can pass as many arguments as you want and they will be joined together with a space.
*/
debug(args: any);
/**
* If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
*/
assert(bool: boolean);
}
/**
* This class is used internally by Ember and Ember Data. Please do not use it at this time. We plan to clean it up and add many tests soon.
*/
export class OrderedSet {
}
/**
* A Map stores values indexed by keys. Unlike JavaScript's default Objects, the keys of a Map can be any JavaScript object.
*/
export class Map {
}
export class MapWithDefault extends Map {
}
/**
* The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance,
*/
export class Mixin {
static create(args: any): Mixin;
}
/**
* Runs the passed target and method inside of a RunLoop, ensuring any deferred actions including bindings and views updates are flushed at the end.
*/
export class run {
/**
* DEPRECATED:
* Replaces objects in an array with the passed objects.
*/
replace(array: any[], idx: number, amt: number, objects: any[]): any[];
/**
* If no run-loop is present, it creates a new one. If a run loop is present it will queue itself to run on the existing run-loops action queue.
*/
join(target: {}, method: Function|string, ...args: any[]): {};
/**
* Allows you to specify which context to call the specified function in while adding the execution of that function to the Ember run loop. This ability makes this method a great way to asynchronously integrate third-party libraries into your Ember application.
*/
bind(target: {}, method: Function|string, ...args: any[]): Function;
/**
* Begins a new RunLoop. Any deferred actions invoked after the begin will be buffered until you invoke a matching call to `run.end()`. This is a lower-level way to use a RunLoop instead of using `run()`.
*/
begin(): void;
/**
* Ends a RunLoop. This must be called sometime after you call `run.begin()` to flush any deferred actions. This is a lower-level way to use a RunLoop instead of using `run()`.
*/
end(): void;
/**