API Reference
@univerjs
@univerjs/sheets
classes
Worksheetprotectionrulemodel

@univerjs/sheets v0.4.2Docs


Class: WorksheetProtectionRuleModel

Constructors

new WorksheetProtectionRuleModel()

new WorksheetProtectionRuleModel(): WorksheetProtectionRuleModel

Returns

WorksheetProtectionRuleModel

Properties

PropertyTypeDefined in
resetOrder$Observable<unknown>packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:44 (opens in a new tab)
ruleChange$Observable<{ oldRule: IWorksheetProtectionRule; rule: IWorksheetProtectionRule; subUnitId: string; type: IRuleChangeType; unitId: string; }>packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:40 (opens in a new tab)
ruleRefresh$Observable<unknown>packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:42 (opens in a new tab)
worksheetRuleInitStateChange$Observable<boolean>packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:47 (opens in a new tab)

Methods

addRule()

addRule(unitId, rule): void

Parameters

ParameterType
unitIdstring
ruleIWorksheetProtectionRule

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:57 (opens in a new tab)


changeRuleInitState()

changeRuleInitState(state): void

Parameters

ParameterType
stateboolean

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:49 (opens in a new tab)


deleteRule()

deleteRule(unitId, subUnitId): void

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:63 (opens in a new tab)


deleteUnitModel()

deleteUnitModel(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:117 (opens in a new tab)


fromObject()

fromObject(obj): void

Parameters

ParameterType
objIObjectModel

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:102 (opens in a new tab)


getRule()

getRule(unitId, subUnitId): undefined | IWorksheetProtectionRule

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

undefined | IWorksheetProtectionRule

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:79 (opens in a new tab)


getSheetRuleInitState()

getSheetRuleInitState(): boolean

Returns

boolean

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:53 (opens in a new tab)


getTargetByPermissionId()

getTargetByPermissionId(unitId, permissionId): undefined | null | string[]

Parameters

ParameterType
unitIdstring
permissionIdstring

Returns

undefined | null | string[]

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:138 (opens in a new tab)


resetOrder()

resetOrder(): void

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:134 (opens in a new tab)


ruleRefresh()

ruleRefresh(permissionId): void

Parameters

ParameterType
permissionIdstring

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:130 (opens in a new tab)


setRule()

setRule(
   unitId, 
   subUnitId, 
   rule): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIWorksheetProtectionRule

Returns

void

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:71 (opens in a new tab)


toObject()

toObject(): IObjectModel

Returns

IObjectModel

Defined in

packages/sheets/src/services/permission/worksheet-permission/worksheet-permission-rule.model.ts:83 (opens in a new tab)


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