//#region ../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts // ## Interfaces /** * Info associated with nodes by the ecosystem. * * This space is guaranteed to never be specified by unist or specifications * implementing unist. * But you can use it in utilities and plugins to store data. * * This type can be augmented to register custom data. * For example: * * ```ts * declare module 'unist' { * interface Data { * // `someNode.data.myId` is typed as `number | undefined` * myId?: number | undefined * } * } * ``` */ interface Data {} /** * One place in a source file. */ interface Point { /** * Line in a source file (1-indexed integer). */ line: number; /** * Column in a source file (1-indexed integer). */ column: number; /** * Character in a source file (0-indexed integer). */ offset?: number | undefined; } /** * Position of a node in a source document. * * A position is a range between two points. */ interface Position { /** * Place of the first character of the parsed source region. */ start: Point; /** * Place of the first character after the parsed source region. */ end: Point; } /** * Abstract unist node. * * The syntactic unit in unist syntax trees are called nodes. * * This interface is supposed to be extended. * If you can use {@link Literal} or {@link Parent}, you should. * But for example in markdown, a `thematicBreak` (`***`), is neither literal * nor parent, but still a node. */ interface Node { /** * Node type. */ type: string; /** * Info from the ecosystem. */ data?: Data | undefined; /** * Position of a node in a source document. * * Nodes that are generated (not in the original source document) must not * have a position. */ position?: Position | undefined; } /** * Abstract unist node that contains other nodes (*children*). * * This interface is supposed to be extended. * * For example, in XML, an element is a parent of different things, such as * comments, text, and further elements. */ interface Parent$1 extends Node { /** * List of children. */ children: Node[]; } //#endregion //#region ../../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.d.ts /** * Object to check for equivalence. * * Note: `Node` is included as it is common but is not indexable. */ type Props = Record | Node; /** * Check for an arbitrary node. */ type Test$2 = Array | ReadonlyArray | Props | TestFunction | string | null | undefined; /** * Check if a node passes a test. */ type TestFunction = (this: unknown, node: Node, index?: number | undefined, parent?: Parent$1 | undefined) => boolean | undefined | void; //#endregion //#region ../../node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/index.d.ts type Test$1 = Test$2; //#endregion //#region ../../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.d.ts /** * Union of the action types. */ type Action = "skip" | boolean; /** * Move to the sibling at `index` next (after node itself is completely * traversed). * * Useful if mutating the tree, such as removing the node the visitor is * currently on, or any of its previous siblings. * Results less than 0 or greater than or equal to `children.length` stop * traversing the parent. */ type Index = number; /** * List with one or two values, the first an action, the second an index. */ type ActionTuple = [(Action | null | undefined | void)?, (Index | null | undefined)?]; /** * Any value that can be returned from a visitor. */ type VisitorResult = Action | ActionTuple | Index | null | undefined | void; //#endregion //#region ../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.d.ts /** * Visit nodes. * * This algorithm performs *depth-first* *tree traversal* in *preorder* * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). * * You can choose for which nodes `visitor` is called by passing a `test`. * For complex tests, you should test yourself in `visitor`, as it will be * faster and will have improved type information. * * Walking the tree is an intensive task. * Make use of the return values of the visitor when possible. * Instead of walking a tree multiple times, walk it once, use `unist-util-is` * to check if a node matches, and then perform different operations. * * You can change the tree. * See `Visitor` for more info. * * @overload * @param {Tree} tree * @param {Check} check * @param {BuildVisitor} visitor * @param {boolean | null | undefined} [reverse] * @returns {undefined} * * @overload * @param {Tree} tree * @param {BuildVisitor} visitor * @param {boolean | null | undefined} [reverse] * @returns {undefined} * * @param {UnistNode} tree * Tree to traverse. * @param {Visitor | Test} testOrVisitor * `unist-util-is`-compatible test (optional, omit to pass a visitor). * @param {Visitor | boolean | null | undefined} [visitorOrReverse] * Handle each node (when test is omitted, pass `reverse`). * @param {boolean | null | undefined} [maybeReverse=false] * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). * @returns {undefined} * Nothing. * * @template {UnistNode} Tree * Node type. * @template {Test} Check * `unist-util-is`-compatible test. */ declare function visit(tree: Tree, check: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; /** * Visit nodes. * * This algorithm performs *depth-first* *tree traversal* in *preorder* * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). * * You can choose for which nodes `visitor` is called by passing a `test`. * For complex tests, you should test yourself in `visitor`, as it will be * faster and will have improved type information. * * Walking the tree is an intensive task. * Make use of the return values of the visitor when possible. * Instead of walking a tree multiple times, walk it once, use `unist-util-is` * to check if a node matches, and then perform different operations. * * You can change the tree. * See `Visitor` for more info. * * @overload * @param {Tree} tree * @param {Check} check * @param {BuildVisitor} visitor * @param {boolean | null | undefined} [reverse] * @returns {undefined} * * @overload * @param {Tree} tree * @param {BuildVisitor} visitor * @param {boolean | null | undefined} [reverse] * @returns {undefined} * * @param {UnistNode} tree * Tree to traverse. * @param {Visitor | Test} testOrVisitor * `unist-util-is`-compatible test (optional, omit to pass a visitor). * @param {Visitor | boolean | null | undefined} [visitorOrReverse] * Handle each node (when test is omitted, pass `reverse`). * @param {boolean | null | undefined} [maybeReverse=false] * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). * @returns {undefined} * Nothing. * * @template {UnistNode} Tree * Node type. * @template {Test} Check * `unist-util-is`-compatible test. */ declare function visit(tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; /** * Test from `unist-util-is`. * * Note: we have remove and add `undefined`, because otherwise when generating * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, * which doesn’t work when publishing on npm. */ type Test = Exclude | undefined; /** * Get the value of a type guard `Fn`. */ type Predicate = (Fn extends ((value: any) => value is infer Thing) ? Thing : Fallback); /** * Check whether a node matches a primitive check in the type system. */ type MatchesOne = (Check extends null | undefined ? Value : Value extends { type: Check; } ? Value : Value extends Check ? Value : Check extends Function ? Predicate extends Value ? Predicate : never : never); /** * Check whether a node matches a check in the type system. */ type Matches = (Check extends ReadonlyArray ? MatchesOne : MatchesOne); /** * Number; capped reasonably. */ type Uint = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; /** * Increment a number in the type system. */ type Increment = I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10; /** * Collect nodes that can be parents of `Child`. */ type InternalParent = (Node$1 extends Parent$1 ? Node$1 extends { children: Array; } ? Child extends Children ? Node$1 : never : never : never); /** * Collect nodes in `Tree` that can be parents of `Child`. */ type Parent = InternalParent, Child>; /** * Collect all (inclusive) descendants of `Tree`. * * > 👉 **Note**: for performance reasons, this seems to be the fastest way to * > recurse without actually running into an infinite loop, which the * > previous version did. * > * > Practically, a max of `2` is typically enough assuming a `Root` is * > passed, but it doesn’t improve performance. * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. * > Using up to `10` doesn’t hurt or help either. */ type InclusiveDescendant = (Tree extends Parent$1 ? Depth extends Max ? Tree : Tree | InclusiveDescendant> : Tree); /** * Handle a node (matching `test`, if given). * * Visitors are free to transform `node`. * They can also transform `parent`. * * Replacing `node` itself, if `SKIP` is not returned, still causes its * descendants to be walked (which is a bug). * * When adding or removing previous siblings of `node` (or next siblings, in * case of reverse), the `Visitor` should return a new `Index` to specify the * sibling to traverse after `node` is traversed. * Adding or removing next siblings of `node` (or previous siblings, in case * of reverse) is handled as expected without needing to return a new `Index`. * * Removing the children property of `parent` still results in them being * traversed. */ type Visitor = (node: Visited, index: Visited extends Node ? number | undefined : never, parent: Ancestor extends Parent$1 ? Ancestor | undefined : never) => VisitorResult; /** * Build a typed `Visitor` function from a node and all possible parents. * * It will infer which values are passed as `node` and which as `parent`. */ type BuildVisitorFromMatch = Visitor>; /** * Build a typed `Visitor` function from a list of descendants and a test. * * It will infer which values are passed as `node` and which as `parent`. */ type BuildVisitorFromDescendants = (BuildVisitorFromMatch, Extract>); /** * Build a typed `Visitor` function from a tree and a test. * * It will infer which values are passed as `node` and which as `parent`. */ type BuildVisitor = (BuildVisitorFromDescendants, Check>); //#endregion //#region src/asciinema.d.ts type RemarkAsciinemaEmbedOption = "image" | "script"; interface RemarkAsciinemaOptions { embedType: RemarkAsciinemaEmbedOption; } declare function asciinema(inputOptions?: RemarkAsciinemaOptions): (tree: Parameters[0]) => void; //#endregion export { type RemarkAsciinemaEmbedOption, type RemarkAsciinemaOptions, asciinema as default };