Last updated

API / geotoolkit / controls / tools / editors / operations / Registry / Registry

Class: Registry

operations.Registry.Registry

Registry that stores node edit operations

Table of contents

Constructors
Methods

Contents

Constructors

new Registry()

new Registry()

Methods

applyOperation

applyOperation<T, U>(node, operationType, data): boolean

Tries to apply the operation to the specified node

Type parameters

NameType
Textends OperationDataMap
Uextends keyof OperationDataMap

Parameters

Name Type Description
nodeNodethe target node
operationTypeUthe operation type
dataT[U]the operation data (corresponding to operation callback)

Returns

boolean

true if operation was successfully applied and false otherwise


getOperation

getOperation<T, U>(node, operationType): OperationCallback<T[U]>

Queries edit operation by its type for the specified node

Type parameters

NameType
Textends OperationDataMap
Uextends keyof OperationDataMap

Parameters

Name Type Description
nodeNodethe node
operationTypeUthe operation type

Returns

OperationCallback<T[U]>


isRegistered

isRegistered<T, U>(node, operationType): boolean

Determines if the specified operation type is registered for the specified node

Type parameters

NameType
Textends OperationDataMap
Uextends keyof OperationDataMap

Parameters

Name Type Description
nodeNodethe node
operationTypeUthe operation type

Returns

boolean


register

register<T, U>(nodeType, operationType, operation): Registry

Registers edit operation for the specified node type

Type parameters

NameType
Textends OperationDataMap
Uextends keyof OperationDataMap

Parameters

Name Type Description
nodeTypetypeof Nodethe node type
operationTypeUthe operation type
operationOperationCallback<T[U]>the edit operation callback

Returns

Registry


unregister

unregister<T, U>(nodeType, operationType): Registry

Unregisters edit operation for the specified node type

Type parameters

NameType
Textends OperationDataMap
Uextends string | number | symbol

Parameters

Name Type Description
nodeTypetypeof Nodethe node type
operationTypeUthe operation type

Returns

Registry


getInstance

Static getInstance(): Registry

Gets the singleton instance of Registry class

Returns

Registry