API Reference
@univerjs
@univerjs/data-validation
classes
Datavalidationmodel

@univerjs/data-validation v0.4.2Docs


Class: DataValidationModel

Extends

Constructors

new DataValidationModel()

new DataValidationModel(_logService): DataValidationModel

Parameters

ParameterType
_logServiceILogService

Returns

DataValidationModel

Overrides

Disposable.constructor

Defined in

data-validation/src/models/data-validation-model.ts:48 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedcore/src/shared/lifecycle.ts:93 (opens in a new tab)
ruleChange$publicObservable<IRuleChange>undefined-data-validation/src/models/data-validation-model.ts:45 (opens in a new tab)
ruleChangeDebounce$publicObservable<IRuleChange>undefined-data-validation/src/models/data-validation-model.ts:46 (opens in a new tab)

Methods

addRule()

addRule(
   unitId, 
   subUnitId, 
   rule, 
   source, 
   index?): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIDataValidationRule | IDataValidationRule[]
sourceDataValidationChangeSource
index?number

Returns

void

Defined in

data-validation/src/models/data-validation-model.ts:151 (opens in a new tab)


deleteUnitRules()

deleteUnitRules(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Defined in

data-validation/src/models/data-validation-model.ts:238 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

core/src/shared/lifecycle.ts:106 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

core/src/shared/lifecycle.ts:100 (opens in a new tab)


getAll()

getAll(): readonly [string, [string, IDataValidationRule[]][]][]

Returns

readonly [string, [string, IDataValidationRule[]][]][]

Defined in

data-validation/src/models/data-validation-model.ts:246 (opens in a new tab)


getRuleById()

getRuleById(
   unitId, 
   subUnitId, 
   ruleId): undefined | IDataValidationRule

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring

Returns

undefined | IDataValidationRule

Defined in

data-validation/src/models/data-validation-model.ts:209 (opens in a new tab)


getRuleIndex()

getRuleIndex(
   unitId, 
   subUnitId, 
   ruleId): number

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring

Returns

number

Defined in

data-validation/src/models/data-validation-model.ts:214 (opens in a new tab)


getRules()

getRules(unitId, subUnitId): IDataValidationRule[]

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

IDataValidationRule[]

Defined in

data-validation/src/models/data-validation-model.ts:219 (opens in a new tab)


getSubUnitIds()

getSubUnitIds(unitId): string[]

Parameters

ParameterType
unitIdstring

Returns

string[]

Defined in

data-validation/src/models/data-validation-model.ts:242 (opens in a new tab)


getUnitRules()

getUnitRules(unitId): [string, IDataValidationRule[]][]

Parameters

ParameterType
unitIdstring

Returns

[string, IDataValidationRule[]][]

Defined in

data-validation/src/models/data-validation-model.ts:224 (opens in a new tab)


removeRule()

removeRule(
   unitId, 
   subUnitId, 
   ruleId, 
   source): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring
sourceDataValidationChangeSource

Returns

void

Defined in

data-validation/src/models/data-validation-model.ts:190 (opens in a new tab)


updateRule()

updateRule(
   unitId, 
   subUnitId, 
   ruleId, 
   payload, 
   source): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring
payloadIUpdateRulePayload
sourceDataValidationChangeSource

Returns

void

Defined in

data-validation/src/models/data-validation-model.ts:168 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.