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

    Interface IExternalBookCollection

    The workbook's external books, in [n] order.

    Positional, not a key — see IExternalBook. [n] in a formula is this collection's index at read time; nothing in the source file names a book any other way.

    A link is created by a formula and removed by breaking it — Excel's model, and ours. Typing 'C:\path\[Budget.xlsx]Sheet1'!A1 into a cell adds a book here with an empty cache; add is the same step without the formula. IExternalBook.breakLink is what Excel's Workbook Links pane does: every citing formula becomes its values, then the slot goes.

    interface IExternalBookCollection {
        isICollection: true;
        isIExternalBookCollection: true;
        "[iterator]"(): IterableIterator<IExternalBook>;
        add(
            options: IExternalBookCollection.AddOptions,
            txOptions?: ITransaction.OperationOptions,
        ): IExternalBook;
        addListeners(
            listeners: IExternalBookCollection.IListeners,
            options?: IListener.Options,
        ): Remove;
        at(index: number): IExternalBook | undefined;
        breakAll(txOptions?: ITransaction.OperationOptions): number;
        close(): void;
        every(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => boolean,
        ): boolean;
        filter<S extends IExternalBook>(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => value is S,
        ): S[];
        filter(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => boolean,
        ): IExternalBook[];
        find<S extends IExternalBook>(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => value is S,
        ): S | undefined;
        find(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => boolean,
        ): IExternalBook | undefined;
        findIndex(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => boolean,
        ): number;
        forEach(
            fn: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => void,
        ): void;
        getById(id: string): IExternalBook | null;
        getCount(): number;
        getItems(options?: ICollection.GetItemsOptions): IExternalBook[];
        indexOf(item: IExternalBook): number;
        isClosed(): boolean;
        map<U>(
            fn: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => U,
        ): U[];
        refreshAll(): Promise<RefreshResult[]>;
        some(
            predicate: (
                value: IExternalBook,
                index: number,
                items: readonly IExternalBook[],
            ) => boolean,
        ): boolean;
        toArray(): IExternalBook[];
        toJSON(): (IExternalBook.JSON | null)[] | null;
    }

    Hierarchy (View Summary)

    Index
    isICollection: true

    For runtime type checking.

    isIExternalBookCollection: true

    For runtime type checking.

    • Iterates the collection's items.

      Returns IterableIterator<IExternalBook>

      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 IExternalBook | undefined

    • Closes the collection; the workbook's to call.

      Returns void

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

      Parameters

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

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

      Returns boolean

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

      Type Parameters

      Parameters

      • predicate: (
            value: IExternalBook,
            index: number,
            items: readonly IExternalBook[],
        ) => 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: IExternalBook,
            index: number,
            items: readonly IExternalBook[],
        ) => boolean

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

      Returns IExternalBook | undefined

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

      Parameters

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

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

      Returns number

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

      Parameters

      Returns void

    • The book carrying a runtime id, or null — for an unknown id and for a DDE/OLE gap alike, since a gap has an id but no book.

      Parameters

      • id: string

      Returns IExternalBook | null

    • Returns the total items available.

      Returns number

      returns the total number of items available.

    • 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

      Returns U[]

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

      Parameters

      • predicate: (
            value: IExternalBook,
            index: number,
            items: readonly IExternalBook[],
        ) => 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 IExternalBook[]

      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.

    • Returns (IExternalBook.JSON | null)[] | null

      The positional array, gaps included — null at index i means [i+1] is a DDE/OLE link or otherwise unmodeled, not that it is absent. null overall if there are no entries at all (nothing to preserve).