@univerjs/data-validation v0.5.4


Class: DataValidationModel

Defined in: data-validation/src/models/data-validation-model.ts:41

Extends

Constructors

new DataValidationModel()

new DataValidationModel(_logService): DataValidationModel

Defined in: data-validation/src/models/data-validation-model.ts:48

Parameters

ParameterType
_logServiceILogService

Returns

DataValidationModel

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedcore/src/shared/lifecycle.ts:96
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

Defined in: data-validation/src/models/data-validation-model.ts:156

Parameters

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

Returns

void


deleteUnitRules()

deleteUnitRules(unitId): void

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

Parameters

ParameterType
unitIdstring

Returns

void


dispose()

dispose(): void

Defined in: core/src/shared/lifecycle.ts:109

Returns

void

Inherited from

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getAll()

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

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

Returns

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


getRuleById()

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

Defined in: data-validation/src/models/data-validation-model.ts:214

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring

Returns

| undefined | IDataValidationRule


getRuleIndex()

getRuleIndex(
   unitId, 
   subUnitId, 
   ruleId): number

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

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring

Returns

number


getRules()

getRules(unitId, subUnitId): IDataValidationRule[]

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

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

IDataValidationRule[]


getSubUnitIds()

getSubUnitIds(unitId): string[]

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

Parameters

ParameterType
unitIdstring

Returns

string[]


getUnitRules()

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

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

Parameters

ParameterType
unitIdstring

Returns

[string, IDataValidationRule[]][]


removeRule()

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

Defined in: data-validation/src/models/data-validation-model.ts:195

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring
sourceDataValidationChangeSource

Returns

void


updateRule()

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

Defined in: data-validation/src/models/data-validation-model.ts:173

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIdstring
payloadIUpdateRulePayload
sourceDataValidationChangeSource

Returns

void