/** * @typedef {import('unist').Node} Node * @typedef {import('unist').Parent} Parent * @typedef {import('unist').Literal} Literal * @typedef {Object.} Props * @typedef {Array.|string} ChildrenOrValue * * @typedef {(, C extends Node[]>(type: T, props: P, children: C) => {type: T, children: C} & P)} BuildParentWithProps * @typedef {(>(type: T, props: P, value: string) => {type: T, value: string} & P)} BuildLiteralWithProps * @typedef {(>(type: T, props: P) => {type: T} & P)} BuildVoidWithProps * @typedef {((type: T, children: C) => {type: T, children: C})} BuildParent * @typedef {((type: T, value: string) => {type: T, value: string})} BuildLiteral * @typedef {((type: T) => {type: T})} BuildVoid */ export var u: BuildVoid & BuildVoidWithProps & BuildLiteral & BuildLiteralWithProps & BuildParent & BuildParentWithProps export type Node = import('unist').Node export type Parent = import('unist').Parent export type Literal = import('unist').Literal export type Props = { [x: string]: unknown } export type ChildrenOrValue = Array | string export type BuildParentWithProps = < T extends string, P extends Record, C extends import('unist').Node[] >( type: T, props: P, children: C ) => { type: T children: C } & P export type BuildLiteralWithProps = < T extends string, P extends Record >( type: T, props: P, value: string ) => { type: T value: string } & P export type BuildVoidWithProps = < T extends string, P extends Record >( type: T, props: P ) => { type: T } & P export type BuildParent = ( type: T, children: C ) => { type: T children: C } export type BuildLiteral = ( type: T, value: string ) => { type: T value: string } export type BuildVoid = ( type: T ) => { type: T }