backbone-associations: use new() => T instead of typeof T

This commit is contained in:
Andy Hanson
2017-08-17 13:01:55 -07:00
parent fd7bea617c
commit b8d83eb5d5

View File

@@ -25,14 +25,14 @@ declare module 'backbone' {
interface IRelation {
/** The type of model for this relationship */
relatedModel: string|typeof Backbone.Associations.AssociatedModel;
relatedModel: string | (new() => AssociatedModel);
/** The key for this relationship on this model */
key: string;
// meh, no string enums in TS. Just have to trust the user not to be a fool
/** The cardinality of this relationship. */
type: string;
/** Determines the type of collection used. If used, the relatedModel property is ignored */
collectionType?: typeof Backbone.Collection|string;
collectionType?: string | (new() => Backbone.Collection<any>);
/** If set to true, then the attribute will not be serialized in toJSON() calls. Defaults to false */
isTransient?: boolean;
/** Specify remoteKey to serialize the key to a different key name in toJSON() calls. Useful in ROR nested-attributes like scenarios. */