astro-ghostcms/.pnpm-store/v3/files/0c/4992303574e1afd99d49d63d9f5...

19 lines
808 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
import type { Abbreviation, AbbreviationNode } from '@emmetio/abbreviation';
export type Container = Abbreviation | AbbreviationNode;
export type WalkVisitor<S> = (node: AbbreviationNode, ancestors: Container[], state?: S) => void;
/**
* Walks over each child node of given markup abbreviation AST node (not including
* given one) and invokes `fn` on each node.
* The `fn` callback accepts context node, list of ancestor nodes and optional
* state object
*/
export declare function walk<S>(node: Container, fn: WalkVisitor<S>, state?: S): void;
/**
* Finds node which is the deepest for in current node or node itself.
*/
export declare function findDeepest(node: Container): {
node: Container;
parent?: Container;
};
export declare function isNode(node: Container): node is AbbreviationNode;