Code (2d)
Code editor component.
Properties
| Property | Type | Description |
|---|---|---|
code | SimpleSignal<string, this> | Code content |
language | SimpleSignal<string, this> | Programming language |
highlighter | Signal<any, any, this> | Syntax highlighter |
selection | SimpleSignal<CodeRange, this> | Current selection |
fontSize | SimpleSignal<number, this> | Font size |
Methods
findAllRanges(query: string): CodeRange[]
Finds all matching code ranges.
findFirstRange(query: string): CodeRange | null
Finds the first matching code range.
findLastRange(query: string): CodeRange | null
Finds the last matching code range.
getPointBBox(point: number): BBox
Gets the bounding box of the specified character position.
getSelectionBBox(): BBox
Gets the bounding box of the selection.