mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
49
blocksuite/docs/api/@blocksuite/std/gfx/functions/convert.md
Normal file
49
blocksuite/docs/api/@blocksuite/std/gfx/functions/convert.md
Normal file
@@ -0,0 +1,49 @@
|
||||
[**BlockSuite API Documentation**](../../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[BlockSuite API Documentation](../../../../README.md) / [@blocksuite/std](../../README.md) / [gfx](../README.md) / convert
|
||||
|
||||
# Function: convert()
|
||||
|
||||
> **convert**\<`V`, `T`\>(`fn`): (`_`, `context`) => `ClassAccessorDecoratorResult`\<`T`, `V`\>
|
||||
|
||||
The convert decorator is used to convert the property value before it's
|
||||
set to the Y map.
|
||||
|
||||
Note:
|
||||
1. This decorator function will not execute in model initialization.
|
||||
|
||||
## Type Parameters
|
||||
|
||||
### V
|
||||
|
||||
`V`
|
||||
|
||||
### T
|
||||
|
||||
`T` *extends* `GfxPrimitiveElementModel`\<`BaseElementProps`\>
|
||||
|
||||
## Parameters
|
||||
|
||||
### fn
|
||||
|
||||
(`propValue`, `instance`) => `unknown`
|
||||
|
||||
## Returns
|
||||
|
||||
`Function`
|
||||
|
||||
### Parameters
|
||||
|
||||
#### \_
|
||||
|
||||
`unknown`
|
||||
|
||||
#### context
|
||||
|
||||
`ClassAccessorDecoratorContext`
|
||||
|
||||
### Returns
|
||||
|
||||
`ClassAccessorDecoratorResult`\<`T`, `V`\>
|
||||
Reference in New Issue
Block a user