createSvgAsync<K>
Creates a svg asynchronously.
Not refactored to parameter-object pattern, to keep the parity with
obsidian#createSvg(or createEl, correspondingly).
Import:
import { createSvgAsync } from 'obsidian-dev-utils/html-element';Signature:
function createSvgAsync(tag: K, o: string | SvgElementInfo | undefined, callback: ((el: SVGElementTagNameMap[K]) => Promisable<void>) | undefined): Promise<SVGElementTagNameMap[K]>Parameters:
| Parameter | Type | Description |
|---|---|---|
tag | K | The tag name of the svg to create. |
o | string | SvgElementInfo | undefined | The svg information. |
callback | ((el: SVGElementTagNameMap[K]) => Promisable<void>) | undefined | The callback to call when the svg is created. |
Returns: Promise<SVGElementTagNameMap[K]> — A Promise that resolves to the svg.