Fix ember.js defintions

This commit is contained in:
Boris Yankov
2012-11-07 11:21:51 +02:00
parent 9bfc978542
commit dc015afdc2
2 changed files with 10 additions and 7 deletions
+5 -2
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "Ember" {
declare module Ember {
export class CoreObject {
isDestroyed: bool;
@@ -46,13 +46,16 @@ declare module "Ember" {
}
export interface Mixin {
apply(obj: Object): Object;
create(obj: Object): Object;
detect(obj: Object): bool;
extend(first: Object, second: Object): Object;
reopen(...arguments: any[]): Mixin;
}
export class View extends Object {
append(): View;
static create(...arguments: any[]): Application;
static create(...arguments: any[]): View;
}
export interface Enumerable extends Mixin {
+5 -5
View File
@@ -171,15 +171,15 @@ Person = Ember.Object.extend({
name: null,
isHappy: false
});
var people = [
var people2 = [
Person.create({ name: 'Yehuda', isHappy: true }),
Person.create({ name: 'Majd', isHappy: false })
];
people.every((person, index, self) => {
people2.every((person, index, self) => {
if (person.get('isHappy')) { return true; }
});
people.some((person, index, self) => {
people2.some((person, index, self) => {
if (person.get('isHappy')) { return true; }
});
people.everyProperty('isHappy', true);
people.someProperty('isHappy', true);
people2.everyProperty('isHappy', true);
people2.someProperty('isHappy', true);