提交 0ba01095 编写于 作者: J Joao Moreno

fix types

上级 264055f0
......@@ -65,7 +65,7 @@ export class ListView<T> implements IDisposable {
this.items = [];
this.itemId = 0;
this.rangeMap = new RangeMap();
this.renderers = toObject<IRenderer<T, any>, IRenderer<T, any>>(renderers, r => r.templateId);
this.renderers = toObject<IRenderer<T, any>>(renderers, r => r.templateId);
this.cache = new RowCache(this.renderers);
this.lastRenderTop = 0;
......
......@@ -51,7 +51,7 @@ class TraitRenderer<T, D> implements IRenderer<T, ITraitTemplateData<D>>
private renderer: IRenderer<T, D>
) { }
public get templateId(): string {
get templateId(): string {
return this.renderer.templateId;
}
......
......@@ -148,8 +148,8 @@ export function assign(destination: any, ...sources: any[]): any {
return destination;
}
export function toObject<T, R>(arr: T[], keyMap: (T) => string, valueMap: (T) => R = x => x): { [key: string]: R } {
return arr.reduce((o, d) => assign(o, { [keyMap(d)]: valueMap(d) }), Object.create(null));
export function toObject<T>(arr: T[], keyMap: (t: T) => string): { [key: string]: T } {
return arr.reduce((o, d) => assign(o, { [keyMap(d)]: d }), Object.create(null));
}
export function equals(one: any, other: any): boolean {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册