UNPKG

600 BTypeScriptView Raw
1/// <reference types="esquery" />
2import type { Selector } from './index';
3/**
4 * @public
5 * Parse a `string` into an ESQuery `Selector`.
6 *
7 * @param selector - a TSQuery `Selector` (using the [ESQuery selector syntax](https://github.com/estools/esquery)).
8 * @returns a validated `Selector` or `null` if the input `string` is invalid.
9 * @throws if the `Selector` is syntactically valid, but contains an invalid TypeScript Node kind.
10 */
11export declare function parse(selector: string): Selector | null;
12export declare namespace parse {
13 var ensure: (selector: string | Selector) => Selector;
14}