mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-19 00:31:39 +01:00
fix typescript error
This commit is contained in:
parent
6aa79cf6e2
commit
220f35ae03
@ -26,6 +26,7 @@ import {BaseObservableList as ObservableList} from "../../../../../observable/li
|
|||||||
|
|
||||||
export interface TileView extends IView {
|
export interface TileView extends IView {
|
||||||
readonly value: SimpleTile;
|
readonly value: SimpleTile;
|
||||||
|
onClick(event: UIEvent);
|
||||||
}
|
}
|
||||||
export type TileViewConstructor = new (tile: SimpleTile) => TileView;
|
export type TileViewConstructor = new (tile: SimpleTile) => TileView;
|
||||||
export type ViewClassForEntryFn = (tile: SimpleTile) => TileViewConstructor;
|
export type ViewClassForEntryFn = (tile: SimpleTile) => TileViewConstructor;
|
||||||
@ -184,11 +185,10 @@ class TilesListView extends ListView<SimpleTile, TileView> {
|
|||||||
private onChanged: () => void;
|
private onChanged: () => void;
|
||||||
|
|
||||||
constructor(tiles: ObservableList<SimpleTile>, onChanged: () => void, private readonly viewClassForEntry: ViewClassForEntryFn) {
|
constructor(tiles: ObservableList<SimpleTile>, onChanged: () => void, private readonly viewClassForEntry: ViewClassForEntryFn) {
|
||||||
const options = {
|
super({
|
||||||
list: tiles,
|
list: tiles,
|
||||||
onItemClick: (tileView, evt) => tileView.onClick(evt),
|
onItemClick: (tileView, evt) => tileView.onClick(evt),
|
||||||
};
|
}, entry => {
|
||||||
super(options, entry => {
|
|
||||||
const View = viewClassForEntry(entry);
|
const View = viewClassForEntry(entry);
|
||||||
return new View(entry);
|
return new View(entry);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user