mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-11 20:50:02 +00:00
Merge branch 'master' into update-ckeditor-url
This commit is contained in:
5
types/ember-data/index.d.ts
vendored
5
types/ember-data/index.d.ts
vendored
@@ -543,8 +543,9 @@ export namespace DS {
|
||||
* invoking the callback with the name of each relationship and its relationship
|
||||
* descriptor.
|
||||
*/
|
||||
eachRelationship(
|
||||
callback: (name: string, details: RelationshipMeta<this>) => void,
|
||||
eachRelationship<T extends Model>(
|
||||
this: T,
|
||||
callback: (name: string, details: RelationshipMeta<T>) => void,
|
||||
binding?: any
|
||||
): any;
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ p.eachRelationship((n, meta) => {
|
||||
let m: 'belongsTo' | 'hasMany' = meta.kind;
|
||||
});
|
||||
|
||||
class Comment extends DS.Model {
|
||||
export class Comment extends DS.Model {
|
||||
author = DS.attr('string');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
import { Comment } from './relationships';
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
@@ -119,7 +120,7 @@ const MyRouteAsync = Ember.Route.extend({
|
||||
const store = this.get('store');
|
||||
return await store.findRecord('post-comment', 1);
|
||||
},
|
||||
async afterModel(): Promise<Ember.Array<PostComment>> {
|
||||
async afterModel(): Promise<Ember.Array<Comment>> {
|
||||
const post = await this.get('store').findRecord('post', 1);
|
||||
return await post.get('comments');
|
||||
}
|
||||
@@ -132,7 +133,7 @@ class MyRouteAsyncES6 extends Ember.Route {
|
||||
async model(): Promise<DS.Model> {
|
||||
return await this.store.findRecord('post-comment', 1);
|
||||
}
|
||||
async afterModel(): Promise<Ember.Array<PostComment>> {
|
||||
async afterModel(): Promise<Ember.Array<Comment>> {
|
||||
const post = await this.store.findRecord('post', 1);
|
||||
return await post.get('comments');
|
||||
}
|
||||
|
||||
2
types/ember-data/v2/index.d.ts
vendored
2
types/ember-data/v2/index.d.ts
vendored
@@ -525,7 +525,7 @@ export namespace DS {
|
||||
* invoking the callback with the name of each relationship and its relationship
|
||||
* descriptor.
|
||||
*/
|
||||
eachRelationship(callback: (name: string, details: RelationshipMeta<this>) => void, binding?: any): any;
|
||||
eachRelationship<T extends Model>(this: T, callback: (name: string, details: RelationshipMeta<T>) => void, binding?: any): any;
|
||||
/**
|
||||
* Represents the model's class name as a string. This can be used to look up the model's class name through
|
||||
* `DS.Store`'s modelFor method.
|
||||
|
||||
@@ -26,7 +26,7 @@ p.eachRelationship((n, meta) => {
|
||||
let m: 'belongsTo' | 'hasMany' = meta.kind;
|
||||
});
|
||||
|
||||
class Comment extends DS.Model {
|
||||
export class Comment extends DS.Model {
|
||||
author = DS.attr('string');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { assertType } from './lib/assert';
|
||||
import { Comment } from './relationships';
|
||||
|
||||
declare const store: DS.Store;
|
||||
|
||||
@@ -119,7 +120,7 @@ const MyRouteAsync = Ember.Route.extend({
|
||||
const store = this.get('store');
|
||||
return await store.findRecord('post-comment', 1);
|
||||
},
|
||||
async afterModel(): Promise<Ember.Array<PostComment>> {
|
||||
async afterModel(): Promise<Ember.Array<Comment>> {
|
||||
const post = await this.get('store').findRecord('post', 1);
|
||||
return await post.get('comments');
|
||||
}
|
||||
@@ -132,7 +133,7 @@ class MyRouteAsyncES6 extends Ember.Route {
|
||||
async model(): Promise<DS.Model> {
|
||||
return await this.store.findRecord('post-comment', 1);
|
||||
}
|
||||
async afterModel(): Promise<Ember.Array<PostComment>> {
|
||||
async afterModel(): Promise<Ember.Array<Comment>> {
|
||||
const post = await this.store.findRecord('post', 1);
|
||||
return await post.get('comments');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ interface EditableMixin {
|
||||
isEditing: boolean;
|
||||
}
|
||||
|
||||
const EditableMixin: Ember.Mixin<EditableMixin, Ember.Route> = Ember.Mixin.create({
|
||||
const EditableMixin = Ember.Mixin.create<EditableMixin, Ember.Route>({
|
||||
edit() {
|
||||
this.get('controller');
|
||||
console.log('starting to edit');
|
||||
|
||||
Reference in New Issue
Block a user