nape-js API
    Preparing search index...

    Interface TypedListLike<T>

    Structural interface for all dynamically-generated Nape list classes (BodyList, ShapeList, CompoundList, etc.).

    These classes are created at runtime by createListClasses and placed in the nape namespace, so they cannot be imported directly. Use this interface as the return type for Space / Body query methods.

    interface TypedListLike<T> {
        length: number;
        "[iterator]"(): Iterator<T, any, any>;
        add(obj: T): boolean;
        at(index: number): T;
        clear(): void;
        copy(deep?: boolean): TypedListLike<T>;
        empty(): boolean;
        filter(lambda: (obj: T) => boolean): TypedListLike<T>;
        foreach(lambda: (obj: T) => void): void;
        has(obj: T): boolean;
        iterator(): Iterable<T>;
        merge(xs: TypedListLike<T>): void;
        pop(): T;
        push(obj: T): boolean;
        remove(obj: T): boolean;
        shift(): T;
        toArray(): T[];
        unshift(obj: T): boolean;
    }

    Type Parameters

    • T

    Hierarchy

    • Iterable<T>
      • TypedListLike
    Index

    Properties

    length: number

    Number of elements in the list.

    Methods

    • Returns Iterator<T, any, any>