kjelsrud.dev/node_modules/mdast-util-to-hast/lib/wrap.d.ts
2023-07-19 21:31:30 +02:00

22 lines
646 B
TypeScript

/**
* @typedef {import('hast').Content} Content
* @typedef {import('hast').Text} Text
*/
/**
* Wrap `nodes` with line endings between each node.
*
* @template {Content} Type
* Node type.
* @param {Array<Type>} nodes
* List of nodes to wrap.
* @param {boolean | null | undefined} [loose=false]
* Whether to add line endings at start and end.
* @returns {Array<Type | Text>}
* Wrapped nodes.
*/
export function wrap<Type extends import('hast').Content>(
nodes: Type[],
loose?: boolean | null | undefined
): (import('hast').Text | Type)[]
export type Content = import('hast').Content
export type Text = import('hast').Text