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

    Interface IModule

    Represents a collection of functions. This is analogous to a file.

    interface IModule {
        isIModule: true;
        addListeners(
            listeners: IModule.IListeners,
            options?: IListener.Options,
        ): Remove;
        delete(): void;
        getDiagnostics(): Diagnostic[];
        getErrors(): any[];
        getFunctions(): IFunctionCollection;
        getId?(): string;
        getLanguage(): string;
        getName(): string;
        getScope(): Scope;
        getSource(): string | null;
        toJSON(): CompiledModule;
    }
    Index
    isIModule: true

    For runtime type checking.

    • Remove the module from the collection.

      Returns void

    • Returns all positioned diagnostics (errors + warnings) produced when the module was compiled.

      Returns Diagnostic[]

    • Returns the error-severity diagnostics for the module (a subset of IModule.getDiagnostics).

      Returns any[]

    • Returns the functions in the module.

      Returns IFunctionCollection

      This maybe be empty even if there is source. It is possible that a script might contain only comments or other non-executable code.

    • Returns string

    • The language the function is written in.

      Returns string

    • The name of the module.

      Returns string

    • What the module is bound to — the sheet or workbook that owns it, or null when it is global.

      Returns Scope

      Scope is a visibility rule, not a label: only a globally scoped module contributes functions to the workbook's formula namespace. A UDF declared in a sheet- or workbook-scoped module is unreachable from a cell formula.

      It is also derived, not stored — a module's scope is where it lives. A sheet's modules are reached through ISheet.getModules, and go away with the sheet; there is deliberately no setter, because changing a module's scope would silently promote or demote every function in it.

    • The human-readable source code of the script.

      Returns string | null

      If this property is null, the module may still have compiled functions.

    • Returns a JSON representation of the module.

      Returns CompiledModule