我正在扩展一个Backbone类(View),我的类已经将className定义为在运行时进行评估的函数(根据Backbone规范,这是一个可接受的选项)。
但是,index.d.ts仅将className定义为字符串。
我是否可以扩展到定义以允许className成为函数?
提前感谢...
class View<TModel extends Model> extends Events {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
private static extend(properties: any, classProperties?: any): any;
constructor(options?: ViewOptions<TModel>);
initialize(options?: ViewOptions<TModel>): void;
/**
* Events hash or a method returning the events hash that maps events/selectors to methods on your View.
* For assigning events as object hash, do it like this: this.events = <any>{ "event:selector": callback, ... };
* That works only if you set it in the constructor or the initialize method.
**/
events(): EventsHash;
$(selector: string): JQuery;
model: TModel;
collection: Collection<TModel>;
//template: (json, options?) => string;
setElement(element: HTMLElement|JQuery, delegate?: boolean): View<TModel>;
id: string;
cid: string;
className: string;
tagName: string;
el: any;
$el: JQuery;
setElement(element: any): View<TModel>;
attributes: any;
$(selector: any): JQuery;
render(): View<TModel>;
remove(): View<TModel>;
make(tagName: any, attributes?: any, content?: any): any;
delegateEvents(events?: EventsHash): any;
delegate(eventName: string, selector: string, listener: Function): View<TModel>;
undelegateEvents(): any;
undelegate(eventName: string, selector?: string, listener?: Function): View<TModel>;
_ensureElement(): void; }