webamp/modern/src/runtime/List.ts
Jordan Eldredge 88478a1670
Upgrade to std.mi from Winamp 5.66 (#936)
* Upgrade to std.mi from Winamp 5.66

* Add missing type annotation

* Update usage data
2019-09-28 21:52:42 -07:00

53 lines
968 B
TypeScript

import MakiObject from "./MakiObject";
import { XmlNode } from "../types";
import * as Utils from "../utils";
class List extends MakiObject {
_list: Array<any>;
constructor(node: XmlNode, parent: MakiObject, annotations: Object = {}) {
super(node, parent, annotations);
this._list = [];
}
/**
* getclassname()
*
* Returns the class name for the object.
* @ret The class name.
*/
getclassname() {
return "List";
}
additem(object: any): void {
this._list.push(object);
}
removeitem(pos: number): void {
this._list.splice(pos, 1);
}
enumitem(pos: number): any {
return this._list[pos];
}
finditem(obj: any): number {
return this._list.indexOf(obj);
}
getnumitems(): number {
return this._list.length;
}
removeall(): void {
this._list = [];
}
finditem2(_object: any, startItem: number) {
Utils.unimplementedWarning("finditem2");
return;
}
}
export default List;