feat(markdown): Docs for new/updated core methods
This commit is contained in:
parent
a2800dddda
commit
57d50c42da
8 changed files with 256 additions and 20 deletions
25
markdown/dev/reference/api/snippet/asrenderprops/en.md
Normal file
25
markdown/dev/reference/api/snippet/asrenderprops/en.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
title: Snippet.asRenderProps()
|
||||
---
|
||||
|
||||
The `Snippet.asRenderProps()` method will return the data stored in the
|
||||
snippet as a serializable Javascript object. This method is typically
|
||||
not invoked directly but rather called under the hood as a result of
|
||||
calling [`Pattern.getRenderProps()`](/reference/core/pattern/getrenderprops).
|
||||
|
||||
## Signature
|
||||
|
||||
```js
|
||||
Object snippet.asRenderProps()
|
||||
```
|
||||
|
||||
## Returned object properties
|
||||
|
||||
This returns Javascript object has the following properties:
|
||||
|
||||
| Name | Description |
|
||||
| ----:| ----------- |
|
||||
| `attributes` | The result of [Path.attributes.asRenderProps()](/reference/api/attribute/asrenderprops) |
|
||||
| `def` | The ID of the snippet's reference in the `defs` section of the SVG (the snippet code) |
|
||||
| `anchor` | The [Point](/reference/api/point) on which the snippet is anchored, or rather its [`Point.asRenderProps()`](/reference/api/point/asrenderprops) result |
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue