mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
How to access attributes in a strongly-typed manner
Only added comments and examples
This commit is contained in:
19
backbone/backbone.d.ts
vendored
19
backbone/backbone.d.ts
vendored
@@ -113,8 +113,23 @@ declare module Backbone {
|
||||
|
||||
fetch(options?: ModelFetchOptions): JQueryXHR;
|
||||
|
||||
get(attributeName: string): any;
|
||||
set(attributeName: string, value: any, options?: ModelSetOptions): Model;
|
||||
/**
|
||||
* For strongly-typed access to attributes, use the `get` method only privately in public getter properties.
|
||||
* @example
|
||||
* get name(): string {
|
||||
* return super.get("name");
|
||||
* }
|
||||
**/
|
||||
/*private*/ get(attributeName: string): any;
|
||||
|
||||
/**
|
||||
* For strongly-typed assignment of attributes, use the `set` method only privately in public setter properties.
|
||||
* @example
|
||||
* set name(value: string) {
|
||||
* super.set("name", value);
|
||||
* }
|
||||
**/
|
||||
/*private*/ set(attributeName: string, value: any, options?: ModelSetOptions): Model;
|
||||
set(obj: any, options?: ModelSetOptions): Model;
|
||||
|
||||
change(): any;
|
||||
|
||||
Reference in New Issue
Block a user