import Signal from "../../events/signal/Signal";

export default class List<T> {
    get length(): number

    on: {
        added: Signal<T, number>,
        removed: Signal<T, number>,
        changed: Signal<void>,
    }

    constructor(elements?: T[])

    get(index: number): T

    add(el: T): this

    addAll(el: T[]): void

    insert(index: number, element: T): this

    remove(index: number): T

    removeOneOf(value: T): boolean

    removeIf(condition: (element: T) => boolean, thisArg?: any): void

    removeOneIf(condition: (element: T) => boolean, thisArg?: any): void

    reset(): void

    asArray(): T[]

    forEach(f: (element: T, index: number) => any, thisArg?: any): void

    map<X>(f: (element: T, index: number) => X, thisArg?: any): X[]

    isEmpty(): boolean

    indexOf(el: T): number

    find(matcher: (element: T) => boolean): T | undefined

    equals(other: List<T>): boolean
}
