Types
Import these from @grafloria/renderer.
Types
AnchorFn
tstype AnchorFn = (ctx: AnchorContext) => AnchorResult;
BuiltinToolId
The built-in gesture tools, by name. A registration may REPLACE any of them.
tstype BuiltinToolId = 'select' | 'node-drag' | 'link-draw' | 'marquee' | 'pan';
CapabilityName
The names an extension may request. Mirrors the keys of {@link ExtensionCapabilities}.
tstype CapabilityName =
| 'shapes'
| 'links'
| 'routers'
| 'templates'
| 'animations'
| 'tools'
| 'panels';
ConnectionPointFn
Return null to decline and fall through to the default pipeline.
tstype ConnectionPointFn = (ctx: ConnectionPointContext) => ConnectionPointResult | null;
ConnectionValidator
Return false (or a reason string) to veto.
tstype ConnectionValidator = (candidate: ConnectionCandidate) => boolean | string;
ConnectorFn
Must return a complete SVG path d.
tstype ConnectorFn = (ctx: ConnectorContext) => string;
Disposer
The universal teardown handle. Idempotent by contract.
tstype Disposer = () => void;
ExtSide
tstype ExtSide = 'left' | 'right' | 'top' | 'bottom';
LazyExtension
A lazily-loaded extension: nothing is imported until activate(id).
tstype LazyExtension<C extends CapabilityName = CapabilityName> = () => Promise<
Extension<C> | { default: Extension<C> }
>;
NodeComponentRegistry
type → component.
tstype NodeComponentRegistry = Record<string, NodeComponent<never>>;
NodeRenderFn
A component's render function.
Return a VNode to have the renderer patch it (the framework-agnostic path),
or take the HTMLElement and own it yourself (the React/Angular/Vue path —
mount a portal into it and return void).
tstype NodeRenderFn<D = Record<string, unknown>> = (
props: NodeComponentProps<D>,
element: HTMLElement
) => VNode | void;
PortalPlacement
Corner placements for a screen-space portal.
tstype PortalPlacement =
| 'top-left'
| 'top-right'
| 'bottom-left'
| 'bottom-right'
| 'top-center'
| 'bottom-center'
| 'center'
/** No positioning at all — you own `style`/`class`. */
| 'none';
Selector
tstype Selector<T> = (snapshot: DiagramSnapshot) => T;
ToolId
tstype ToolId = BuiltinToolId | (string & {});
Was this page helpful?