ember-flexberry-account 0.1.0-alpha.7 → 0.1.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +58 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +46 -0
  3. package/.jscsrc +15 -15
  4. package/CHANGELOG.md +25 -17
  5. package/README.md +38 -38
  6. package/addon/components/flexberry-login.js +163 -158
  7. package/addon/components/flexberry-pwd-reset.js +123 -123
  8. package/addon/components/flexberry-recaptcha.js +115 -115
  9. package/addon/components/flexberry-register.js +226 -226
  10. package/addon/components/flexberry-user-profile.js +8 -8
  11. package/addon/controllers/email-confirmation.js +91 -91
  12. package/addon/controllers/login.js +4 -4
  13. package/addon/controllers/pwd-reset.js +4 -4
  14. package/addon/controllers/register.js +4 -4
  15. package/addon/controllers/user-profile.js +4 -4
  16. package/addon/locales/en/translations.js +63 -63
  17. package/addon/locales/ru/translations.js +65 -65
  18. package/addon/models/user-profile.js +5 -5
  19. package/addon/routes/email-confirmation.js +4 -4
  20. package/addon/routes/login.js +4 -4
  21. package/addon/routes/pwd-reset.js +4 -4
  22. package/addon/routes/reg-end.js +4 -4
  23. package/addon/routes/register.js +4 -4
  24. package/addon/routes/user-profile.js +4 -4
  25. package/addon/services/user-account.js +184 -184
  26. package/app/components/flexberry-login.js +1 -1
  27. package/app/components/flexberry-pwd-reset.js +1 -1
  28. package/app/components/flexberry-recaptcha.js +1 -1
  29. package/app/components/flexberry-register.js +1 -1
  30. package/app/components/flexberry-user-profile.js +1 -1
  31. package/app/controllers/email-confirmation.js +1 -1
  32. package/app/controllers/login.js +1 -1
  33. package/app/controllers/pwd-reset.js +1 -1
  34. package/app/controllers/register.js +1 -1
  35. package/app/controllers/user-profile.js +1 -1
  36. package/app/models/user-profile.js +1 -1
  37. package/app/routes/login.js +1 -1
  38. package/app/routes/pwd-reset.js +1 -1
  39. package/app/routes/register.js +1 -1
  40. package/app/routes/user-profile.js +1 -1
  41. package/app/services/user-account.js +82 -82
  42. package/app/templates/components/flexberry-login.hbs +53 -53
  43. package/app/templates/components/flexberry-pwd-reset.hbs +38 -38
  44. package/app/templates/components/flexberry-register.hbs +75 -75
  45. package/app/templates/components/flexberry-user-profile.hbs +1 -1
  46. package/app/templates/login.hbs +5 -5
  47. package/app/templates/pwd-reset.hbs +4 -4
  48. package/app/templates/register.hbs +4 -4
  49. package/app/templates/user-profile.hbs +3 -3
  50. package/blueprints/ember-flexberry-account/index.js +43 -43
  51. package/config/environment.js +6 -6
  52. package/index.js +6 -6
  53. package/package.json +1 -1
  54. package/scripts/deploy-to-gh-pages.sh +78 -78
  55. package/yarn.lock +7185 -0
  56. package/.npmignore +0 -16
  57. package/jsconfig.json +0 -1
  58. package/package-lock.json +0 -8894
  59. package/typings/ember/ember.d.ts +0 -3188
