blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
35 lines (34 loc) • 907 B
TypeScript
import BlazeElement from "./element";
import "./styles/list.css";
export default class BlazeList<T extends BlazeElement<HTMLElement>> extends BlazeElement<HTMLDivElement> {
items: T[];
autoScroll: boolean;
/**
* Create a {@link BlazeList}.
*
* @param autoScroll Wether or not new items should be scrolled into view
*/
constructor(autoScroll?: boolean);
/**
* Adds the given items to the list.
*
* @param items The items to add
*/
addItems(...items: T[]): void;
/**
* Removes the item at the given index from the list.
*
* @param index The index of the item to remove
*/
removeItem(index: number): void;
/**
* Removes an item from the list.
*
* @param item The item to remove
*/
removeItem(item: T): void;
/**
* Removes all items from the list.
*/
clearItems(): void;
}