SheetXL - v0.3.20
    Preparing search index...

    Interface IConditionalFormat

    Represents a conditional formatting rule for a range.

    Used for modifying the type and rules of a conditional formatting entry.

    • Conditional formatting rules can be used to highlight, format, or modify cell appearance based on data conditions or criteria.

    • Conditional formatting help users identify patterns, trends, and exceptions in data by applying visual styles dynamically.

    interface IConditionalFormat {
        isIConditionalFormat: true;
        isIModel: true;
        addListeners(listeners: IListeners, options?: IListener.Options): Remove;
        beginCommit(options?: string | OperationOptions): ITransaction;
        cloneWithUpdate(updates: ResolvableProperties<P>): this;
        close(): void;
        delete(options?: OperationOptions): void;
        doBatch<R = any>(
            callback: (commit: ICommit) => R | Promise<R>,
            options?: string | OperationOptions,
        ): R | Promise<R>;
        getColorScale(): ColorScale;
        getContainsText(): any;
        getCoords(): Readonly<IRange.Coords>;
        getCustom(): any;
        getDataBar(): DataBar;
        getIconSet(): IConditionalFormat.IconSet;
        getPresetCriteria(): IStyle.Properties<Serializable>;
        getPriority(): number;
        getPropertiesAt(
            rowIndex: number,
            colIndex: number,
            value: Scalar,
        ): Readonly<P>;
        getRanges(): ICellRanges;
        getScalar(): any;
        getSnapshot(options?: ReferenceableClipboard.CopyOptions): ISnapshot;
        getStopIfTrue(): boolean;
        getTopBottom(): any;
        getType(): IConditionalFormat.Type;
        getUUID(): string;
        isClosed(): boolean;
        isDeleted(): boolean;
        isReadOnly(): boolean;
        setPriority(priority: number, options?: OperationOptions): this;
        setRanges(address: ICellRanges.Address, options?: OperationOptions): this;
        setStopIfTrue(stopIfTrue: boolean, options?: OperationOptions): this;
        setType(type: IConditionalFormat.Type, options?: OperationOptions): this;
        toJSON(): IConditionalFormat.JSON;
        update(
            properties: Partial<IConditionalFormat.Properties>,
            options?: OperationOptions,
        ): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    isIConditionalFormat: true

    For runtime type checking.

    isIModel: true

    For runtime type checking.

    Methods

    • Add Listeners.

      Parameters

      Returns Remove

      IListener.ISource.addListeners

    • Batches all 'transactional' changes until they have all be committed or rolled back.

      Parameters

      • Optionaloptions: string | OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns ITransaction

      Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.

      Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.

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

      Returns void

    • Delete the item.

      Parameters

      Returns void

      Not all objects can be deleted.

    • Provides a mechanism to perform a set of operations in a batch.

      Type Parameters

      • R = any

      Parameters

      • callback: (commit: ICommit) => R | Promise<R>

        A callback that performs multiple operations all within the same transaction.

      • Optionaloptions: string | OperationOptions

        Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.

      Returns R | Promise<R>

    • Returns the contains texts settings for this conditional formatting.

      Returns any

      This will be null unless IConditionalFormat.getType is IConditionalFormat.Type.ContainsText.

    • Retrieves the coordinates for the range.

      Returns Readonly<IRange.Coords>

      The range's coordinates.

      The coordinates are not the coordinates where this is contained but the coordinates for access getPropertiesAt.

    • Returns the custom rule settings for this conditional formatting.

      Returns any

      This will be null unless IConditionalFormat.getType is IConditionalFormat.Type.Custom.

    • Retrieves the properties associated with a specified cell within the range.

      Parameters

      • rowIndex: number

        The row index within the range.

      • colIndex: number

        The column index within the range.

      • value: Scalar

        The value at the coordinates.

      Returns Readonly<P>

      The properties associated with the specified cell as a read-only object.

    • Returns the cell value associated with this conditional formatting.

      Returns any

      This will be null unless IConditionalFormat.getType is IConditionalFormat.Type.Scalar.

    • Returns the top/bottom rule settings for this conditional formatting.

      Returns any

      This will be null unless IConditionalFormat.getType is IConditionalFormat.Type.TopBottom.

    • A unique identifier for the record. This will never change.

      Returns string

      This enables the record to be identified across transactions and users in a collaborative environment.

    • Returns true if no more operations are allowed.

      Returns boolean

    • If the model unable to be modified.

      Returns boolean

    • If the model unable to be modified.

      Returns boolean

    • The priority of the conditional format rule as a number relative to other rules.

      Parameters

      • priority: number

        A number that determines the order of the conditional format.

      • Optionaloptions: OperationOptions

      Returns this

      This must always be a positive number and will be unique. If this is the same as another conditional format then that will will be adjusted to be greater than this one.

    • Sets whether to stop evaluating additional conditional formatting rules if this rule is true.

      Parameters

      • stopIfTrue: boolean

        A boolean to indicate if this is a stop.

      • Optionaloptions: OperationOptions

      Returns this

      This will only affect formatting rules for the current range or cell.