@@ -1,3188 +0,0 @@
1
- interface DOMElement {}
2
- interface Promise<T> {}
3
- declare class Registry {}
4
- declare class Transition {}
5
- declare namespace Handlebars { class SafeString {} }
6
- declare class JQuery {}
7
-
8
-
9
- declare module 'ember' {
10
- export namespace Ember {
11
- /**
12
- * Framework objects in an Ember application (components, services, routes, etc.) are created via a factory and dependency injection system. Each of these objects is the responsibility of an "owner", which handled its instantiation and manages its lifetime.
13
- */
14
- function getOwner(object: {}): {};
15
- /**
16
- * `setOwner` forces a new owner on a given object instance. This is primarily useful in some testing cases.
17
- */
18
- function setOwner(object: {}): {};
19
- /**
20
- * 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.
21
- */
22
- function deprecate(message: string, test: boolean, options: {});
23
- /**
24
- * 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 a production build. Example:
25
- */
26
- function assert(desc: string, test: boolean);
27
- /**
28
- * Display a debug notice. Ember build tools will remove any calls to `Ember.debug()` when doing a production build.
29
- */
30
- function debug(message: string);
31
- /**
32
- * Run a function meant for debugging. Ember build tools will remove any calls to `Ember.runInDebug()` when doing a production build.
33
- */
34
- function runInDebug(func: Function);
35
- /**
36
- * Display a warning with the provided message. Ember build tools will remove any calls to `Ember.warn()` when doing a production build.
37
- */
38
- function warn(message: string, test: boolean, options: {});
39
- /**
40
- * Copy properties from a source object to a target object.
41
- */
42
- function assign(original: {}, args: {}): {};
43
- /**
44
- * 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.
45
- */
46
- var LOG_BINDINGS: boolean;
47
- /**
48
- * 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.
49
- */
50
- function bind(obj: {}, to: string, from: string): Binding;
51
- /**
52
- * 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.
53
- */
54
- function cacheFor(obj: {}, key: string): {};
55
- /**
56
- * The semantic version.
57
- */
58
- var VERSION: string;
59
- /**
60
- * 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.
61
- */
62
- var ENV: {};
63
- /**
64
- * 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.
65
- */
66
- var EXTEND_PROTOTYPES: boolean;
67
- /**
68
- * The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log a full stack trace during deprecation warnings.
69
- */
70
- var LOG_STACKTRACE_ON_DEPRECATION: boolean;
71
- /**
72
- * The `LOG_VERSION` property, when true, tells Ember to log versions of all dependent libraries in use.
73
- */
74
- var LOG_VERSION: boolean;
75
- /**
76
- * An empty function useful for some operations. Always returns `this`.
77
- */
78
- function K(): {};
79
- /**
80
- * Add an event listener
81
- */
82
- function addListener(obj: any, eventName: string, target: {}|Function, method: Function|string, once: boolean);
83
- /**
84
- * Remove an event listener
85
- */
86
- function removeListener(obj: any, eventName: string, target: {}|Function, method: Function|string);
87
- /**
88
- * 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.
89
- */
90
- function sendEvent(obj: any, eventName: string, params: Ember.Array, actions: Ember.Array): void;
91
- /**
92
- * Define a property as a function that should be executed when a specified event or events are triggered.
93
- */
94
- function on(eventNames: string, func: Function): void;
95
- /**
96
- * To get multiple properties at once, call `Ember.getProperties` with an object followed by a list of strings or an array:
97
- */
98
- function getProperties(obj: {}, ...list: string[]): {};
99
- /**
100
- * A value is blank if it is empty or a whitespace string.
101
- */
102
- function isBlank(obj: {}): boolean;
103
- /**
104
- * Verifies that a value is `null` or an empty string, empty array, or empty function.
105
- */
106
- function isEmpty(obj: {}): boolean;
107
- /**
108
- * Returns true if the passed value is null or undefined. This avoids errors from JSLint complaining about use of ==, which can be technically confusing.
109
- */
110
- function isNone(obj: {}): boolean;
111
- /**
112
- * A value is present if it not `isBlank`.
113
- */
114
- function isPresent(obj: {}): boolean;
115
- /**
116
- * Merge the contents of two objects together into the first object.
117
- */
118
- function merge(original: {}, updates: {}): {};
119
- /**
120
- * Makes a method available via an additional name.
121
- */
122
- function aliasMethod(methodName: string);
123
- /**
124
- * Specify a method that observes property changes.
125
- */
126
- function observer(propertyNames: string, func: Function): void;
127
- function addObserver(obj: any, _path: string, target: {}|Function, method: Function|string);
128
- function removeObserver(obj: any, path: string, target: {}|Function, method: Function|string);
129
- /**
130
- * 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.
131
- */
132
- function get(obj: {}, keyName: string): {};
133
- /**
134
- * Retrieves the value of a property from an Object, or a default value in the case that the property returns `undefined`.
135
- */
136
- function getWithDefault(obj: {}, keyName: string, defaultValue: {}): {};
137
- /**
138
- * 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.
139
- */
140
- function set(obj: {}, keyName: string, value: {}): {};
141
- /**
142
- * Error-tolerant form of `Ember.set`. Will not blow up if any part of the chain is `undefined`, `null`, or destroyed.
143
- */
144
- function trySet(root: {}, path: string, value: {});
145
- /**
146
- * Set a list of properties on an object. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered.
147
- */
148
- function setProperties(obj: any, properties: {}): void;
149
- /**
150
- * 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.
151
- */
152
- function guidFor(obj: {}): string;
153
- /**
154
- * Checks to see if the `methodName` exists on the `obj`, and if it does, invokes it with the arguments passed.
155
- */
156
- function tryInvoke(obj: {}, methodName: string, args: Ember.Array): any;
157
- /**
158
- * 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`.
159
- */
160
- function A(): NativeArray;
161
- /**
162
- * Compares two javascript values and returns:
163
- */
164
- function compare(v: {}, w: {}): number;
165
- /**
166
- * Creates a shallow copy of the passed object. A deep copy of the object is returned if the optional `deep` argument is `true`.
167
- */
168
- function copy(obj: {}, deep: boolean): {};
169
- /**
170
- * Compares two objects, returning true if they are equal.
171
- */
172
- function isEqual(a: {}, b: {}): boolean;
173
- /**
174
- * Returns true if the passed object is an array or Array-like.
175
- */
176
- function isArray(obj: {}): boolean;
177
- /**
178
- * Returns a consistent type for the passed object.
179
- */
180
- function typeOf(item: {}): string;
181
- /**
182
- * Alias for jQuery
183
- */
184
- function $();
185
- export namespace ApplicationInstance {
186
- /**
187
- * A list of boot-time configuration options for customizing the behavior of an `Ember.ApplicationInstance`.
188
- */
189
- export class BootOptions {
190
- /**
191
- * Run in a full browser environment.
192
- */
193
- isBrowser: boolean;
194
- /**
195
- * Disable rendering completely.
196
- */
197
- shouldRender: boolean;
198
- /**
199
- * If present, render into the given `Document` object instead of the global `window.document` object.
200
- */
201
- document: Document;
202
- /**
203
- * 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.
204
- */
205
- rootElement: string|Element;
206
- /**
207
- * 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.
208
- */
209
- location: string;
210
- }
211
- }
212
- export namespace Templates {
213
- export class helpers {
214
- /**
215
- * Concatenates input params together.
216
- */
217
- concat();
218
- /**
219
- * The `{{each-in}}` helper loops over properties on an object. It is unbound, in that new (or removed) properties added to the target object will not be rendered.
220
- */
221
- 'each-in'();
222
- /**
223
- * The `{{#each}}` helper loops over elements in a collection. It is an extension of the base Handlebars `{{#each}}` helper.
224
- */
225
- each();
226
- /**
227
- * Use the `{{hash}}` helper to create a hash to pass as an option to your components. This is specially useful for contextual components where you can just yield a hash:
228
- */
229
- hash(options: {}): {};
230
- /**
231
- * Use the `if` block helper to conditionally render a block depending on a property. If the property is "falsey", for example: `false`, `undefined`, `null`, `""`, `0`, `NaN` or an empty array, the block will not be rendered.
232
- */
233
- if();
234
- /**
235
- * The `unless` helper is the inverse of the `if` helper. Its block will be rendered if the expression contains a falsey value. All forms of the `if` helper can also be used with `unless`.
236
- */
237
- unless();
238
- /**
239
- * Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the provided string. This is a convenient way to localize text within a template. For example:
240
- */
241
- loc(str: string);
242
- /**
243
- * `log` allows you to output the value of variables in the current rendering context. `log` also accepts primitive types such as strings or numbers.
244
- */
245
- log(values: any);
246
- /**
247
- * Use the `{{with}}` helper when you want to alias a property to a new name. This is helpful for semantic clarity as it allows you to retain default scope or to reference a property from another `{{with}}` block.
248
- */
249
- with(options: {}): string;
250
- /**
251
- * DEPRECATED: Use `{{each}}` helper instead.
252
- * `{{collection}}` is a template helper for adding instances of `Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html) for additional information on how a `CollectionView` functions.
253
- */
254
- collection();
255
- /**
256
- * The `{{component}}` helper lets you add instances of `Ember.Component` to a template. See [Ember.Component](/api/classes/Ember.Component.html) for additional information on how a `Component` functions. `{{component}}`'s primary use is for cases where you want to dynamically change which type of component is rendered as the state of your application changes. The provided block will be applied as the template for the component. Given an empty `<body>` the following template:
257
- */
258
- component();
259
- /**
260
- * Execute the `debugger` statement in the current template's context.
261
- */
262
- debugger();
263
- /**
264
- * Dynamically look up a property on an object. The second argument to `{{get}}` should have a string value, although it can be bound.
265
- */
266
- get();
267
- /**
268
- * The `{{input}}` helper lets you create an HTML `<input />` component. It causes an `Ember.TextField` component to be rendered. For more info, see the [Ember.TextField](/api/classes/Ember.TextField.html) docs and the [templates guide](http://emberjs.com/guides/templates/input-helpers/).
269
- */
270
- input(options: {});
271
- /**
272
- * The `mut` helper lets you __clearly specify__ that a child `Component` can update the (mutable) value passed to it, which will __change the value of the parent component__.
273
- */
274
- mut(attr: {});
275
- /**
276
- * The `{{outlet}}` helper lets you specify where a child routes will render in your template. An important use of the `{{outlet}}` helper is in your application's `application.hbs` file:
277
- */
278
- outlet(name: string);
279
- /**
280
- * The `partial` helper renders another template without changing the template context:
281
- */
282
- partial(partialName: string);
283
- /**
284
- * `{{textarea}}` inserts a new instance of `<textarea>` tag into the template. The attributes of `{{textarea}}` match those of the native HTML tags as closely as possible.
285
- */
286
- textarea(options: {});
287
- /**
288
- * The `{{unbound}}` helper disconnects the one-way binding of a property, essentially freezing its value at the moment of rendering. For example, in this example the display of the variable `name` will not change even if it is set with a new value:
289
- */
290
- unbound();
291
- /**
292
- * DEPRECATED:
293
- * `{{view}}` inserts a new instance of an `Ember.View` into a template passing its options to the `Ember.View`'s `create` method and using the supplied block as the view's own template.
294
- */
295
- view();
296
- /**
297
- * This is a helper to be used in conjunction with the link-to helper. It will supply url query parameters to the target route.
298
- */
299
- 'query-params'(hash: {}): {};
300
- /**
301
- * The `{{action}}` helper provides a way to pass triggers for behavior (usually just a function) between components, and into components from controllers.
302
- */
303
- action();
304
- /**
305
- * Calling ``{{render}}`` from within a template will insert another template that matches the provided name. The inserted template will access its properties on its own controller (rather than the controller of the parent template). If a view class with the same name exists, the view class also will be used. Note: A given controller may only be used *once* in your app in this manner. A singleton instance of the controller will be created for you. Example:
306
- */
307
- render(name: string, context: {}, options: {}): string;
308
- /**
309
- * The `{{link-to}}` component renders a link to the supplied `routeName` passing an optionally supplied model to the route as its `model` context of the route. The block for `{{link-to}}` becomes the innerHTML of the rendered element:
310
- */
311
- 'link-to'(routeName: string, context: {}, options: {}): string;
312
- }
313
- }
314
- export namespace streams {
315
- export namespace Ember {
316
- export class stream {
317
- }
318
- }
319
- export class Dependency {
320
- }
321
- export class Subscriber {
322
- }
323
- }
324
- export namespace stream {
325
- export class Stream {
326
- }
327
- }
328
- export namespace Test {
329
- /**
330
- * 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.
331
- */
332
- function visit(url: string): RSVP.Promise<any>;
333
- /**
334
- * Clicks an element and triggers any actions triggered by the element's `click` event.
335
- */
336
- function click(selector: string): RSVP.Promise<any>;
337
- /**
338
- * Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode
339
- */
340
- function keyEvent(selector: string, type: string, keyCode: number): RSVP.Promise<any>;
341
- /**
342
- * Fills in an input element with some text.
343
- */
344
- function fillIn(selector: string, text: string): RSVP.Promise<any>;
345
- /**
346
- * Finds an element in the context of the app's container element. A simple alias for `app.$(selector)`.
347
- */
348
- function find(selector: string): {};
349
- /**
350
- * Like `find`, but throws an error if the element selector returns no results.
351
- */
352
- function findWithAssert(selector: string): {};
353
- /**
354
- * 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.
355
- */
356
- function wait(value: {}): RSVP.Promise<any>;
357
- /**
358
- * Returns the currently active route name.
359
- */
360
- function currentRouteName(): {};
361
- /**
362
- * Returns the current path.
363
- */
364
- function currentPath(): {};
365
- /**
366
- * Returns the current URL.
367
- */
368
- function currentURL(): {};
369
- /**
370
- * 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.
371
- */
372
- function pauseTest(): {};
373
- /**
374
- * Triggers the given DOM event on the element identified by the provided selector.
375
- */
376
- function triggerEvent(selector: string, context: string, type: string, options: {}): RSVP.Promise<any>;
377
- /**
378
- * 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).
379
- */
380
- function setupForTesting();
381
- /**
382
- * `registerHelper` is used to register a test helper that will be injected when `App.injectTestHelpers` is called.
383
- */
384
- function registerHelper(name: string, helperMethod: Function, options: {});
385
- /**
386
- * `registerAsyncHelper` is used to register an async test helper that will be injected when `App.injectTestHelpers` is called.
387
- */
388
- function registerAsyncHelper(name: string, helperMethod: Function);
389
- /**
390
- * Remove a previously added helper method.
391
- */
392
- function unregisterHelper(name: string);
393
- /**
394
- * Used to register callbacks to be fired whenever `App.injectTestHelpers` is called.
395
- */
396
- function onInjectHelpers(callback: Function);
397
- /**
398
- * 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.
399
- */
400
- function promise(resolver: Function, label: string);
401
- /**
402
- * Used to allow ember-testing to communicate with a specific testing framework.
403
- */
404
- var adapter: any;
405
- /**
406
- * Replacement for `Ember.RSVP.resolve` The only difference is this uses an instance of `Ember.Test.Promise`
407
- */
408
- function resolve(The: any);
409
- /**
410
- * 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.
411
- */
412
- function registerWaiter(context: {}, callback: Function);
413
- /**
414
- * `unregisterWaiter` is used to unregister a callback that was registered with `registerWaiter`.
415
- */
416
- function unregisterWaiter(context: {}, callback: Function);
417
- /**
418
- * 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.
419
- */
420
- var testHelpers: {};
421
- /**
422
- * This property indicates whether or not this application is currently in testing mode. This is set when `setupForTesting` is called on the current application.
423
- */
424
- var testing: boolean;
425
- /**
426
- * 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`).
427
- */
428
- function injectTestHelpers();
429
- /**
430
- * This removes all helpers that have been registered, and resets and functions that were overridden by the helpers.
431
- */
432
- function removeTestHelpers();
433
- /**
434
- * The primary purpose of this class is to create hooks that can be implemented by an adapter for various test frameworks.
435
- */
436
- export class Adapter {
437
- /**
438
- * This callback will be called whenever an async operation is about to start.
439
- */
440
- asyncStart();
441
- /**
442
- * This callback will be called whenever an async operation has completed.
443
- */
444
- asyncEnd();
445
- /**
446
- * Override this method with your testing framework's false assertion. This function is called whenever an exception occurs causing the testing promise to fail.
447
- */
448
- exception(error: string);
449
- }
450
- /**
451
- * This class implements the methods defined by Ember.Test.Adapter for the QUnit testing framework.
452
- */
453
- export class QUnitAdapter extends Adapter {
454
- }
455
- }
456
- /**
457
- * The `ApplicationInstance` encapsulates all of the stateful aspects of a running `Application`.
458
- */
459
- export class ApplicationInstance extends EngineInstance {
460
- }
461
- /**
462
- * 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.
463
- */
464
- export class Application extends Engine implements RegistryProxyMixin {
465
- /**
466
- * 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/).
467
- */
468
- rootElement: DOMElement;
469
- /**
470
- * The `Ember.EventDispatcher` responsible for delegating events to this application's views.
471
- */
472
- eventDispatcher: EventDispatcher;
473
- /**
474
- * The DOM events for which the event dispatcher should listen.
475
- */
476
- customEvents: {};
477
- /**
478
- * Use this to defer readiness until some condition is true.
479
- */
480
- deferReadiness();
481
- /**
482
- * 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.
483
- */
484
- advanceReadiness();
485
- /**
486
- * Reset the application. This is typically used only in tests. It cleans up the application in the following order:
487
- */
488
- reset();
489
- /**
490
- * 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.
491
- */
492
- visit(url: string, options: ApplicationInstance.BootOptions): Promise<Ember.ApplicationInstance|Error>;
493
- /**
494
- * This creates a registry with the default Ember naming conventions.
495
- */
496
- static buildRegistry(namespace: Application): Registry;
497
- /**
498
- * Given a fullName return the corresponding factory.
499
- */
500
- resolveRegistration(fullName: string): Function;
501
- /**
502
- * 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`.
503
- */
504
- register(fullName: string, factory: Function, options: {});
505
- /**
506
- * Unregister a factory.
507
- */
508
- unregister(fullName: string);
509
- /**
510
- * Check if a factory is registered.
511
- */
512
- hasRegistration(fullName: string): boolean;
513
- /**
514
- * Register an option for a particular factory.
515
- */
516
- registerOption(fullName: string, optionName: string, options: {});
517
- /**
518
- * Return a specific registered option for a particular factory.
519
- */
520
- registeredOption(fullName: string, optionName: string): {};
521
- /**
522
- * Register options for a particular factory.
523
- */
524
- registerOptions(fullName: string, options: {});
525
- /**
526
- * Return registered options for a particular factory.
527
- */
528
- registeredOptions(fullName: string): {};
529
- /**
530
- * Allow registering options for all factories of a type.
531
- */
532
- registerOptionsForType(type: string, options: {});
533
- /**
534
- * Return the registered options for all factories of a type.
535
- */
536
- registeredOptionsForType(type: string): {};
537
- /**
538
- * Define a dependency injection onto a specific factory or all factories of a type.
539
- */
540
- inject(factoryNameOrType: string, property: string, injectionName: string);
541
- }
542
- /**
543
- * The `EngineInstance` encapsulates all of the stateful aspects of a running `Engine`.
544
- */
545
- export class EngineInstance extends Object implements RegistryProxyMixin, ContainerProxyMixin {
546
- /**
547
- * Unregister a factory.
548
- */
549
- unregister(fullName: string);
550
- /**
551
- * Given a fullName return the corresponding factory.
552
- */
553
- resolveRegistration(fullName: string): Function;
554
- /**
555
- * 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`.
556
- */
557
- register(fullName: string, factory: Function, options: {});
558
- /**
559
- * Check if a factory is registered.
560
- */
561
- hasRegistration(fullName: string): boolean;
562
- /**
563
- * Register an option for a particular factory.
564
- */
565
- registerOption(fullName: string, optionName: string, options: {});
566
- /**
567
- * Return a specific registered option for a particular factory.
568
- */
569
- registeredOption(fullName: string, optionName: string): {};
570
- /**
571
- * Register options for a particular factory.
572
- */
573
- registerOptions(fullName: string, options: {});
574
- /**
575
- * Return registered options for a particular factory.
576
- */
577
- registeredOptions(fullName: string): {};
578
- /**
579
- * Allow registering options for all factories of a type.
580
- */
581
- registerOptionsForType(type: string, options: {});
582
- /**
583
- * Return the registered options for all factories of a type.
584
- */
585
- registeredOptionsForType(type: string): {};
586
- /**
587
- * Define a dependency injection onto a specific factory or all factories of a type.
588
- */
589
- inject(factoryNameOrType: string, property: string, injectionName: string);
590
- /**
591
- * Returns an object that can be used to provide an owner to a manually created instance.
592
- */
593
- ownerInjection(): {};
594
- /**
595
- * Given a fullName return a corresponding instance.
596
- */
597
- lookup(fullName: string, options: {}): any;
598
- }
599
- /**
600
- * The `Engine` class contains core functionality for both applications and engines.
601
- */
602
- export class Engine extends Namespace {
603
- /**
604
- * This creates a registry with the default Ember naming conventions.
605
- */
606
- static buildRegistry(namespace: Application): Registry;
607
- /**
608
- * 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.
609
- */
610
- initializer(initializer: {});
611
- /**
612
- * 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.
613
- */
614
- instanceInitializer(instanceInitializer: any);
615
- /**
616
- * Set this to provide an alternate class to `Ember.DefaultResolver`
617
- */
618
- resolver: any;
619
- }
620
- /**
621
- * The DefaultResolver defines the default lookup rules to resolve container lookups before consulting the container for registered items:
622
- */
623
- export class DefaultResolver extends Object {
624
- /**
625
- * This will be set to the Application instance when it is created.
626
- */
627
- namespace: any;
628
- /**
629
- * 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.
630
- */
631
- resolve(fullName: string): {};
632
- /**
633
- * Convert the string name of the form 'type:name' to a Javascript object with the parsed aspects of the name broken out.
634
- */
635
- parseName(fullName: string);
636
- /**
637
- * 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.
638
- */
639
- lookupDescription(fullName: string);
640
- /**
641
- * Given a parseName object (output from `parseName`), apply the conventions expected by `Ember.Router`
642
- */
643
- useRouterNaming(parsedName: {});
644
- /**
645
- * Look up the template in Ember.TEMPLATES
646
- */
647
- resolveTemplate(parsedName: {});
648
- /**
649
- * Lookup the view using `resolveOther`
650
- */
651
- resolveView(parsedName: {});
652
- /**
653
- * Lookup the controller using `resolveOther`
654
- */
655
- resolveController(parsedName: {});
656
- /**
657
- * Lookup the route using `resolveOther`
658
- */
659
- resolveRoute(parsedName: {});
660
- /**
661
- * Lookup the model on the Application namespace
662
- */
663
- resolveModel(parsedName: {});
664
- /**
665
- * Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application)
666
- */
667
- resolveHelper(parsedName: {});
668
- /**
669
- * Look up the specified object (from parsedName) on the appropriate namespace (usually on the Application)
670
- */
671
- resolveOther(parsedName: {});
672
- }
673
- export class Debug {
674
- /**
675
- * 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.
676
- */
677
- static registerDeprecationHandler(handler: Function);
678
- /**
679
- * 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.
680
- */
681
- static registerWarnHandler(handler: Function);
682
- }
683
- /**
684
- * 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.
685
- */
686
- export class ContainerDebugAdapter extends Object {
687
- /**
688
- * The resolver instance of the application being debugged. This property will be injected on creation.
689
- */
690
- resolver: any;
691
- /**
692
- * Returns true if it is possible to catalog a list of available classes in the resolver for a given type.
693
- */
694
- canCatalogEntriesByType(type: string): boolean;
695
- /**
696
- * Returns the available classes a given type.
697
- */
698
- catalogEntriesByType(type: string): Ember.Array;
699
- }
700
- /**
701
- * 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.
702
- */
703
- export class DataAdapter {
704
- /**
705
- * The container-debug-adapter which is used to list all models.
706
- */
707
- containerDebugAdapter: any;
708
- /**
709
- * Ember Data > v1.0.0-beta.18 requires string model names to be passed around instead of the actual factories.
710
- */
711
- acceptsModelName: any;
712
- /**
713
- * 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.
714
- */
715
- getFilters(): Ember.Array;
716
- /**
717
- * Fetch the model types and observe them for changes.
718
- */
719
- watchModelTypes(typesAdded: Function, typesUpdated: Function): Function;
720
- /**
721
- * Fetch the records of a given type and observe them for changes.
722
- */
723
- watchRecords(modelName: string, recordsAdded: Function, recordsUpdated: Function, recordsRemoved: Function): Function;
724
- }
725
- export class HTMLBars {
726
- }
727
- /**
728
- * 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.
729
- */
730
- export class String {
731
- /**
732
- * 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.
733
- */
734
- static htmlSafe(): Handlebars.SafeString;
735
- /**
736
- * DEPRECATED: Use ES6 template strings instead: http://babeljs.io/docs/learn-es2015/#template-strings
737
- * 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.
738
- */
739
- fmt(str: string, formats: Ember.Array): string;
740
- /**
741
- * 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.
742
- */
743
- loc(str: string, formats: Ember.Array): string;
744
- /**
745
- * 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`.
746
- */
747
- w(str: string): Ember.Array;
748
- /**
749
- * Converts a camelized string into all lower case separated by underscores.
750
- */
751
- decamelize(str: string): string;
752
- /**
753
- * Replaces underscores, spaces, or camelCase with dashes.
754
- */
755
- dasherize(str: string): string;
756
- /**
757
- * Returns the lowerCamelCase form of a string.
758
- */
759
- camelize(str: string): string;
760
- /**
761
- * Returns the UpperCamelCase form of a string.
762
- */
763
- classify(str: string): string;
764
- /**
765
- * More general than decamelize. Returns the lower\_case\_and\_underscored form of a string.
766
- */
767
- underscore(str: string): string;
768
- /**
769
- * Returns the Capitalized form of a string
770
- */
771
- capitalize(str: string): string;
772
- }
773
- /**
774
- * Ember Helpers are functions that can compute values, and are used in templates. For example, this code calls a helper named `format-currency`:
775
- */
776
- export class Helper {
777
- /**
778
- * 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.
779
- */
780
- recompute();
781
- /**
782
- * Override this function when writing a class-based helper.
783
- */
784
- compute(params: Ember.Array, hash: {});
785
- /**
786
- * 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:
787
- */
788
- static helper(helper: Function);
789
- }
790
- /**
791
- * 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.
792
- */
793
- export class Binding {
794
- /**
795
- * This copies the Binding so it can be connected to another object.
796
- */
797
- copy(): Binding;
798
- /**
799
- * 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.
800
- */
801
- from(path: string): Binding;
802
- /**
803
- * 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.
804
- */
805
- to(path: string|any[]): Binding;
806
- /**
807
- * 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.
808
- */
809
- oneWay(): Binding;
810
- toString(): string;
811
- /**
812
- * 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.
813
- */
814
- connect(obj: {}): Binding;
815
- /**
816
- * Disconnects the binding instance. Changes will no longer be relayed. You will not usually need to call this method.
817
- */
818
- disconnect(obj: {}): Binding;
819
- }
820
- /**
821
- * A computed property transforms an object literal with object's accessor function(s) into a property.
822
- */
823
- export class ComputedProperty {
824
- /**
825
- * 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.
826
- */
827
- volatile(): ComputedProperty;
828
- /**
829
- * 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.
830
- */
831
- readOnly(): ComputedProperty;
832
- /**
833
- * Sets the dependent keys on this computed property. Pass any number of arguments containing key paths that this computed property depends on.
834
- */
835
- property(path: string): ComputedProperty;
836
- /**
837
- * 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.
838
- */
839
- meta(meta: {});
840
- /**
841
- * 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.
842
- */
843
- get(keyName: string): {};
844
- /**
845
- * 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.
846
- */
847
- set(keyName: string, newValue: {}): {};
848
- }
849
- /**
850
- * 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()`.
851
- */
852
- export class computed {
853
- /**
854
- * A computed property that returns true if the value of the dependent property is null, an empty string, empty array, or empty function.
855
- */
856
- empty(dependentKey: string): ComputedProperty;
857
- /**
858
- * A computed property that returns true if the value of the dependent property is NOT null, an empty string, empty array, or empty function.
859
- */
860
- notEmpty(dependentKey: string): ComputedProperty;
861
- /**
862
- * 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.
863
- */
864
- none(dependentKey: string): ComputedProperty;
865
- /**
866
- * A computed property that returns the inverse boolean value of the original value for the dependent property.
867
- */
868
- not(dependentKey: string): ComputedProperty;
869
- /**
870
- * A computed property that converts the provided dependent property into a boolean value.
871
- */
872
- bool(dependentKey: string): ComputedProperty;
873
- /**
874
- * 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.
875
- */
876
- match(dependentKey: string, regexp: RegExp): ComputedProperty;
877
- /**
878
- * A computed property that returns true if the provided dependent property is equal to the given value.
879
- */
880
- equal(dependentKey: string, value: string|number|{}): ComputedProperty;
881
- /**
882
- * A computed property that returns true if the provided dependent property is greater than the provided value.
883
- */
884
- gt(dependentKey: string, value: number): ComputedProperty;
885
- /**
886
- * A computed property that returns true if the provided dependent property is greater than or equal to the provided value.
887
- */
888
- gte(dependentKey: string, value: number): ComputedProperty;
889
- /**
890
- * A computed property that returns true if the provided dependent property is less than the provided value.
891
- */
892
- lt(dependentKey: string, value: number): ComputedProperty;
893
- /**
894
- * A computed property that returns true if the provided dependent property is less than or equal to the provided value.
895
- */
896
- lte(dependentKey: string, value: number): ComputedProperty;
897
- /**
898
- * A computed property that performs a logical `and` on the original values for the provided dependent properties.
899
- */
900
- and(dependentKey: string): ComputedProperty;
901
- /**
902
- * A computed property which performs a logical `or` on the original values for the provided dependent properties.
903
- */
904
- or(dependentKey: string): ComputedProperty;
905
- /**
906
- * 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.
907
- */
908
- alias(dependentKey: string): ComputedProperty;
909
- /**
910
- * 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.
911
- */
912
- oneWay(dependentKey: string): ComputedProperty;
913
- /**
914
- * This is a more semantically meaningful alias of `computed.oneWay`, whose name is somewhat ambiguous as to which direction the data flows.
915
- */
916
- reads(dependentKey: string): ComputedProperty;
917
- /**
918
- * 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.
919
- */
920
- readOnly(dependentKey: string): ComputedProperty;
921
- /**
922
- * 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.
923
- */
924
- deprecatingAlias(dependentKey: string): ComputedProperty;
925
- /**
926
- * A computed property that returns the sum of the values in the dependent array.
927
- */
928
- sum(dependentKey: string): ComputedProperty;
929
- /**
930
- * A computed property that calculates the maximum value in the dependent array. This will return `-Infinity` when the dependent array is empty.
931
- */
932
- max(dependentKey: string): ComputedProperty;
933
- /**
934
- * A computed property that calculates the minimum value in the dependent array. This will return `Infinity` when the dependent array is empty.
935
- */
936
- min(dependentKey: string): ComputedProperty;
937
- /**
938
- * Returns an array mapped via the callback
939
- */
940
- map(dependentKey: string, callback: Function): ComputedProperty;
941
- /**
942
- * Returns an array mapped to the specified key.
943
- */
944
- mapBy(dependentKey: string, propertyKey: string): ComputedProperty;
945
- /**
946
- * Filters the array by the callback.
947
- */
948
- filter(dependentKey: string, callback: Function): ComputedProperty;
949
- /**
950
- * Filters the array by the property and value
951
- */
952
- filterBy(dependentKey: string, propertyKey: string, value: any): ComputedProperty;
953
- /**
954
- * A computed property which returns a new array with all the unique elements from one or more dependent arrays.
955
- */
956
- uniq(propertyKey: string): ComputedProperty;
957
- /**
958
- * Alias for [Ember.computed.uniq](/api/#method_computed_uniq).
959
- */
960
- union(propertyKey: string): ComputedProperty;
961
- /**
962
- * A computed property which returns a new array with all the duplicated elements from two or more dependent arrays.
963
- */
964
- intersect(propertyKey: string): ComputedProperty;
965
- /**
966
- * 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.
967
- */
968
- setDiff(setAProperty: string, setBProperty: string): ComputedProperty;
969
- /**
970
- * A computed property that returns the array of values for the provided dependent properties.
971
- */
972
- collect(dependentKey: string): ComputedProperty;
973
- /**
974
- * 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.
975
- */
976
- sort(itemsKey: string, sortDefinition: string): ComputedProperty;
977
- }
978
- /**
979
- * A subclass of the JavaScript Error object for use in Ember.
980
- */
981
- export class Error {
982
- }
983
- /**
984
- * The hash of enabled Canary features. Add to this, any canary features before creating your application.
985
- */
986
- export class FEATURES {
987
- /**
988
- * Determine whether the specified `feature` is enabled. Used by Ember's build tools to exclude experimental features from beta/stable builds.
989
- */
990
- isEnabled(feature: string): boolean;
991
- }
992
- /**
993
- * Read-only property that returns the result of a container lookup.
994
- */
995
- export class InjectedProperty {
996
- }
997
- /**
998
- * The purpose of the Ember Instrumentation module is to provide efficient, general-purpose instrumentation for Ember.
999
- */
1000
- export class Instrumentation {
1001
- }
1002
- /**
1003
- * Inside Ember-Metal, simply uses the methods from `imports.console`. Override this to provide more robust logging functionality.
1004
- */
1005
- export class Logger {
1006
- /**
1007
- * Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space.
1008
- */
1009
- log(args: any);
1010
- /**
1011
- * 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.
1012
- */
1013
- warn(args: any);
1014
- /**
1015
- * 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.
1016
- */
1017
- error(args: any);
1018
- /**
1019
- * Logs the arguments to the console. You can pass as many arguments as you want and they will be joined together with a space.
1020
- */
1021
- info(args: any);
1022
- /**
1023
- * 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.
1024
- */
1025
- debug(args: any);
1026
- /**
1027
- * If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
1028
- */
1029
- assert(bool: boolean);
1030
- }
1031
- /**
1032
- * 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.
1033
- */
1034
- export class OrderedSet {
1035
- }
1036
- /**
1037
- * A Map stores values indexed by keys. Unlike JavaScript's default Objects, the keys of a Map can be any JavaScript object.
1038
- */
1039
- export class Map {
1040
- }
1041
- export class MapWithDefault extends Map {
1042
- }
1043
- /**
1044
- * The `Ember.Mixin` class allows you to create mixins, whose properties can be added to other classes. For instance,
1045
- */
1046
- export class Mixin {
1047
- static create(args: any);
1048
- }
1049
- /**
1050
- * Runs the passed target and method inside of a RunLoop, ensuring any deferred actions including bindings and views updates are flushed at the end.
1051
- */
1052
- export class run {
1053
- /**
1054
- * DEPRECATED:
1055
- * Replaces objects in an array with the passed objects.
1056
- */
1057
- replace(array: Ember.Array, idx: number, amt: number, objects: Ember.Array): Ember.Array;
1058
- /**
1059
- * 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.
1060
- */
1061
- join(target: {}, method: Function|string, ...args: any[]): {};
1062
- /**
1063
- * 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.
1064
- */
1065
- bind(target: {}, method: Function|string, ...args: any[]): Function;
1066
- /**
1067
- * 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()`.
1068
- */
1069
- begin(): void;
1070
- /**
1071
- * 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()`.
1072
- */
1073
- end(): void;
1074
- /**
1075
- * Adds the passed target/method and any optional arguments to the named queue to be executed at the end of the RunLoop. If you have not already started a RunLoop when calling this method one will be started for you automatically.
1076
- */
1077
- schedule(queue: string, target: {}, method: string|Function, ...args: any[]): void;
1078
- /**
1079
- * Invokes the passed target/method and optional arguments after a specified period of time. The last parameter of this method must always be a number of milliseconds.
1080
- */
1081
- later(target: {}, method: Function|string, ...args: any[]): any;
1082
- later(target: {}, method: Function|string, wait: number): any;
1083
- /**
1084
- * Schedule a function to run one time during the current RunLoop. This is equivalent to calling `scheduleOnce` with the "actions" queue.
1085
- */
1086
- once(target: {}, method: Function|string, ...args: any[]): {};
1087
- /**
1088
- * Schedules a function to run one time in a given queue of the current RunLoop. Calling this method with the same queue/target/method combination will have no effect (past the initial call).
1089
- */
1090
- scheduleOnce(queue: string, target: {}, method: Function|string, ...args: any[]): {};
1091
- /**
1092
- * Schedules an item to run from within a separate run loop, after control has been returned to the system. This is equivalent to calling `run.later` with a wait time of 1ms.
1093
- */
1094
- next(target: {}, method: Function|string, ...args: any[]): {};
1095
- /**
1096
- * Cancels a scheduled item. Must be a value returned by `run.later()`, `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or `run.throttle()`.
1097
- */
1098
- cancel(timer: {}): boolean;
1099
- /**
1100
- * Delay calling the target method until the debounce period has elapsed with no additional debounce calls. If `debounce` is called again before the specified time has elapsed, the timer is reset and the entire period must pass again before the target method is called.
1101
- */
1102
- debounce(target: {}, method: Function|string, ...args: any[]): Ember.Array;
1103
- debounce(target: {}, method: Function|string, wait: number, immediate: boolean): Ember.Array;
1104
- /**
1105
- * Ensure that the target method is never called more frequently than the specified spacing period. The target method is called immediately.
1106
- */
1107
- throttle(target: {}, method: Function|string, ...args: any[]): Ember.Array;
1108
- throttle(target: {}, method: Function|string, spacing: number, immediate: boolean): Ember.Array;
1109
- }
1110
- export class ControllerMixin implements ActionHandler {
1111
- /**
1112
- * Defines which query parameters the controller accepts. If you give the names `['category','page']` it will bind the values of these query parameters to the variables `this.category` and `this.page`
1113
- */
1114
- queryParams: any;
1115
- /**
1116
- * Transition the application into another route. The route may be either a single route or route path:
1117
- */
1118
- transitionToRoute(name: string, ...models: any[]);
1119
- transitionToRoute(name: string, options: {});
1120
- /**
1121
- * The object to which actions from the view should be sent.
1122
- */
1123
- target: any;
1124
- /**
1125
- * The controller's current model. When retrieving or modifying a controller's model, this property should be used instead of the `content` property.
1126
- */
1127
- model: any;
1128
- /**
1129
- * The collection of functions, keyed by name, available on this `ActionHandler` as action targets.
1130
- */
1131
- actions: {};
1132
- /**
1133
- * Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function.
1134
- */
1135
- send(actionName: string, context: any);
1136
- }
1137
- /**
1138
- * Ember.Location returns an instance of the correct implementation of the `location` API.
1139
- */
1140
- export class Location {
1141
- }
1142
- /**
1143
- * Ember.AutoLocation will select the best location option based off browser support with the priority order: history, hash, none.
1144
- */
1145
- export class AutoLocation {
1146
- }
1147
- /**
1148
- * `Ember.HashLocation` implements the location API using the browser's hash. At present, it relies on a `hashchange` event existing in the browser.
1149
- */
1150
- export class HashLocation extends Object {
1151
- }
1152
- /**
1153
- * Ember.HistoryLocation implements the location API using the browser's history.pushState API.
1154
- */
1155
- export class HistoryLocation extends Object {
1156
- }
1157
- /**
1158
- * Ember.NoneLocation does not interact with the browser. It is useful for testing, or when you need to manage state with your Router, but temporarily don't want it to muck with the URL (for example when you embed your application in a larger page).
1159
- */
1160
- export class NoneLocation extends Object {
1161
- }
1162
- /**
1163
- * The `Ember.Route` class is used to define individual routes. Refer to the [routing guide](http://emberjs.com/guides/routing/) for documentation.
1164
- */
1165
- export class Route extends Object implements ActionHandler, Evented {
1166
- /**
1167
- * Configuration hash for this route's queryParams. The possible configuration options and their defaults are as follows (assuming a query param whose controller property is `page`):
1168
- */
1169
- queryParams: {};
1170
- /**
1171
- * The name of the route, dot-delimited.
1172
- */
1173
- routeName: string;
1174
- /**
1175
- * Retrieves parameters, for current route using the state.params variable and getQueryParamsFor, using the supplied routeName.
1176
- */
1177
- paramsFor(name: string);
1178
- /**
1179
- * A hook you can use to reset controller values either when the model changes or the route is exiting.
1180
- */
1181
- resetController(controller: Controller, isExiting: boolean, transition: {});
1182
- /**
1183
- * The name of the view to use by default when rendering this routes template.
1184
- */
1185
- viewName: string;
1186
- /**
1187
- * The name of the template to use by default when rendering this routes template.
1188
- */
1189
- templateName: string;
1190
- /**
1191
- * The name of the controller to associate with this route.
1192
- */
1193
- controllerName: string;
1194
- /**
1195
- * The controller associated with this route.
1196
- */
1197
- controller: Controller;
1198
- /**
1199
- * This hook is executed when the router completely exits this route. It is not executed when the model for the route changes.
1200
- */
1201
- deactivate();
1202
- /**
1203
- * This hook is executed when the router enters the route. It is not executed when the model for the route changes.
1204
- */
1205
- activate();
1206
- /**
1207
- * Transition the application into another route. The route may be either a single route or route path:
1208
- */
1209
- transitionTo(name: string, ...models: any[]): Transition;
1210
- transitionTo(name: string, options: {}): Transition;
1211
- /**
1212
- * Perform a synchronous transition into another route without attempting to resolve promises, update the URL, or abort any currently active asynchronous transitions (i.e. regular transitions caused by `transitionTo` or URL changes).
1213
- */
1214
- intermediateTransitionTo(name: string, ...models: any[]);
1215
- /**
1216
- * Refresh the model on this route and any child routes, firing the `beforeModel`, `model`, and `afterModel` hooks in a similar fashion to how routes are entered when transitioning in from other route. The current route params (e.g. `article_id`) will be passed in to the respective model hooks, and if a different model is returned, `setupController` and associated route hooks will re-fire as well.
1217
- */
1218
- refresh(): Transition;
1219
- /**
1220
- * Transition into another route while replacing the current URL, if possible. This will replace the current history entry instead of adding a new one. Beside that, it is identical to `transitionTo` in all other respects. See 'transitionTo' for additional information regarding multiple models.
1221
- */
1222
- replaceWith(name: string, ...models: any[]): Transition;
1223
- /**
1224
- * Sends an action to the router, which will delegate it to the currently active route hierarchy per the bubbling rules explained under `actions`.
1225
- */
1226
- send(name: string, ...args: any[]);
1227
- /**
1228
- * This hook is the first of the route entry validation hooks called when an attempt is made to transition into a route or one of its children. It is called before `model` and `afterModel`, and is appropriate for cases when:
1229
- */
1230
- beforeModel(transition: Transition): Promise<any>;
1231
- /**
1232
- * This hook is called after this route's model has resolved. It follows identical async/promise semantics to `beforeModel` but is provided the route's resolved model in addition to the `transition`, and is therefore suited to performing logic that can only take place after the model has already resolved.
1233
- */
1234
- afterModel(resolvedModel: {}, transition: Transition): Promise<any>;
1235
- /**
1236
- * A hook you can implement to optionally redirect to another route.
1237
- */
1238
- redirect(model: {}, transition: Transition);
1239
- /**
1240
- * A hook you can implement to convert the URL into the model for this route.
1241
- */
1242
- model(params: {}, transition: Transition): {}|Promise<any>;
1243
- /**
1244
- * A hook you can implement to convert the route's model into parameters for the URL.
1245
- */
1246
- serialize(model: {}, params: Ember.Array): {};
1247
- /**
1248
- * A hook you can use to setup the controller for the current route.
1249
- */
1250
- setupController(controller: Controller, model: {});
1251
- /**
1252
- * Returns the controller for a particular route or name.
1253
- */
1254
- controllerFor(name: string): Controller;
1255
- /**
1256
- * Returns the resolved model of a parent (or any ancestor) route in a route hierarchy. During a transition, all routes must resolve a model object, and if a route needs access to a parent route's model in order to resolve a model (or just reuse the model from a parent), it can call `this.modelFor(theNameOfParentRoute)` to retrieve it. If the ancestor route's model was a promise, its resolved result is returned.
1257
- */
1258
- modelFor(name: string): {};
1259
- /**
1260
- * A hook you can use to render the template for the current route.
1261
- */
1262
- renderTemplate(controller: {}, model: {});
1263
- /**
1264
- * `render` is used to render a template into a region of another template (indicated by an `{{outlet}}`). `render` is used both during the entry phase of routing (via the `renderTemplate` hook) and later in response to user interaction.
1265
- */
1266
- render(name: string, options: {});
1267
- /**
1268
- * Disconnects a view that has been rendered into an outlet.
1269
- */
1270
- disconnectOutlet(options: {}|string);
1271
- /**
1272
- * The collection of functions, keyed by name, available on this `ActionHandler` as action targets.
1273
- */
1274
- actions: {};
1275
- /**
1276
- * Subscribes to a named event with given function.
1277
- */
1278
- on(name: string, target: {}, method: Function): void;
1279
- /**
1280
- * Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use ``one`` when you only care about the first time an event has taken place.
1281
- */
1282
- one(name: string, target: {}, method: Function): void;
1283
- /**
1284
- * Triggers a named event for the object. Any additional arguments will be passed as parameters to the functions that are subscribed to the event.
1285
- */
1286
- trigger(name: string, ...args: any[]);
1287
- /**
1288
- * Cancels subscription for given name, target, and method.
1289
- */
1290
- off(name: string, target: {}, method: Function): void;
1291
- /**
1292
- * Checks to see if object has any subscriptions for named event.
1293
- */
1294
- has(name: string): boolean;
1295
- }
1296
- /**
1297
- * The `Ember.Router` class manages the application state and URLs. Refer to the [routing guide](http://emberjs.com/guides/routing/) for documentation.
1298
- */
1299
- export class Router extends Object implements Evented {
1300
- /**
1301
- * The `location` property determines the type of URL's that your application will use.
1302
- */
1303
- location: any;
1304
- /**
1305
- * Represents the URL of the root of the application, often '/'. This prefix is assumed on all routes defined on this router.
1306
- */
1307
- rootURL: any;
1308
- /**
1309
- * Handles updating the paths and notifying any listeners of the URL change.
1310
- */
1311
- didTransition();
1312
- /**
1313
- * Handles notifying any listeners of an impending URL change.
1314
- */
1315
- willTransition();
1316
- /**
1317
- * The `Router.map` function allows you to define mappings from URLs to routes in your application. These mappings are defined within the supplied callback function using `this.route`.
1318
- */
1319
- map(callback: any);
1320
- /**
1321
- * Subscribes to a named event with given function.
1322
- */
1323
- on(name: string, target: {}, method: Function): void;
1324
- /**
1325
- * Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use ``one`` when you only care about the first time an event has taken place.
1326
- */
1327
- one(name: string, target: {}, method: Function): void;
1328
- /**
1329
- * Triggers a named event for the object. Any additional arguments will be passed as parameters to the functions that are subscribed to the event.
1330
- */
1331
- trigger(name: string, ...args: any[]);
1332
- /**
1333
- * Cancels subscription for given name, target, and method.
1334
- */
1335
- off(name: string, target: {}, method: Function): void;
1336
- /**
1337
- * Checks to see if object has any subscriptions for named event.
1338
- */
1339
- has(name: string): boolean;
1340
- }
1341
- /**
1342
- * `Ember.LinkComponent` renders an element whose `click` event triggers a transition of the application's instance of `Ember.Router` to a supplied route by name.
1343
- */
1344
- export class LinkComponent extends Component {
1345
- /**
1346
- * Used to determine when this `LinkComponent` is active.
1347
- */
1348
- currentWhen: any;
1349
- /**
1350
- * Sets the `title` attribute of the `LinkComponent`'s HTML element.
1351
- */
1352
- title: any;
1353
- /**
1354
- * Sets the `rel` attribute of the `LinkComponent`'s HTML element.
1355
- */
1356
- rel: any;
1357
- /**
1358
- * Sets the `tabindex` attribute of the `LinkComponent`'s HTML element.
1359
- */
1360
- tabindex: any;
1361
- /**
1362
- * Sets the `target` attribute of the `LinkComponent`'s HTML element.
1363
- */
1364
- target: any;
1365
- /**
1366
- * Determines whether the `LinkComponent` will trigger routing via the `replaceWith` routing strategy.
1367
- */
1368
- replace: boolean;
1369
- /**
1370
- * By default the `{{link-to}}` component will bind to the `href` and `title` attributes. It's discouraged that you override these defaults, however you can push onto the array if needed.
1371
- */
1372
- attributeBindings: Ember.Array;
1373
- /**
1374
- * By default the `{{link-to}}` component will bind to the `active`, `loading`, and `disabled` classes. It is discouraged to override these directly.
1375
- */
1376
- classNameBindings: Ember.Array;
1377
- }
1378
- export class Controller extends Object implements ControllerMixin {
1379
- /**
1380
- * Defines which query parameters the controller accepts. If you give the names `['category','page']` it will bind the values of these query parameters to the variables `this.category` and `this.page`
1381
- */
1382
- queryParams: any;
1383
- /**
1384
- * Transition the application into another route. The route may be either a single route or route path:
1385
- */
1386
- transitionToRoute(name: string, ...models: any[]);
1387
- transitionToRoute(name: string, options: {});
1388
- /**
1389
- * The object to which actions from the view should be sent.
1390
- */
1391
- target: any;
1392
- /**
1393
- * The controller's current model. When retrieving or modifying a controller's model, this property should be used instead of the `content` property.
1394
- */
1395
- model: any;
1396
- /**
1397
- * The collection of functions, keyed by name, available on this `ActionHandler` as action targets.
1398
- */
1399
- actions: {};
1400
- /**
1401
- * Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function.
1402
- */
1403
- send(actionName: string, context: any);
1404
- }
1405
- /**
1406
- * Namespace for injection helper methods.
1407
- */
1408
- export class inject {
1409
- /**
1410
- * Creates a property that lazily looks up another controller in the container. Can only be used when defining another controller.
1411
- */
1412
- controller(name: string): InjectedProperty;
1413
- /**
1414
- * Creates a property that lazily looks up a service in the container. There are no restrictions as to what objects a service can be injected into.
1415
- */
1416
- service(name: string): InjectedProperty;
1417
- }
1418
- /**
1419
- * `Ember.ProxyMixin` forwards all properties not defined by the proxy itself to a proxied `content` object. See Ember.ObjectProxy for more details.
1420
- */
1421
- export class ProxyMixin {
1422
- }
1423
- /**
1424
- * `Ember.ActionHandler` is available on some familiar classes including `Ember.Route`, `Ember.View`, `Ember.Component`, and `Ember.Controller`. (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`, and `Ember.Route` and available to the above classes through inheritance.)
1425
- */
1426
- export class ActionHandler {
1427
- /**
1428
- * The collection of functions, keyed by name, available on this `ActionHandler` as action targets.
1429
- */
1430
- actions: {};
1431
- /**
1432
- * Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function.
1433
- */
1434
- send(actionName: string, context: any);
1435
- }
1436
- /**
1437
- * This mixin implements Observer-friendly Array-like behavior. It is not a concrete implementation, but it can be used up by other classes that want to appear like arrays.
1438
- */
1439
- export class Array implements Enumerable {
1440
- /**
1441
- * __Required.__ You must implement this method to apply this mixin.
1442
- */
1443
- length: number;
1444
- /**
1445
- * Returns the object at the given `index`. If the given `index` is negative or is greater or equal than the array length, returns `undefined`.
1446
- */
1447
- objectAt(idx: number): any;
1448
- /**
1449
- * This returns the objects at the specified indexes, using `objectAt`.
1450
- */
1451
- objectsAt(indexes: Ember.Array): Ember.Array;
1452
- /**
1453
- * This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content.
1454
- */
1455
- '[]': any;
1456
- /**
1457
- * Returns a new array that is a slice of the receiver. This implementation uses the observable array methods to retrieve the objects for the new slice.
1458
- */
1459
- slice(beginIndex: number, endIndex: number): Ember.Array;
1460
- /**
1461
- * Returns the index of the given object's first occurrence. If no `startAt` argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
1462
- */
1463
- indexOf(object: {}, startAt: number): number;
1464
- /**
1465
- * Returns the index of the given object's last occurrence. If no `startAt` argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
1466
- */
1467
- lastIndexOf(object: {}, startAt: number): number;
1468
- /**
1469
- * Adds an array observer to the receiving array. The array observer object normally must implement two methods:
1470
- */
1471
- addArrayObserver(target: {}, opts: {}): Ember.Array;
1472
- /**
1473
- * Removes an array observer from the object if the observer is current registered. Calling this method multiple times with the same object will have no effect.
1474
- */
1475
- removeArrayObserver(target: {}, opts: {}): Ember.Array;
1476
- /**
1477
- * Becomes true whenever the array currently has observers watching changes on the array.
1478
- */
1479
- hasArrayObservers: boolean;
1480
- /**
1481
- * If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
1482
- */
1483
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
1484
- /**
1485
- * If you are implementing an object that supports `Ember.Array`, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
1486
- */
1487
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
1488
- /**
1489
- * Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects.
1490
- */
1491
- '@each': any;
1492
- /**
1493
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
1494
- */
1495
- firstObject: any;
1496
- /**
1497
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
1498
- */
1499
- lastObject: any;
1500
- /**
1501
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
1502
- */
1503
- contains(obj: {}): boolean;
1504
- /**
1505
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
1506
- */
1507
- forEach(callback: Function, target: {}): {};
1508
- /**
1509
- * Alias for `mapBy`
1510
- */
1511
- getEach(key: string): Ember.Array;
1512
- /**
1513
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
1514
- */
1515
- setEach(key: string, value: {}): {};
1516
- /**
1517
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
1518
- */
1519
- map(callback: Function, target: {}): Ember.Array;
1520
- /**
1521
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
1522
- */
1523
- mapBy(key: string): Ember.Array;
1524
- /**
1525
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
1526
- */
1527
- filter(callback: Function, target: {}): Ember.Array;
1528
- /**
1529
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
1530
- */
1531
- reject(callback: Function, target: {}): Ember.Array;
1532
- /**
1533
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1534
- */
1535
- filterBy(key: string, value: any): Ember.Array;
1536
- /**
1537
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
1538
- */
1539
- rejectBy(key: string, value: string): Ember.Array;
1540
- /**
1541
- * 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.
1542
- */
1543
- find(callback: Function, target: {}): {};
1544
- /**
1545
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1546
- */
1547
- findBy(key: string, value: string): {};
1548
- /**
1549
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
1550
- */
1551
- every(callback: Function, target: {}): boolean;
1552
- /**
1553
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
1554
- */
1555
- isEvery(key: string, value: string): boolean;
1556
- /**
1557
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
1558
- */
1559
- any(callback: Function, target: {}): boolean;
1560
- /**
1561
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
1562
- */
1563
- isAny(key: string, value: string): boolean;
1564
- /**
1565
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
1566
- */
1567
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
1568
- /**
1569
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
1570
- */
1571
- invoke(methodName: string, ...args: any[]): Ember.Array;
1572
- /**
1573
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
1574
- */
1575
- toArray(): Ember.Array;
1576
- /**
1577
- * Returns a copy of the array with all `null` and `undefined` elements removed.
1578
- */
1579
- compact(): Ember.Array;
1580
- /**
1581
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
1582
- */
1583
- without(value: {}): Enumerable;
1584
- /**
1585
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
1586
- */
1587
- uniq(): Enumerable;
1588
- /**
1589
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
1590
- */
1591
- sortBy(property: string): Ember.Array;
1592
- }
1593
- /**
1594
- * Implements some standard methods for comparing objects. Add this mixin to any class you create that can compare its instances.
1595
- */
1596
- export class Comparable {
1597
- }
1598
- /**
1599
- * 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.
1600
- */
1601
- export class Copyable {
1602
- }
1603
- /**
1604
- * This mixin defines the common interface implemented by enumerable objects in Ember. Most of these methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific features that cannot be emulated in older versions of JavaScript).
1605
- */
1606
- export class Enumerable {
1607
- /**
1608
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
1609
- */
1610
- firstObject: any;
1611
- /**
1612
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
1613
- */
1614
- lastObject: any;
1615
- /**
1616
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
1617
- */
1618
- contains(obj: {}): boolean;
1619
- /**
1620
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
1621
- */
1622
- forEach(callback: Function, target: {}): {};
1623
- /**
1624
- * Alias for `mapBy`
1625
- */
1626
- getEach(key: string): Ember.Array;
1627
- /**
1628
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
1629
- */
1630
- setEach(key: string, value: {}): {};
1631
- /**
1632
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
1633
- */
1634
- map(callback: Function, target: {}): Ember.Array;
1635
- /**
1636
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
1637
- */
1638
- mapBy(key: string): Ember.Array;
1639
- /**
1640
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
1641
- */
1642
- filter(callback: Function, target: {}): Ember.Array;
1643
- /**
1644
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
1645
- */
1646
- reject(callback: Function, target: {}): Ember.Array;
1647
- /**
1648
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1649
- */
1650
- filterBy(key: string, value: any): Ember.Array;
1651
- /**
1652
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
1653
- */
1654
- rejectBy(key: string, value: string): Ember.Array;
1655
- /**
1656
- * 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.
1657
- */
1658
- find(callback: Function, target: {}): {};
1659
- /**
1660
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1661
- */
1662
- findBy(key: string, value: string): {};
1663
- /**
1664
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
1665
- */
1666
- every(callback: Function, target: {}): boolean;
1667
- /**
1668
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
1669
- */
1670
- isEvery(key: string, value: string): boolean;
1671
- /**
1672
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
1673
- */
1674
- any(callback: Function, target: {}): boolean;
1675
- /**
1676
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
1677
- */
1678
- isAny(key: string, value: string): boolean;
1679
- /**
1680
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
1681
- */
1682
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
1683
- /**
1684
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
1685
- */
1686
- invoke(methodName: string, ...args: any[]): Ember.Array;
1687
- /**
1688
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
1689
- */
1690
- toArray(): Ember.Array;
1691
- /**
1692
- * Returns a copy of the array with all `null` and `undefined` elements removed.
1693
- */
1694
- compact(): Ember.Array;
1695
- /**
1696
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
1697
- */
1698
- without(value: {}): Enumerable;
1699
- /**
1700
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
1701
- */
1702
- uniq(): Enumerable;
1703
- /**
1704
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
1705
- */
1706
- sortBy(property: string): Ember.Array;
1707
- }
1708
- /**
1709
- * This mixin allows for Ember objects to subscribe to and emit events.
1710
- */
1711
- export class Evented {
1712
- /**
1713
- * Subscribes to a named event with given function.
1714
- */
1715
- on(name: string, target: {}, method: Function): void;
1716
- /**
1717
- * Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use ``one`` when you only care about the first time an event has taken place.
1718
- */
1719
- one(name: string, target: {}, method: Function): void;
1720
- /**
1721
- * Triggers a named event for the object. Any additional arguments will be passed as parameters to the functions that are subscribed to the event.
1722
- */
1723
- trigger(name: string, ...args: any[]);
1724
- /**
1725
- * Cancels subscription for given name, target, and method.
1726
- */
1727
- off(name: string, target: {}, method: Function): void;
1728
- /**
1729
- * Checks to see if object has any subscriptions for named event.
1730
- */
1731
- has(name: string): boolean;
1732
- }
1733
- /**
1734
- * DEPRECATED: Use `Object.freeze` instead.
1735
- * The `Ember.Freezable` mixin implements some basic methods for marking an object as frozen. Once an object is frozen it should be read only. No changes may be made the internal state of the object.
1736
- */
1737
- export class Freezable {
1738
- }
1739
- /**
1740
- * This mixin defines the API for modifying array-like objects. These methods can be applied only to a collection that keeps its items in an ordered set. It builds upon the Array mixin and adds methods to modify the array. One concrete implementations of this class include ArrayProxy.
1741
- */
1742
- export class MutableArray implements Ember.Array, MutableEnumerable {
1743
- /**
1744
- * __Required.__ You must implement this method to apply this mixin.
1745
- */
1746
- replace(idx: number, amt: number, objects: Ember.Array);
1747
- /**
1748
- * Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it.
1749
- */
1750
- clear(): Ember.Array;
1751
- /**
1752
- * This will use the primitive `replace()` method to insert an object at the specified index.
1753
- */
1754
- insertAt(idx: number, object: {}): Ember.Array;
1755
- /**
1756
- * Remove an object at the specified index using the `replace()` primitive method. You can pass either a single index, or a start and a length.
1757
- */
1758
- removeAt(start: number, len: number): Ember.Array;
1759
- /**
1760
- * Push the object onto the end of the array. Works just like `push()` but it is KVO-compliant.
1761
- */
1762
- pushObject(obj: any): void;
1763
- /**
1764
- * Add the objects in the passed numerable to the end of the array. Defers notifying observers of the change until all objects are added.
1765
- */
1766
- pushObjects(objects: Enumerable): Ember.Array;
1767
- /**
1768
- * Pop object from array or nil if none are left. Works just like `pop()` but it is KVO-compliant.
1769
- */
1770
- popObject(): void;
1771
- /**
1772
- * Shift an object from start of array or nil if none are left. Works just like `shift()` but it is KVO-compliant.
1773
- */
1774
- shiftObject(): void;
1775
- /**
1776
- * Unshift an object to start of array. Works just like `unshift()` but it is KVO-compliant.
1777
- */
1778
- unshiftObject(obj: any): void;
1779
- /**
1780
- * Adds the named objects to the beginning of the array. Defers notifying observers until all objects have been added.
1781
- */
1782
- unshiftObjects(objects: Enumerable): Ember.Array;
1783
- /**
1784
- * Reverse objects in the array. Works just like `reverse()` but it is KVO-compliant.
1785
- */
1786
- reverseObjects(): Ember.Array;
1787
- /**
1788
- * Replace all the receiver's content with content of the argument. If argument is an empty array receiver will be cleared.
1789
- */
1790
- setObjects(objects: Ember.Array): Ember.Array;
1791
- /**
1792
- * Remove all occurrences of an object in the array.
1793
- */
1794
- removeObject(obj: any): Ember.Array;
1795
- /**
1796
- * Push the object onto the end of the array if it is not already present in the array.
1797
- */
1798
- addObject(obj: any): Ember.Array;
1799
- /**
1800
- * __Required.__ You must implement this method to apply this mixin.
1801
- */
1802
- length: number;
1803
- /**
1804
- * Returns the object at the given `index`. If the given `index` is negative or is greater or equal than the array length, returns `undefined`.
1805
- */
1806
- objectAt(idx: number): any;
1807
- /**
1808
- * This returns the objects at the specified indexes, using `objectAt`.
1809
- */
1810
- objectsAt(indexes: Ember.Array): Ember.Array;
1811
- /**
1812
- * This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content.
1813
- */
1814
- '[]': any;
1815
- /**
1816
- * Returns a new array that is a slice of the receiver. This implementation uses the observable array methods to retrieve the objects for the new slice.
1817
- */
1818
- slice(beginIndex: number, endIndex: number): Ember.Array;
1819
- /**
1820
- * Returns the index of the given object's first occurrence. If no `startAt` argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
1821
- */
1822
- indexOf(object: {}, startAt: number): number;
1823
- /**
1824
- * Returns the index of the given object's last occurrence. If no `startAt` argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
1825
- */
1826
- lastIndexOf(object: {}, startAt: number): number;
1827
- /**
1828
- * Adds an array observer to the receiving array. The array observer object normally must implement two methods:
1829
- */
1830
- addArrayObserver(target: {}, opts: {}): Ember.Array;
1831
- /**
1832
- * Removes an array observer from the object if the observer is current registered. Calling this method multiple times with the same object will have no effect.
1833
- */
1834
- removeArrayObserver(target: {}, opts: {}): Ember.Array;
1835
- /**
1836
- * Becomes true whenever the array currently has observers watching changes on the array.
1837
- */
1838
- hasArrayObservers: boolean;
1839
- /**
1840
- * If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
1841
- */
1842
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
1843
- /**
1844
- * If you are implementing an object that supports `Ember.Array`, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
1845
- */
1846
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
1847
- /**
1848
- * Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects.
1849
- */
1850
- '@each': any;
1851
- /**
1852
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
1853
- */
1854
- firstObject: any;
1855
- /**
1856
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
1857
- */
1858
- lastObject: any;
1859
- /**
1860
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
1861
- */
1862
- contains(obj: {}): boolean;
1863
- /**
1864
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
1865
- */
1866
- forEach(callback: Function, target: {}): {};
1867
- /**
1868
- * Alias for `mapBy`
1869
- */
1870
- getEach(key: string): Ember.Array;
1871
- /**
1872
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
1873
- */
1874
- setEach(key: string, value: {}): {};
1875
- /**
1876
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
1877
- */
1878
- map(callback: Function, target: {}): Ember.Array;
1879
- /**
1880
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
1881
- */
1882
- mapBy(key: string): Ember.Array;
1883
- /**
1884
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
1885
- */
1886
- filter(callback: Function, target: {}): Ember.Array;
1887
- /**
1888
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
1889
- */
1890
- reject(callback: Function, target: {}): Ember.Array;
1891
- /**
1892
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1893
- */
1894
- filterBy(key: string, value: any): Ember.Array;
1895
- /**
1896
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
1897
- */
1898
- rejectBy(key: string, value: string): Ember.Array;
1899
- /**
1900
- * 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.
1901
- */
1902
- find(callback: Function, target: {}): {};
1903
- /**
1904
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
1905
- */
1906
- findBy(key: string, value: string): {};
1907
- /**
1908
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
1909
- */
1910
- every(callback: Function, target: {}): boolean;
1911
- /**
1912
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
1913
- */
1914
- isEvery(key: string, value: string): boolean;
1915
- /**
1916
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
1917
- */
1918
- any(callback: Function, target: {}): boolean;
1919
- /**
1920
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
1921
- */
1922
- isAny(key: string, value: string): boolean;
1923
- /**
1924
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
1925
- */
1926
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
1927
- /**
1928
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
1929
- */
1930
- invoke(methodName: string, ...args: any[]): Ember.Array;
1931
- /**
1932
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
1933
- */
1934
- toArray(): Ember.Array;
1935
- /**
1936
- * Returns a copy of the array with all `null` and `undefined` elements removed.
1937
- */
1938
- compact(): Ember.Array;
1939
- /**
1940
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
1941
- */
1942
- without(value: {}): Enumerable;
1943
- /**
1944
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
1945
- */
1946
- uniq(): Enumerable;
1947
- /**
1948
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
1949
- */
1950
- sortBy(property: string): Ember.Array;
1951
- /**
1952
- * Adds each object in the passed enumerable to the receiver.
1953
- */
1954
- addObjects(objects: Enumerable): {};
1955
- /**
1956
- * Removes each object in the passed enumerable from the receiver.
1957
- */
1958
- removeObjects(objects: Enumerable): {};
1959
- }
1960
- /**
1961
- * This mixin defines the API for modifying generic enumerables. These methods can be applied to an object regardless of whether it is ordered or unordered.
1962
- */
1963
- export class MutableEnumerable implements Enumerable {
1964
- /**
1965
- * __Required.__ You must implement this method to apply this mixin.
1966
- */
1967
- addObject(object: {}): {};
1968
- /**
1969
- * Adds each object in the passed enumerable to the receiver.
1970
- */
1971
- addObjects(objects: Enumerable): {};
1972
- /**
1973
- * __Required.__ You must implement this method to apply this mixin.
1974
- */
1975
- removeObject(object: {}): {};
1976
- /**
1977
- * Removes each object in the passed enumerable from the receiver.
1978
- */
1979
- removeObjects(objects: Enumerable): {};
1980
- /**
1981
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
1982
- */
1983
- firstObject: any;
1984
- /**
1985
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
1986
- */
1987
- lastObject: any;
1988
- /**
1989
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
1990
- */
1991
- contains(obj: {}): boolean;
1992
- /**
1993
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
1994
- */
1995
- forEach(callback: Function, target: {}): {};
1996
- /**
1997
- * Alias for `mapBy`
1998
- */
1999
- getEach(key: string): Ember.Array;
2000
- /**
2001
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
2002
- */
2003
- setEach(key: string, value: {}): {};
2004
- /**
2005
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
2006
- */
2007
- map(callback: Function, target: {}): Ember.Array;
2008
- /**
2009
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
2010
- */
2011
- mapBy(key: string): Ember.Array;
2012
- /**
2013
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
2014
- */
2015
- filter(callback: Function, target: {}): Ember.Array;
2016
- /**
2017
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
2018
- */
2019
- reject(callback: Function, target: {}): Ember.Array;
2020
- /**
2021
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2022
- */
2023
- filterBy(key: string, value: any): Ember.Array;
2024
- /**
2025
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
2026
- */
2027
- rejectBy(key: string, value: string): Ember.Array;
2028
- /**
2029
- * 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.
2030
- */
2031
- find(callback: Function, target: {}): {};
2032
- /**
2033
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2034
- */
2035
- findBy(key: string, value: string): {};
2036
- /**
2037
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
2038
- */
2039
- every(callback: Function, target: {}): boolean;
2040
- /**
2041
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
2042
- */
2043
- isEvery(key: string, value: string): boolean;
2044
- /**
2045
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
2046
- */
2047
- any(callback: Function, target: {}): boolean;
2048
- /**
2049
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
2050
- */
2051
- isAny(key: string, value: string): boolean;
2052
- /**
2053
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
2054
- */
2055
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
2056
- /**
2057
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
2058
- */
2059
- invoke(methodName: string, ...args: any[]): Ember.Array;
2060
- /**
2061
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
2062
- */
2063
- toArray(): Ember.Array;
2064
- /**
2065
- * Returns a copy of the array with all `null` and `undefined` elements removed.
2066
- */
2067
- compact(): Ember.Array;
2068
- /**
2069
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
2070
- */
2071
- without(value: {}): Enumerable;
2072
- /**
2073
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
2074
- */
2075
- uniq(): Enumerable;
2076
- /**
2077
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
2078
- */
2079
- sortBy(property: string): Ember.Array;
2080
- }
2081
- /**
2082
- * ## Overview
2083
- */
2084
- export class Observable {
2085
- /**
2086
- * Retrieves the value of a property from the object.
2087
- */
2088
- get(keyName: string): {};
2089
- /**
2090
- * To get the values of multiple properties at once, call `getProperties` with a list of strings or an array:
2091
- */
2092
- getProperties(...list: string[]): {};
2093
- /**
2094
- * Sets the provided key or path to the value.
2095
- */
2096
- set(keyName: string, value: {}): {};
2097
- /**
2098
- * Sets a list of properties at once. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered.
2099
- */
2100
- setProperties(hash: {}): {};
2101
- /**
2102
- * Convenience method to call `propertyWillChange` and `propertyDidChange` in succession.
2103
- */
2104
- notifyPropertyChange(keyName: string): Observable;
2105
- /**
2106
- * Adds an observer on a property.
2107
- */
2108
- addObserver(key: string, target: {}, method: string|Function);
2109
- /**
2110
- * Remove an observer you have previously registered on this object. Pass the same key, target, and method you passed to `addObserver()` and your target will no longer receive notifications.
2111
- */
2112
- removeObserver(key: string, target: {}, method: string|Function);
2113
- /**
2114
- * Retrieves the value of a property, or a default value in the case that the property returns `undefined`.
2115
- */
2116
- getWithDefault(keyName: string, defaultValue: {}): {};
2117
- /**
2118
- * Set the value of a property to the current value plus some amount.
2119
- */
2120
- incrementProperty(keyName: string, increment: number): number;
2121
- /**
2122
- * Set the value of a property to the current value minus some amount.
2123
- */
2124
- decrementProperty(keyName: string, decrement: number): number;
2125
- /**
2126
- * Set the value of a boolean property to the opposite of its current value.
2127
- */
2128
- toggleProperty(keyName: string): boolean;
2129
- /**
2130
- * Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property without accidentally invoking it if it is intended to be generated lazily.
2131
- */
2132
- cacheFor(keyName: string): {};
2133
- }
2134
- /**
2135
- * A low level mixin making ObjectProxy promise-aware.
2136
- */
2137
- export class PromiseProxyMixin {
2138
- /**
2139
- * If the proxied promise is rejected this will contain the reason provided.
2140
- */
2141
- reason: any;
2142
- /**
2143
- * Once the proxied promise has settled this will become `false`.
2144
- */
2145
- isPending: any;
2146
- /**
2147
- * Once the proxied promise has settled this will become `true`.
2148
- */
2149
- isSettled: any;
2150
- /**
2151
- * Will become `true` if the proxied promise is rejected.
2152
- */
2153
- isRejected: any;
2154
- /**
2155
- * Will become `true` if the proxied promise is fulfilled.
2156
- */
2157
- isFulfilled: any;
2158
- /**
2159
- * The promise whose fulfillment value is being proxied by this object.
2160
- */
2161
- promise: any;
2162
- /**
2163
- * An alias to the proxied promise's `then`.
2164
- */
2165
- then(callback: Function): RSVP.Promise<any>;
2166
- /**
2167
- * An alias to the proxied promise's `catch`.
2168
- */
2169
- catch(callback: Function): RSVP.Promise<any>;
2170
- /**
2171
- * An alias to the proxied promise's `finally`.
2172
- */
2173
- finally(callback: Function): RSVP.Promise<any>;
2174
- }
2175
- /**
2176
- * `Ember.TargetActionSupport` is a mixin that can be included in a class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. In normal Ember usage, the `{{action}}` helper is usually the best choice. This mixin is most often useful when you are doing more complex event handling in View objects.
2177
- */
2178
- export class TargetActionSupport extends Mixin {
2179
- }
2180
- /**
2181
- * 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.
2182
- */
2183
- export class ArrayProxy extends Object implements MutableArray {
2184
- /**
2185
- * __Required.__ You must implement this method to apply this mixin.
2186
- */
2187
- replace(idx: number, amt: number, objects: Ember.Array);
2188
- /**
2189
- * Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it.
2190
- */
2191
- clear(): Ember.Array;
2192
- /**
2193
- * This will use the primitive `replace()` method to insert an object at the specified index.
2194
- */
2195
- insertAt(idx: number, object: {}): Ember.Array;
2196
- /**
2197
- * Remove an object at the specified index using the `replace()` primitive method. You can pass either a single index, or a start and a length.
2198
- */
2199
- removeAt(start: number, len: number): Ember.Array;
2200
- /**
2201
- * Push the object onto the end of the array. Works just like `push()` but it is KVO-compliant.
2202
- */
2203
- pushObject(obj: any): void;
2204
- /**
2205
- * Add the objects in the passed numerable to the end of the array. Defers notifying observers of the change until all objects are added.
2206
- */
2207
- pushObjects(objects: Enumerable): Ember.Array;
2208
- /**
2209
- * Pop object from array or nil if none are left. Works just like `pop()` but it is KVO-compliant.
2210
- */
2211
- popObject(): void;
2212
- /**
2213
- * Shift an object from start of array or nil if none are left. Works just like `shift()` but it is KVO-compliant.
2214
- */
2215
- shiftObject(): void;
2216
- /**
2217
- * Unshift an object to start of array. Works just like `unshift()` but it is KVO-compliant.
2218
- */
2219
- unshiftObject(obj: any): void;
2220
- /**
2221
- * Adds the named objects to the beginning of the array. Defers notifying observers until all objects have been added.
2222
- */
2223
- unshiftObjects(objects: Enumerable): Ember.Array;
2224
- /**
2225
- * Reverse objects in the array. Works just like `reverse()` but it is KVO-compliant.
2226
- */
2227
- reverseObjects(): Ember.Array;
2228
- /**
2229
- * Replace all the receiver's content with content of the argument. If argument is an empty array receiver will be cleared.
2230
- */
2231
- setObjects(objects: Ember.Array): Ember.Array;
2232
- /**
2233
- * Remove all occurrences of an object in the array.
2234
- */
2235
- removeObject(obj: any): Ember.Array;
2236
- /**
2237
- * Push the object onto the end of the array if it is not already present in the array.
2238
- */
2239
- addObject(obj: any): Ember.Array;
2240
- /**
2241
- * __Required.__ You must implement this method to apply this mixin.
2242
- */
2243
- length: number;
2244
- /**
2245
- * Returns the object at the given `index`. If the given `index` is negative or is greater or equal than the array length, returns `undefined`.
2246
- */
2247
- objectAt(idx: number): any;
2248
- /**
2249
- * This returns the objects at the specified indexes, using `objectAt`.
2250
- */
2251
- objectsAt(indexes: Ember.Array): Ember.Array;
2252
- /**
2253
- * This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content.
2254
- */
2255
- '[]': any;
2256
- /**
2257
- * Returns a new array that is a slice of the receiver. This implementation uses the observable array methods to retrieve the objects for the new slice.
2258
- */
2259
- slice(beginIndex: number, endIndex: number): Ember.Array;
2260
- /**
2261
- * Returns the index of the given object's first occurrence. If no `startAt` argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
2262
- */
2263
- indexOf(object: {}, startAt: number): number;
2264
- /**
2265
- * Returns the index of the given object's last occurrence. If no `startAt` argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
2266
- */
2267
- lastIndexOf(object: {}, startAt: number): number;
2268
- /**
2269
- * Adds an array observer to the receiving array. The array observer object normally must implement two methods:
2270
- */
2271
- addArrayObserver(target: {}, opts: {}): Ember.Array;
2272
- /**
2273
- * Removes an array observer from the object if the observer is current registered. Calling this method multiple times with the same object will have no effect.
2274
- */
2275
- removeArrayObserver(target: {}, opts: {}): Ember.Array;
2276
- /**
2277
- * Becomes true whenever the array currently has observers watching changes on the array.
2278
- */
2279
- hasArrayObservers: boolean;
2280
- /**
2281
- * If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
2282
- */
2283
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
2284
- /**
2285
- * If you are implementing an object that supports `Ember.Array`, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
2286
- */
2287
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
2288
- /**
2289
- * Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects.
2290
- */
2291
- '@each': any;
2292
- /**
2293
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
2294
- */
2295
- firstObject: any;
2296
- /**
2297
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
2298
- */
2299
- lastObject: any;
2300
- /**
2301
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
2302
- */
2303
- contains(obj: {}): boolean;
2304
- /**
2305
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
2306
- */
2307
- forEach(callback: Function, target: {}): {};
2308
- /**
2309
- * Alias for `mapBy`
2310
- */
2311
- getEach(key: string): Ember.Array;
2312
- /**
2313
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
2314
- */
2315
- setEach(key: string, value: {}): {};
2316
- /**
2317
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
2318
- */
2319
- map(callback: Function, target: {}): Ember.Array;
2320
- /**
2321
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
2322
- */
2323
- mapBy(key: string): Ember.Array;
2324
- /**
2325
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
2326
- */
2327
- filter(callback: Function, target: {}): Ember.Array;
2328
- /**
2329
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
2330
- */
2331
- reject(callback: Function, target: {}): Ember.Array;
2332
- /**
2333
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2334
- */
2335
- filterBy(key: string, value: any): Ember.Array;
2336
- /**
2337
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
2338
- */
2339
- rejectBy(key: string, value: string): Ember.Array;
2340
- /**
2341
- * 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.
2342
- */
2343
- find(callback: Function, target: {}): {};
2344
- /**
2345
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2346
- */
2347
- findBy(key: string, value: string): {};
2348
- /**
2349
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
2350
- */
2351
- every(callback: Function, target: {}): boolean;
2352
- /**
2353
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
2354
- */
2355
- isEvery(key: string, value: string): boolean;
2356
- /**
2357
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
2358
- */
2359
- any(callback: Function, target: {}): boolean;
2360
- /**
2361
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
2362
- */
2363
- isAny(key: string, value: string): boolean;
2364
- /**
2365
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
2366
- */
2367
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
2368
- /**
2369
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
2370
- */
2371
- invoke(methodName: string, ...args: any[]): Ember.Array;
2372
- /**
2373
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
2374
- */
2375
- toArray(): Ember.Array;
2376
- /**
2377
- * Returns a copy of the array with all `null` and `undefined` elements removed.
2378
- */
2379
- compact(): Ember.Array;
2380
- /**
2381
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
2382
- */
2383
- without(value: {}): Enumerable;
2384
- /**
2385
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
2386
- */
2387
- uniq(): Enumerable;
2388
- /**
2389
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
2390
- */
2391
- sortBy(property: string): Ember.Array;
2392
- /**
2393
- * Adds each object in the passed enumerable to the receiver.
2394
- */
2395
- addObjects(objects: Enumerable): {};
2396
- /**
2397
- * Removes each object in the passed enumerable from the receiver.
2398
- */
2399
- removeObjects(objects: Enumerable): {};
2400
- }
2401
- export class CoreObject {
2402
- /**
2403
- * An overridable method called when objects are instantiated. By default, does nothing unless it is overridden during class definition.
2404
- */
2405
- init();
2406
- /**
2407
- * Defines the properties that will be concatenated from the superclass (instead of overridden).
2408
- */
2409
- concatenatedProperties: Ember.Array;
2410
- /**
2411
- * Defines the properties that will be merged from the superclass (instead of overridden).
2412
- */
2413
- mergedProperties: Ember.Array;
2414
- /**
2415
- * Destroyed object property flag.
2416
- */
2417
- isDestroyed: any;
2418
- /**
2419
- * Destruction scheduled flag. The `destroy()` method has been called.
2420
- */
2421
- isDestroying: any;
2422
- /**
2423
- * Destroys an object by setting the `isDestroyed` flag and removing its metadata, which effectively destroys observers and bindings.
2424
- */
2425
- destroy(): {};
2426
- /**
2427
- * Override to implement teardown.
2428
- */
2429
- willDestroy();
2430
- /**
2431
- * Returns a string representation which attempts to provide more information than Javascript's `toString` typically does, in a generic way for all Ember objects.
2432
- */
2433
- toString(): string;
2434
- /**
2435
- * Creates a new subclass.
2436
- */
2437
- static extend(mixins: Mixin, args: {});
2438
- /**
2439
- * Creates an instance of a class. Accepts either no arguments, or an object containing values to initialize the newly instantiated object with.
2440
- */
2441
- static create(args: any);
2442
- /**
2443
- * Augments a constructor's prototype with additional properties and functions:
2444
- */
2445
- reopen();
2446
- /**
2447
- * Augments a constructor's own properties and functions:
2448
- */
2449
- reopenClass();
2450
- }
2451
- /**
2452
- * This is the object instance returned when you get the `@each` property on an array. It uses the unknownProperty handler to automatically create EachArray instances for property names.
2453
- */
2454
- export class EachProxy {
2455
- }
2456
- /**
2457
- * A Namespace is an object usually used to contain other objects or methods such as an application or framework. Create a namespace anytime you want to define one of these new containers.
2458
- */
2459
- export class Namespace extends Object {
2460
- }
2461
- /**
2462
- * The NativeArray mixin contains the properties needed to make the native Array support Ember.MutableArray and all of its dependent APIs. Unless you have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to false, this will be applied automatically. Otherwise you can apply the mixin at anytime by calling `Ember.NativeArray.activate`.
2463
- */
2464
- export class NativeArray implements MutableArray, Observable, Copyable {
2465
- /**
2466
- * __Required.__ You must implement this method to apply this mixin.
2467
- */
2468
- replace(idx: number, amt: number, objects: Ember.Array);
2469
- /**
2470
- * Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it.
2471
- */
2472
- clear(): Ember.Array;
2473
- /**
2474
- * This will use the primitive `replace()` method to insert an object at the specified index.
2475
- */
2476
- insertAt(idx: number, object: {}): Ember.Array;
2477
- /**
2478
- * Remove an object at the specified index using the `replace()` primitive method. You can pass either a single index, or a start and a length.
2479
- */
2480
- removeAt(start: number, len: number): Ember.Array;
2481
- /**
2482
- * Push the object onto the end of the array. Works just like `push()` but it is KVO-compliant.
2483
- */
2484
- pushObject(obj: any): void;
2485
- /**
2486
- * Add the objects in the passed numerable to the end of the array. Defers notifying observers of the change until all objects are added.
2487
- */
2488
- pushObjects(objects: Enumerable): Ember.Array;
2489
- /**
2490
- * Pop object from array or nil if none are left. Works just like `pop()` but it is KVO-compliant.
2491
- */
2492
- popObject(): void;
2493
- /**
2494
- * Shift an object from start of array or nil if none are left. Works just like `shift()` but it is KVO-compliant.
2495
- */
2496
- shiftObject(): void;
2497
- /**
2498
- * Unshift an object to start of array. Works just like `unshift()` but it is KVO-compliant.
2499
- */
2500
- unshiftObject(obj: any): void;
2501
- /**
2502
- * Adds the named objects to the beginning of the array. Defers notifying observers until all objects have been added.
2503
- */
2504
- unshiftObjects(objects: Enumerable): Ember.Array;
2505
- /**
2506
- * Reverse objects in the array. Works just like `reverse()` but it is KVO-compliant.
2507
- */
2508
- reverseObjects(): Ember.Array;
2509
- /**
2510
- * Replace all the receiver's content with content of the argument. If argument is an empty array receiver will be cleared.
2511
- */
2512
- setObjects(objects: Ember.Array): Ember.Array;
2513
- /**
2514
- * Remove all occurrences of an object in the array.
2515
- */
2516
- removeObject(obj: any): Ember.Array;
2517
- /**
2518
- * Push the object onto the end of the array if it is not already present in the array.
2519
- */
2520
- addObject(obj: any): Ember.Array;
2521
- /**
2522
- * __Required.__ You must implement this method to apply this mixin.
2523
- */
2524
- length: number;
2525
- /**
2526
- * Returns the object at the given `index`. If the given `index` is negative or is greater or equal than the array length, returns `undefined`.
2527
- */
2528
- objectAt(idx: number): any;
2529
- /**
2530
- * This returns the objects at the specified indexes, using `objectAt`.
2531
- */
2532
- objectsAt(indexes: Ember.Array): Ember.Array;
2533
- /**
2534
- * This is the handler for the special array content property. If you get this property, it will return this. If you set this property to a new array, it will replace the current content.
2535
- */
2536
- '[]': any;
2537
- /**
2538
- * Returns a new array that is a slice of the receiver. This implementation uses the observable array methods to retrieve the objects for the new slice.
2539
- */
2540
- slice(beginIndex: number, endIndex: number): Ember.Array;
2541
- /**
2542
- * Returns the index of the given object's first occurrence. If no `startAt` argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
2543
- */
2544
- indexOf(object: {}, startAt: number): number;
2545
- /**
2546
- * Returns the index of the given object's last occurrence. If no `startAt` argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found.
2547
- */
2548
- lastIndexOf(object: {}, startAt: number): number;
2549
- /**
2550
- * Adds an array observer to the receiving array. The array observer object normally must implement two methods:
2551
- */
2552
- addArrayObserver(target: {}, opts: {}): Ember.Array;
2553
- /**
2554
- * Removes an array observer from the object if the observer is current registered. Calling this method multiple times with the same object will have no effect.
2555
- */
2556
- removeArrayObserver(target: {}, opts: {}): Ember.Array;
2557
- /**
2558
- * Becomes true whenever the array currently has observers watching changes on the array.
2559
- */
2560
- hasArrayObservers: boolean;
2561
- /**
2562
- * If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
2563
- */
2564
- arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
2565
- /**
2566
- * If you are implementing an object that supports `Ember.Array`, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change.
2567
- */
2568
- arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): Ember.Array;
2569
- /**
2570
- * Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects.
2571
- */
2572
- '@each': any;
2573
- /**
2574
- * Helper method returns the first object from a collection. This is usually used by bindings and other parts of the framework to extract a single object if the enumerable contains only one item.
2575
- */
2576
- firstObject: any;
2577
- /**
2578
- * Helper method returns the last object from a collection. If your enumerable contains only one object, this method should always return that object. If your enumerable is empty, this method should return `undefined`.
2579
- */
2580
- lastObject: any;
2581
- /**
2582
- * Returns `true` if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.
2583
- */
2584
- contains(obj: {}): boolean;
2585
- /**
2586
- * Iterates through the enumerable, calling the passed function on each item. This method corresponds to the `forEach()` method defined in JavaScript 1.6.
2587
- */
2588
- forEach(callback: Function, target: {}): {};
2589
- /**
2590
- * Alias for `mapBy`
2591
- */
2592
- getEach(key: string): Ember.Array;
2593
- /**
2594
- * Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise it will be set directly. `null` objects are skipped.
2595
- */
2596
- setEach(key: string, value: {}): {};
2597
- /**
2598
- * Maps all of the items in the enumeration to another value, returning a new array. This method corresponds to `map()` defined in JavaScript 1.6.
2599
- */
2600
- map(callback: Function, target: {}): Ember.Array;
2601
- /**
2602
- * Similar to map, this specialized function returns the value of the named property on all items in the enumeration.
2603
- */
2604
- mapBy(key: string): Ember.Array;
2605
- /**
2606
- * Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6.
2607
- */
2608
- filter(callback: Function, target: {}): Ember.Array;
2609
- /**
2610
- * Returns an array with all of the items in the enumeration where the passed function returns false. This method is the inverse of filter().
2611
- */
2612
- reject(callback: Function, target: {}): Ember.Array;
2613
- /**
2614
- * Returns an array with just the items with the matched property. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2615
- */
2616
- filterBy(key: string, value: any): Ember.Array;
2617
- /**
2618
- * Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false.
2619
- */
2620
- rejectBy(key: string, value: string): Ember.Array;
2621
- /**
2622
- * 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.
2623
- */
2624
- find(callback: Function, target: {}): {};
2625
- /**
2626
- * Returns the first item with a property matching the passed value. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to `true`.
2627
- */
2628
- findBy(key: string, value: string): {};
2629
- /**
2630
- * Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6.
2631
- */
2632
- every(callback: Function, target: {}): boolean;
2633
- /**
2634
- * Returns `true` if the passed property resolves to the value of the second argument for all items in the enumerable. This method is often simpler/faster than using a callback.
2635
- */
2636
- isEvery(key: string, value: string): boolean;
2637
- /**
2638
- * Returns `true` if the passed function returns true for any item in the enumeration. This corresponds with the `some()` method in JavaScript 1.6.
2639
- */
2640
- any(callback: Function, target: {}): boolean;
2641
- /**
2642
- * Returns `true` if the passed property resolves to the value of the second argument for any item in the enumerable. This method is often simpler/faster than using a callback.
2643
- */
2644
- isAny(key: string, value: string): boolean;
2645
- /**
2646
- * This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8.
2647
- */
2648
- reduce(callback: Function, initialValue: {}, reducerProperty: string): {};
2649
- /**
2650
- * Invokes the named method on every object in the receiver that implements it. This method corresponds to the implementation in Prototype 1.6.
2651
- */
2652
- invoke(methodName: string, ...args: any[]): Ember.Array;
2653
- /**
2654
- * Simply converts the enumerable into a genuine array. The order is not guaranteed. Corresponds to the method implemented by Prototype.
2655
- */
2656
- toArray(): Ember.Array;
2657
- /**
2658
- * Returns a copy of the array with all `null` and `undefined` elements removed.
2659
- */
2660
- compact(): Ember.Array;
2661
- /**
2662
- * Returns a new enumerable that excludes the passed value. The default implementation returns an array regardless of the receiver type unless the receiver does not contain the value.
2663
- */
2664
- without(value: {}): Enumerable;
2665
- /**
2666
- * Returns a new enumerable that contains only unique values. The default implementation returns an array regardless of the receiver type.
2667
- */
2668
- uniq(): Enumerable;
2669
- /**
2670
- * Converts the enumerable into an array and sorts by the keys specified in the argument.
2671
- */
2672
- sortBy(property: string): Ember.Array;
2673
- /**
2674
- * Adds each object in the passed enumerable to the receiver.
2675
- */
2676
- addObjects(objects: Enumerable): {};
2677
- /**
2678
- * Removes each object in the passed enumerable from the receiver.
2679
- */
2680
- removeObjects(objects: Enumerable): {};
2681
- /**
2682
- * Retrieves the value of a property from the object.
2683
- */
2684
- get(keyName: string): {};
2685
- /**
2686
- * To get the values of multiple properties at once, call `getProperties` with a list of strings or an array:
2687
- */
2688
- getProperties(...list: string[]): {};
2689
- /**
2690
- * Sets the provided key or path to the value.
2691
- */
2692
- set(keyName: string, value: {}): {};
2693
- /**
2694
- * Sets a list of properties at once. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered.
2695
- */
2696
- setProperties(hash: {}): {};
2697
- /**
2698
- * Convenience method to call `propertyWillChange` and `propertyDidChange` in succession.
2699
- */
2700
- notifyPropertyChange(keyName: string): Observable;
2701
- /**
2702
- * Adds an observer on a property.
2703
- */
2704
- addObserver(key: string, target: {}, method: string|Function);
2705
- /**
2706
- * Remove an observer you have previously registered on this object. Pass the same key, target, and method you passed to `addObserver()` and your target will no longer receive notifications.
2707
- */
2708
- removeObserver(key: string, target: {}, method: string|Function);
2709
- /**
2710
- * Retrieves the value of a property, or a default value in the case that the property returns `undefined`.
2711
- */
2712
- getWithDefault(keyName: string, defaultValue: {}): {};
2713
- /**
2714
- * Set the value of a property to the current value plus some amount.
2715
- */
2716
- incrementProperty(keyName: string, increment: number): number;
2717
- /**
2718
- * Set the value of a property to the current value minus some amount.
2719
- */
2720
- decrementProperty(keyName: string, decrement: number): number;
2721
- /**
2722
- * Set the value of a boolean property to the opposite of its current value.
2723
- */
2724
- toggleProperty(keyName: string): boolean;
2725
- /**
2726
- * Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property without accidentally invoking it if it is intended to be generated lazily.
2727
- */
2728
- cacheFor(keyName: string): {};
2729
- }
2730
- /**
2731
- * `Ember.Object` is the main base class for all Ember objects. It is a subclass of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, see the documentation for each of these.
2732
- */
2733
- export class Object extends CoreObject implements Observable {
2734
- /**
2735
- * Retrieves the value of a property from the object.
2736
- */
2737
- get(keyName: string): {};
2738
- /**
2739
- * To get the values of multiple properties at once, call `getProperties` with a list of strings or an array:
2740
- */
2741
- getProperties(...list: string[]): {};
2742
- /**
2743
- * Sets the provided key or path to the value.
2744
- */
2745
- set(keyName: string, value: {}): {};
2746
- /**
2747
- * Sets a list of properties at once. These properties are set inside a single `beginPropertyChanges` and `endPropertyChanges` batch, so observers will be buffered.
2748
- */
2749
- setProperties(hash: {}): {};
2750
- /**
2751
- * Convenience method to call `propertyWillChange` and `propertyDidChange` in succession.
2752
- */
2753
- notifyPropertyChange(keyName: string): Observable;
2754
- /**
2755
- * Adds an observer on a property.
2756
- */
2757
- addObserver(key: string, target: {}, method: string|Function);
2758
- /**
2759
- * Remove an observer you have previously registered on this object. Pass the same key, target, and method you passed to `addObserver()` and your target will no longer receive notifications.
2760
- */
2761
- removeObserver(key: string, target: {}, method: string|Function);
2762
- /**
2763
- * Retrieves the value of a property, or a default value in the case that the property returns `undefined`.
2764
- */
2765
- getWithDefault(keyName: string, defaultValue: {}): {};
2766
- /**
2767
- * Set the value of a property to the current value plus some amount.
2768
- */
2769
- incrementProperty(keyName: string, increment: number): number;
2770
- /**
2771
- * Set the value of a property to the current value minus some amount.
2772
- */
2773
- decrementProperty(keyName: string, decrement: number): number;
2774
- /**
2775
- * Set the value of a boolean property to the opposite of its current value.
2776
- */
2777
- toggleProperty(keyName: string): boolean;
2778
- /**
2779
- * Returns the cached value of a computed property, if it exists. This allows you to inspect the value of a computed property without accidentally invoking it if it is intended to be generated lazily.
2780
- */
2781
- cacheFor(keyName: string): {};
2782
- }
2783
- /**
2784
- * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself to a proxied `content` object.
2785
- */
2786
- export class ObjectProxy {
2787
- }
2788
- export class Service extends Object {
2789
- }
2790
- export class _Metamorph {
2791
- }
2792
- export class _MetamorphView extends View implements _Metamorph {
2793
- }
2794
- /**
2795
- * An `Ember.Component` is a view that is completely isolated. Properties accessed 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 must be passed in.
2796
- */
2797
- export class Component extends View {
2798
- /**
2799
- * Calls a action passed to a component.
2800
- */
2801
- sendAction(action: string, params: any);
2802
- /**
2803
- * Returns true when the component was invoked with a block template.
2804
- */
2805
- hasBlock: any;
2806
- /**
2807
- * Returns true when the component was invoked with a block parameter supplied.
2808
- */
2809
- hasBlockParams: any;
2810
- /**
2811
- * Enables components to take a list of parameters as arguments
2812
- */
2813
- static positionalParams: any;
2814
- }
2815
- export class AriaRoleSupport {
2816
- /**
2817
- * The WAI-ARIA role of the control represented by this view. For example, a button may have a role of type 'button', or a pane may have a role of type 'alertdialog'. This property is used by assistive software to help visually challenged users navigate rich web applications.
2818
- */
2819
- ariaRole: string;
2820
- }
2821
- export class ClassNamesSupport {
2822
- /**
2823
- * Standard CSS class names to apply to the view's outer element. This property automatically inherits any class names defined by the view's superclasses as well.
2824
- */
2825
- classNames: Ember.Array;
2826
- /**
2827
- * A list of properties of the view to apply as class names. If the property is a string value, the value of that string will be applied as a class name.
2828
- */
2829
- classNameBindings: Ember.Array;
2830
- }
2831
- export class EmptyViewSupport {
2832
- }
2833
- export class InstrumentationSupport {
2834
- /**
2835
- * Used to identify this view during debugging
2836
- */
2837
- instrumentDisplay: string;
2838
- }
2839
- export class LegacyViewSupport {
2840
- }
2841
- export class TemplateRenderingSupport {
2842
- }
2843
- /**
2844
- * `TextSupport` is a shared mixin used by both `Ember.TextField` and `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to specify a controller action to invoke when a certain event is fired on your text field or textarea. The specifed controller action would get the current value of the field passed in as the only argument unless the value of the field is empty. In that case, the instance of the field itself is passed in as the only argument.
2845
- */
2846
- export class TextSupport extends Mixin implements TargetActionSupport {
2847
- }
2848
- /**
2849
- * `Ember.ViewTargetActionSupport` is a mixin that can be included in a view class to add a `triggerAction` method with semantics similar to the Handlebars `{{action}}` helper. It provides intelligent defaults for the action's target: the view's controller; and the context that is sent with the action: the view's context.
2850
- */
2851
- export class ViewTargetActionSupport extends TargetActionSupport {
2852
- /**
2853
- * Renders the view again. This will work regardless of whether the view is already in the DOM or not. If the view is in the DOM, the rendering process will be deferred to give bindings a chance to synchronize.
2854
- */
2855
- rerender();
2856
- /**
2857
- * Returns the current DOM element for the view.
2858
- */
2859
- element: DOMElement;
2860
- /**
2861
- * Returns a jQuery object for this view's element. If you pass in a selector string, this method will return a jQuery object, using the current element as its buffer.
2862
- */
2863
- $(selector: string): JQuery;
2864
- /**
2865
- * The HTML `id` of the view's element in the DOM. You can provide this value yourself but it must be unique (just as in HTML):
2866
- */
2867
- elementId: string;
2868
- /**
2869
- * Tag name for the view's outer element. The tag name is only used when an element is first created. If you change the `tagName` for an element, you must destroy and recreate the view element.
2870
- */
2871
- tagName: string;
2872
- /**
2873
- * Normally, Ember's component model is "write-only". The component takes a bunch of attributes that it got passed in, and uses them to render its template.
2874
- */
2875
- readDOMAttr(name: string): void;
2876
- }
2877
- export class VisibilitySupport {
2878
- /**
2879
- * If `false`, the view will appear hidden in DOM.
2880
- */
2881
- isVisible: boolean;
2882
- }
2883
- /**
2884
- * `Ember.EventDispatcher` handles delegating browser events to their corresponding `Ember.Views.` For example, when you click on a view, `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets called.
2885
- */
2886
- export class EventDispatcher extends Object {
2887
- }
2888
- /**
2889
- * The internal class used to create text inputs when the `{{input}}` helper is used with `type` of `checkbox`.
2890
- */
2891
- export class Checkbox extends Component {
2892
- }
2893
- /**
2894
- * `Ember.CollectionView` is 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.
2895
- */
2896
- export class CollectionView extends ContainerView implements EmptyViewSupport {
2897
- }
2898
- /**
2899
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-containerview
2900
- * A `ContainerView` is an `Ember.View` subclass that implements `Ember.MutableArray` allowing programmatic management of its child views.
2901
- */
2902
- export class ContainerView extends View {
2903
- }
2904
- /**
2905
- * DEPRECATED: Use `Ember.View` instead.
2906
- * `Ember.CoreView` is an abstract class that exists to give view-like behavior to both Ember's main view class `Ember.View` and other classes that don't need the fully functionaltiy of `Ember.View`.
2907
- */
2908
- export class CoreView extends Object implements Evented, ActionHandler {
2909
- /**
2910
- * DEPRECATED: Use `Ember.View` instead.
2911
- * Override the default event firing from `Ember.Evented` to also call methods with the given name.
2912
- */
2913
- trigger(name: string);
2914
- /**
2915
- * DEPRECATED: Use `Ember.View` instead.
2916
- * Subscribes to a named event with given function.
2917
- */
2918
- on(name: string, target: {}, method: Function): void;
2919
- /**
2920
- * DEPRECATED: Use `Ember.View` instead.
2921
- * Subscribes a function to a named event and then cancels the subscription after the first time the event is triggered. It is good to use ``one`` when you only care about the first time an event has taken place.
2922
- */
2923
- one(name: string, target: {}, method: Function): void;
2924
- /**
2925
- * DEPRECATED: Use `Ember.View` instead.
2926
- * Cancels subscription for given name, target, and method.
2927
- */
2928
- off(name: string, target: {}, method: Function): void;
2929
- /**
2930
- * DEPRECATED: Use `Ember.View` instead.
2931
- * Checks to see if object has any subscriptions for named event.
2932
- */
2933
- has(name: string): boolean;
2934
- /**
2935
- * DEPRECATED: Use `Ember.View` instead.
2936
- * The collection of functions, keyed by name, available on this `ActionHandler` as action targets.
2937
- */
2938
- actions: {};
2939
- /**
2940
- * DEPRECATED: Use `Ember.View` instead.
2941
- * Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function.
2942
- */
2943
- send(actionName: string, context: any);
2944
- }
2945
- /**
2946
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2947
- * The `Ember.Select` view class renders a [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element, allowing the user to choose from a list of options.
2948
- */
2949
- export class Select extends View {
2950
- /**
2951
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2952
- * The `multiple` attribute of the select element. Indicates whether multiple options can be selected.
2953
- */
2954
- multiple: boolean;
2955
- /**
2956
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2957
- * The `disabled` attribute of the select element. Indicates whether the element is disabled from interactions.
2958
- */
2959
- disabled: boolean;
2960
- /**
2961
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2962
- * The `required` attribute of the select element. Indicates whether a selected option is required for form validation.
2963
- */
2964
- required: boolean;
2965
- /**
2966
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2967
- * The list of options.
2968
- */
2969
- content: Ember.Array;
2970
- /**
2971
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2972
- * When `multiple` is `false`, the element of `content` that is currently selected, if any.
2973
- */
2974
- selection: {};
2975
- /**
2976
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2977
- * In single selection mode (when `multiple` is `false`), value can be used to get the current selection's value or set the selection by its value.
2978
- */
2979
- value: string;
2980
- /**
2981
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2982
- * If given, a top-most dummy option will be rendered to serve as a user prompt.
2983
- */
2984
- prompt: string;
2985
- /**
2986
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2987
- * The path of the option labels. See [content](/api/classes/Ember.Select.html#property_content).
2988
- */
2989
- optionLabelPath: string;
2990
- /**
2991
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2992
- * The path of the option values. See [content](/api/classes/Ember.Select.html#property_content).
2993
- */
2994
- optionValuePath: string;
2995
- /**
2996
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
2997
- * The path of the option group. When this property is used, `content` should be sorted by `optionGroupPath`.
2998
- */
2999
- optionGroupPath: string;
3000
- /**
3001
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-select
3002
- * The view class for optgroup.
3003
- */
3004
- groupView: View;
3005
- }
3006
- /**
3007
- * The internal class used to create textarea element when the `{{textarea}}` helper is used.
3008
- */
3009
- export class TextArea extends Component implements TextSupport {
3010
- }
3011
- /**
3012
- * The internal class used to create text inputs when the `{{input}}` helper is used with `type` of `text`. See [Ember.Templates.helpers.input](/api/classes/Ember.Templates.helpers.html#method_input) for usage details. ## Layout and LayoutName properties Because HTML `input` elements are self closing `layout` and `layoutName` properties will not be applied. See [Ember.View](/api/classes/Ember.View.html)'s layout section for more information.
3013
- */
3014
- export class TextField extends Component implements TextSupport {
3015
- /**
3016
- * The `value` attribute of the input element. As the user inputs text, this property is updated live.
3017
- */
3018
- value: string;
3019
- /**
3020
- * The `type` attribute of the input element.
3021
- */
3022
- type: string;
3023
- /**
3024
- * The `size` of the text field in characters.
3025
- */
3026
- size: string;
3027
- /**
3028
- * The `pattern` attribute of input element.
3029
- */
3030
- pattern: string;
3031
- /**
3032
- * The `min` attribute of input element used with `type="number"` or `type="range"`.
3033
- */
3034
- min: string;
3035
- /**
3036
- * The `max` attribute of input element used with `type="number"` or `type="range"`.
3037
- */
3038
- max: string;
3039
- }
3040
- /**
3041
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3042
- * `Ember.View` is the class in Ember responsible for encapsulating templates of HTML content, combining templates with data to render as sections of a page's DOM, and registering and responding to user-initiated events.
3043
- */
3044
- export class View extends CoreView implements TemplateRenderingSupport, ClassNamesSupport, LegacyViewSupport, InstrumentationSupport, VisibilitySupport, AriaRoleSupport {
3045
- /**
3046
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3047
- * Standard CSS class names to apply to the view's outer element. This property automatically inherits any class names defined by the view's superclasses as well.
3048
- */
3049
- classNames: Ember.Array;
3050
- /**
3051
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3052
- * A list of properties of the view to apply as class names. If the property is a string value, the value of that string will be applied as a class name.
3053
- */
3054
- classNameBindings: Ember.Array;
3055
- /**
3056
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3057
- * Used to identify this view during debugging
3058
- */
3059
- instrumentDisplay: string;
3060
- /**
3061
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3062
- * If `false`, the view will appear hidden in DOM.
3063
- */
3064
- isVisible: boolean;
3065
- /**
3066
- * DEPRECATED: See http://emberjs.com/deprecations/v1.x/#toc_ember-view
3067
- * The WAI-ARIA role of the control represented by this view. For example, a button may have a role of type 'button', or a pane may have a role of type 'alertdialog'. This property is used by assistive software to help visually challenged users navigate rich web applications.
3068
- */
3069
- ariaRole: string;
3070
- }
3071
- }
3072
- /**
3073
- * A container used to instantiate and cache objects.
3074
- */
3075
- export class Container {
3076
- }
3077
- /**
3078
- * A registry used to store factory and option information keyed by type.
3079
- */
3080
- export class Registry {
3081
- }
3082
- export class Backburner {
3083
- }
3084
- /**
3085
- * Helper class that allows you to register your library with Ember.
3086
- */
3087
- export class Libraries {
3088
- }
3089
- /**
3090
- * Objects of this type can implement an interface to respond to requests to get and set. The default implementation handles simple properties.
3091
- */
3092
- export class Descriptor {
3093
- }
3094
- /**
3095
- * The Routing service is used by LinkComponent, and provides facilities for the component/view layer to interact with the router.
3096
- */
3097
- export class RoutingService {
3098
- }
3099
- export interface Function {
3100
- /**
3101
- * The `property` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is `true`, which is the default.
3102
- */
3103
- property();
3104
- /**
3105
- * The `observes` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.
3106
- */
3107
- observes();
3108
- /**
3109
- * The `on` extension of Javascript's Function prototype is available when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.
3110
- */
3111
- on();
3112
- }
3113
- export interface String {
3114
- }
3115
- /**
3116
- * ContainerProxyMixin is used to provide public access to specific container functionality.
3117
- */
3118
- export class ContainerProxyMixin {
3119
- /**
3120
- * Returns an object that can be used to provide an owner to a manually created instance.
3121
- */
3122
- ownerInjection(): {};
3123
- /**
3124
- * Given a fullName return a corresponding instance.
3125
- */
3126
- lookup(fullName: string, options: {}): any;
3127
- }
3128
- /**
3129
- * RegistryProxyMixin is used to provide public access to specific registry functionality.
3130
- */
3131
- export class RegistryProxyMixin {
3132
- /**
3133
- * Given a fullName return the corresponding factory.
3134
- */
3135
- resolveRegistration(fullName: string): Function;
3136
- /**
3137
- * 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`.
3138
- */
3139
- register(fullName: string, factory: Function, options: {});
3140
- /**
3141
- * Unregister a factory.
3142
- */
3143
- unregister(fullName: string);
3144
- /**
3145
- * Check if a factory is registered.
3146
- */
3147
- hasRegistration(fullName: string): boolean;
3148
- /**
3149
- * Register an option for a particular factory.
3150
- */
3151
- registerOption(fullName: string, optionName: string, options: {});
3152
- /**
3153
- * Return a specific registered option for a particular factory.
3154
- */
3155
- registeredOption(fullName: string, optionName: string): {};
3156
- /**
3157
- * Register options for a particular factory.
3158
- */
3159
- registerOptions(fullName: string, options: {});
3160
- /**
3161
- * Return registered options for a particular factory.
3162
- */
3163
- registeredOptions(fullName: string): {};
3164
- /**
3165
- * Allow registering options for all factories of a type.
3166
- */
3167
- registerOptionsForType(type: string, options: {});
3168
- /**
3169
- * Return the registered options for all factories of a type.
3170
- */
3171
- registeredOptionsForType(type: string): {};
3172
- /**
3173
- * Define a dependency injection onto a specific factory or all factories of a type.
3174
- */
3175
- inject(factoryNameOrType: string, property: string, injectionName: string);
3176
- }
3177
- /**
3178
- * An HTMLBars AST transformation that replaces all instances of
3179
- */
3180
- export class TransformEachInToHash {
3181
- }
3182
- /**
3183
- * An HTMLBars AST transformation that replaces all instances of
3184
- */
3185
- export class TransformInputOnToOnEvent {
3186
- }
3187
- export default Ember
3188
- }