Options
All
  • Public
  • Public/Protected
  • All
Menu

@colin_t/lezer-tree-visualizer

Index

Type aliases

ColorState

ColorState: { bg: ColorType | null; fg: ColorType | null; update_bg: boolean; update_fg: boolean }

Used by the Writer to store the currently selected colors.

Type declaration

ColorType

ColorType: ColorType4bit | ColorType8bit | { rgb: RGB }

ColorType3bit

ColorType3bit: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7

ColorType4bit

ColorType4bit: ColorType3bit | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15

Type of a 4-bit color (8 colors with a brightness bit).

see

https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit

ColorType8bit

ColorType8bit: [5, number]

FilterFunction

FilterFunction: (node: SyntaxNode) => VisibilityModifierValue
see

Options.filter

returns

One of the following values:

Value Description
Hidden The node is hidden
Shown The node is visible
Collapsed Only the node name is visible, the rest remains as an ellipsis

Type declaration

RGB

RGB: [number, number, number]

Type of a 24-bit RGB color.

VisibilityModifierValue

VisibilityModifierValue: typeof VisibilityModifier[keyof typeof VisibilityModifier]

Variables

Const Color

Color: { Black: ColorType4bit; Blue: ColorType4bit; BrightCyan: ColorType4bit; DarkBlue: ColorType4bit; DarkCyan: ColorType4bit; DarkGray: ColorType4bit; DarkGreen: ColorType4bit; DarkMagenta: ColorType4bit; DarkRed: ColorType4bit; DarkYellow: ColorType4bit; Green: ColorType4bit; LightGray: ColorType4bit; Magenta: ColorType4bit; Red: ColorType4bit; White: ColorType4bit; Yellow: ColorType4bit; vsc: { Black: ColorType; Blue: ColorType; BrightCyan: ColorType; DarkBlue: ColorType; DarkCyan: ColorType; DarkGray: ColorType; DarkGreen: ColorType; DarkMagenta: ColorType; DarkRed: ColorType; DarkYellow: ColorType; Green: ColorType; LightGray: ColorType; Magenta: ColorType; Red: ColorType; White: ColorType; Yellow: ColorType }; fastEquals: any; to3bit: any; toRGB: any } = ...

Default terminal colors (4-bit) and helper functions.

Type declaration

Const ColorWriter

ColorWriter: typeof OsColorWriter | typeof WebColorWriter = ...

Const VisibilityModifier

VisibilityModifier: { Collapsed: 2; Hidden: 0; Shown: 1 } = ...

Type declaration

  • Collapsed: 2
  • Hidden: 0
  • Shown: 1

Const defaultOsTheme

defaultOsTheme: Theme = ...

The default color theme for terminals.

Const defaultTheme

defaultTheme: Theme = ...

The default color theme for the current platform.

Const defaultWebTheme

defaultWebTheme: Theme = ...

The default color theme for web consoles.

Functions

visualize

  • visualize(cursor: TreeCursor, src: Source, options?: Options): void
  • Visualizes a syntax tree (or node) by printing it in the console.

    Parameters

    • cursor: TreeCursor

      Lezer tree cursor.

    • src: Source

      Source code of the tree.

    • options: Options = {}

    Returns void

Generated using TypeDoc