@univerjs/data-validation v0.5.0-beta.1 • Docs


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

Properties

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

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:156


deleteUnitRules()

deleteUnitRules(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Defined in

data-validation/src/models/data-validation-model.ts:243


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

core/src/shared/lifecycle.ts:106


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

core/src/shared/lifecycle.ts:100


getAll()

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

Returns

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

Defined in

data-validation/src/models/data-validation-model.ts:251


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:214


getRuleIndex()

getRuleIndex(
   unitId, 
   subUnitId, 
   ruleId): number

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring

Returns

number

Defined in

data-validation/src/models/data-validation-model.ts:219


getRules()

getRules(unitId, subUnitId): IDataValidationRule[]

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

IDataValidationRule[]

Defined in

data-validation/src/models/data-validation-model.ts:224


getSubUnitIds()

getSubUnitIds(unitId): string[]

Parameters

ParameterType
unitIdstring

Returns

string[]

Defined in

data-validation/src/models/data-validation-model.ts:247


getUnitRules()

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

Parameters

ParameterType
unitIdstring

Returns

[string, IDataValidationRule[]][]

Defined in

data-validation/src/models/data-validation-model.ts:229


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:195


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:173