# Types

Import these from `@grafloria/renderer`.

## Types

### `DetectionMode`

Also has every member of `String`, listed on its own entry.

Detection mode type

```ts
type DetectionMode = 'all' | 'perpendicular' | 'threshold';
```

### `FanoutSide`

Also has every member of `String`, listed on its own entry.

```ts
type FanoutSide = 'left' | 'right' | 'top' | 'bottom';
```

### `LabelTemplate`

```ts
type LabelTemplate = (ctx: LabelTemplateContext) => VNode | VNode[] | null;
```

### `LinkPart`

Also has every member of `String`, listed on its own entry.

The sub-part of a link that a query point resolved to.

```ts
type LinkPart =
  | 'body'
  | 'label'
  | 'source-endpoint'
  | 'target-endpoint'
  | 'source-arrow'
  | 'target-arrow';
```

### `LinkTemplate`

```ts
type LinkTemplate = (ctx: LinkTemplateContext) => VNode | VNode[] | null;
```

### `PanelCorner`

Also has every member of `String`, listed on its own entry.

Icon/badge anchor: a corner, or `'c'` — dead centre of the node body
(a BPMN event's trigger glyph sits in the middle of its circle).

```ts
type PanelCorner = 'tl' | 'tr' | 'bl' | 'br' | 'c';
```

### `PathGeometry`

A static SVG path string, or a parametric generator that returns the path `d`
for a specific `width × height` box (0,0 at top-left). The generator form is
preferred for shapes whose detail should NOT scale uniformly (rounded corners,
fixed-radius notches); the static form is the quickest way to drop in a figure
authored in a design tool.

```ts
type PathGeometry = string | ((width: number, height: number) => string);
```

**Properties**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `length` | `number` |  | Returns the length of a String object. |

**Members**

- `toString(): string` — Returns a string representation of a string.
- `valueOf(): string` — Returns the primitive value of the specified object.

### `PortLayoutStrategy`

```ts
type PortLayoutStrategy = (input: PortLayoutInput, args: PortLayoutArgs) => { x: number; y: number };
```

### `ShapeSide`

Also has every member of `String`, listed on its own entry.

```ts
type ShapeSide = 'left' | 'right' | 'top' | 'bottom';
```

### `Side`

Also has every member of `String`, listed on its own entry.

```ts
type Side = FanoutSide;
```

### `ToolbarHaloAction`

Also has every member of `String`, listed on its own entry.

The Halo context-toolbar actions a node may expose.

```ts
type ToolbarHaloAction = 'connect' | 'clone' | 'fork' | 'delete';
```

### `ToolbarResolver`

A per-TYPE policy the host installs on the controller.

```ts
type ToolbarResolver = (node: NodeModel) => NodeToolbarConfig | undefined;
```
