UNPKG

678 BTypeScriptView Raw
1/// <reference types="esquery" />
2import type { Node, Selector } from './index';
3/**
4 * @public
5 * Check for `Nodes` within a given `string` of code or AST `Node` matching a `Selector`.
6 *
7 * @param node - the `Node` to be searched. This could be a TypeScript [`SourceFile`](https://github.com/microsoft/TypeScript/blob/main/src/services/types.ts#L159), or a `Node` from a previous query.
8 * @param selector - a TSQuery `Selector` (using the [ESQuery selector syntax](https://github.com/estools/esquery)).
9 * @returns `true` if the code contains matches for the `Selector`, `false` if not.
10 */
11export declare function includes(node: Node, selector: string | Selector): boolean;