• Version 2.0.6
  • Published
  • 6.6 kB
  • No dependencies
  • MIT license


npm i @types/unist
yarn add @types/unist
pnpm add @types/unist


TypeScript definitions for Unist



interface Data

interface Data {}
  • Information associated by the ecosystem with the node. Space is guaranteed to never be specified by unist or specifications implementing unist.

index signature

[key: string]: unknown;

    interface Literal

    interface Literal<Value = unknown, TData extends object = Data>
    extends Node<TData> {}
    • Nodes containing a value.

    property value

    value: Value;

      interface Node

      interface Node<TData extends object = Data> {}
      • Syntactic units in unist syntax trees are called nodes.

      property data

      data?: TData | undefined;
      • Information from the ecosystem.

      property position

      position?: Position | undefined;
      • Location of a node in a source document. Must not be present if a node is generated.

      property type

      type: string;
      • The variant of a node.

      interface Parent

      interface Parent<
      ChildNode extends Node<object> = Node,
      TData extends object = NodeData<ChildNode>
      > extends Node<TData> {}
      • Nodes containing other nodes.

      property children

      children: ChildNode[];
      • List representing the children of a node.

      interface Point

      interface Point {}
      • One place in a source file.

      property column

      column: number;
      • Column in a source file (1-indexed integer).

      property line

      line: number;
      • Line in a source file (1-indexed integer).

      property offset

      offset?: number | undefined;
      • Character in a source file (0-indexed integer).

      interface Position

      interface Position {}
      • Location of a node in a source file.

      property end

      end: Point;
      • Place of the first character after the parsed source region.

      property indent

      indent?: number[] | undefined;
      • Start column at each index (plus start line) in the source region, for elements that span multiple lines.

      property start

      start: Point;
      • Place of the first character of the parsed source region.

      Type Aliases

      type NodeData

      type NodeData<TNode extends Node<object>> = TNode extends Node<infer TData>
      ? TData
      : never;
      • Util for extracting type of Node.data

        Example 1

        NodeData<Node<{ key: string }>> -> { key: string }

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.


      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/unist.

      • Markdown
      • HTML
        <a href="https://www.jsdocs.io/package/@types/unist"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>