SheetXL - v0.3.20
    Preparing search index...

    Interface INamedCollection

    A collection of INamed items.

    interface INamedCollection {
        isNamedCollection: true;
        add(named: INamed): INamed;
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        addReference(
            name: string,
            reference: ICellRanges.Address,
            replaceExisting?: boolean,
        ): IReference;
        close(): void;
        findValidName(
            template: string,
            scope?: string,
            ignoreExisting?: boolean,
        ): string;
        fromJSON(json: JSON): void;
        getByName(name: string, global?: boolean): INamed<any>;
        getCount(): number;
        getRanges(address: ICellRanges.Address): ICellRanges;
        isClosed(): boolean;
        lookupByRanges(ranges: ICellRanges.Address): INamed<any>[];
        search(options?: SearchOptions): INamed<any>[];
        toJSON(): JSON;
        validateName(name: string, scope?: string, ignoreExisting?: boolean): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    isNamedCollection: true

    Used for runtime reflection.

    Methods

    • Add a item to the collection.

      Parameters

      • named: INamed

        The item to add.

      Returns INamed

      This will throw an error if getNamed() is invalid or am item with the same name already exists.

    • Add Listeners.

      Parameters

      Returns Remove

      IListener.ISource.addListeners

    • Add a named reference.

      Parameters

      • name: string

        The name of the range.

      • reference: ICellRanges.Address

        An address or formula

      • OptionalreplaceExisting: boolean

        If true will replace existing ranges if one already exists. default false.

      Returns IReference

      This is case insensitive, must be unique, and must not have any spaces. This will throw an error if the name is invalid or already exists.

    • Close the record and cleans resources. Can't be undone.

      Returns void

    • Returns a new valid name given the name return a valid name that closely matches. This function works by incrementing either the last number or append a number.

      Parameters

      • template: string

        The range to used as a template.

      • Optionalscope: string

        The scope of the range. If null then this will look for a globally scoped. default null.

      • OptionalignoreExisting: boolean

        If true then won't check to see if the name is already used. default false.

      Returns string

      A valid name. If the name used is valid then will return the same name.

      Error If the template name is invalid.

    • Loads value from JSON, this will clear any existing state

      Parameters

      • json: JSON

      Returns void

    • Lookup a named range with a given name.

      Parameters

      • name: string

        Case insensitive name to lookup

      • Optionalglobal: boolean

        If true then will search all scopes. default false

      Returns INamed<any>

    • Returns the total items available.

      Returns number

      Useful as a quick escape for search.

    • Returns true if no more operations are allowed.

      Returns boolean

    • Lookup a named range by WorkbookRangeCoords. This will only return a match if all the ranges are exact matches.

      Parameters

      Returns INamed<any>[]

      Use search({ address }) instead.

    • Search the named items. These are sorted by type then by name.

      Parameters

      • Optionaloptions: SearchOptions

      Returns INamed<any>[]

    • Serialize the state.

      Returns JSON

    • Validates a name is valid. This is a convenience method That calls findValidName and throws an error if the name returned is not the same.

      Parameters

      • name: string
      • Optionalscope: string
      • OptionalignoreExisting: boolean

      Returns void

      Error If findValidName does not return the same value as the name checking.