UNPKG

1.29 kBTypeScriptView Raw
1/**
2 * Inspect a node, without color.
3 *
4 * @param {unknown} tree
5 * Tree to inspect.
6 * @param {Options | null | undefined} [options]
7 * Configuration.
8 * @returns {string}
9 * Pretty printed `tree`.
10 */
11export function inspectNoColor(
12 tree: unknown,
13 options?: Options | null | undefined
14): string
15/**
16 * Inspects a node, using color.
17 *
18 * @param {unknown} tree
19 * Tree to inspect.
20 * @param {Options | null | undefined} [options]
21 * Configuration (optional).
22 * @returns {string}
23 * Pretty printed `tree`.
24 */
25export function inspectColor(
26 tree: unknown,
27 options?: Options | null | undefined
28): string
29/**
30 * Inspects a node, using color.
31 *
32 * @param {unknown} tree
33 * Tree to inspect.
34 * @param {Options | null | undefined} [options]
35 * Configuration (optional).
36 * @returns {string}
37 * Pretty printed `tree`.
38 */
39export function inspect(
40 tree: unknown,
41 options?: Options | null | undefined
42): string
43export type Node = import('unist').Node
44/**
45 * Configuration.
46 */
47export type Options = {
48 /**
49 * Whether to include positional information (default: `true`).
50 */
51 showPositions?: boolean | null | undefined
52}
53/**
54 * Info passed around.
55 */
56export type State = {
57 /**
58 * Whether to include positional information.
59 */
60 showPositions: boolean
61}