SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IMovableCollection

    Holds a collection of IMovables.

    interface IMovableCollection {
        isICollection: true;
        isIMovableCollection: true;
        "[iterator]"(): IterableIterator<IMovable>;
        add(options?: IMovableCollection.AddOptions<any>): Promise<IMovable>;
        addListeners(
            listeners: ICollection.IListeners,
            options?: IListener.Options,
        ): Remove;
        addPicture(
            picture: string | IResource | IResourceCollection.AddOptions,
            options?: IMovableCollection.AddOptions<any>,
        ): Promise<IMovable>;
        at(index: number): IMovable | undefined;
        every(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => boolean,
        ): boolean;
        filter<S extends IMovable>(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => value is S,
        ): S[];
        filter(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => boolean,
        ): IMovable[];
        find<S extends IMovable>(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => value is S,
        ): S | undefined;
        find(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => boolean,
        ): IMovable | undefined;
        findIndex(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => boolean,
        ): number;
        forEach(
            fn: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => void,
        ): void;
        getCount(): number;
        getItems(options?: IMovableCollection.GetItemsOptions): IMovable[];
        group(
            movables: readonly IMovable[],
            options?: GroupOptions,
        ): Promise<IMovable>;
        indexOf(item: IMovable): number;
        isClosed(): boolean;
        map<U>(
            fn: (value: IMovable, index: number, items: readonly IMovable[]) => U,
        ): U[];
        some(
            predicate: (
                value: IMovable,
                index: number,
                items: readonly IMovable[],
            ) => boolean,
        ): boolean;
        toArray(): IMovable[];
        updateSelected(update: (movable: IMovable) => void, action?: string): void;
    }

    Hierarchy (View Summary)

    Index
    isICollection: true

    For runtime type checking.

    isIMovableCollection: true

    For runtime type checking.

    • Iterates the collection's items.

      Returns IterableIterator<IMovable>

      The unfiltered walk — for (const sheet of wb.getSheets()). Every other iterable surface in the SDK (ICellRange, ICellRegions, ICellRanges) reads this way, so a collection that did not was a trap: for…of over one is the obvious line to write and it threw at runtime with nothing in the types to warn first.

      getItems remains the call that takes options — filtering, ordering, anything parameterized. This is sugar over the unfiltered case, not a replacement for it.

    • Returns the item at the given index, or undefined if there is none.

      Parameters

      • index: number

        The position in iteration order. A negative index counts back from the end, as Array.prototype.at does.

      Returns IMovable | undefined

    • Returns true if the predicate accepts every item, including when there are none.

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => boolean

        Called once per item in iteration order until it returns false.

      Returns boolean

    • Returns the items the predicate accepts, in iteration order.

      Type Parameters

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => value is S

        Called once per item.

      Returns S[]

    • Returns the items the predicate accepts, in iteration order.

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => boolean

        Called once per item.

      Returns IMovable[]

    • Returns the first item the predicate accepts, or undefined if it accepts none.

      Type Parameters

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => value is S

        Called once per item in iteration order until it returns true.

      Returns S | undefined

    • Returns the first item the predicate accepts, or undefined if it accepts none.

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns IMovable | undefined

    • Returns the index of the first item the predicate accepts, or -1 if it accepts none.

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns number

    • Calls the function once per item, in iteration order.

      Parameters

      • fn: (value: IMovable, index: number, items: readonly IMovable[]) => void

        Called once per item.

      Returns void

    • Returns the total items available.

      Returns number

      returns the total number of items available.

    • Groups movables of this collection into one: a new movable whose content is an IGroup holding them as members, in their z-order, at the union of the boxes they occupy.

      Parameters

      Returns Promise<IMovable>

      The group's movable.

      One undo step. The group's child space equals its frame, so each member keeps the size it had. IGroup.ungroup is the inverse.

    • Returns the index of the item in iteration order, or -1 if it is not in the collection.

      Parameters

      Returns number

    • Returns true once the collection has been closed.

      Returns boolean

      A closed collection is empty and announces nothing further. Collections that are closed by their owner (the workbook's names, functions and modules, when the workbook closes) announce it once with ICollection.Events.onClose; the others are never closed and always return false.

    • Returns the result of calling the function on every item, in iteration order.

      Type Parameters

      • U

      Parameters

      • fn: (value: IMovable, index: number, items: readonly IMovable[]) => U

        Called once per item.

      Returns U[]

    • Returns true if the predicate accepts at least one item.

      Parameters

      • predicate: (value: IMovable, index: number, items: readonly IMovable[]) => boolean

        Called once per item in iteration order until it returns true.

      Returns boolean

    • Returns the items as a fresh array, in iteration order.

      Returns IMovable[]

      The call to make when an array is really wanted. The array is the caller's: changing it does not change the collection, and it does not follow later changes to the collection.

    • Update all of the selected movable in a single transaction

      Parameters

      • update: (movable: IMovable) => void
      • Optionalaction: string

      Returns void