Skip to content

Modules | @vltpkg/query

Classes

Query

Constructors

new Query()
new Query(__namedParameters): Query
Parameters

__namedParameters: QueryOptions

Returns

Query

Defined in

index.ts:117

Methods

search(query): Promise<QueryResponse>
Parameters

query: string

Returns

Promise<QueryResponse>

Defined in

index.ts:122

Type Aliases

GraphSelectionState

type GraphSelectionState: object;

Type declaration

edges
edges: Set<EdgeLike>
nodes
nodes: Set<NodeLike>

Defined in

types.ts:34


ParserFn()

type ParserFn: (opt) => Promise<ParserState>;

Parameters

opt: ParserState

Returns

Promise<ParserState>

Defined in

types.ts:56


ParserState

type ParserState: object;

Type declaration

collect
collect: GraphSelectionState
current
current: PostcssNode
initial
initial: GraphSelectionState
loose?
optional loose: boolean;
next?
optional next: PostcssNode;
partial
partial: GraphSelectionState
prev?
optional prev: PostcssNode;
result?
optional result: NodeLike[];
walk
walk: ParserFn

Defined in

types.ts:39


PostcssNode

type PostcssNode:
| Tag
| String
| Selector
| Root
| Pseudo
| Nesting
| Identifier
| Comment
| Combinator
| ClassName
| Attribute
| Universal;

Defined in

types.ts:18


PostcssNodeWithChildren

type PostcssNodeWithChildren: Selector | Root | Pseudo;

Defined in

types.ts:32


QueryOptions

type QueryOptions: object;

Type declaration

graph
graph: GraphLike

Defined in

index.ts:109


QueryResponse

type QueryResponse: object;

Type declaration

edges
edges: EdgeLike[];
nodes
nodes: NodeLike[];

Defined in

types.ts:51

Functions

asAttributeNode()

function asAttributeNode(node?): Attribute

Parameters

node?: PostcssNode

Returns

Attribute

Defined in

types.ts:84


asClassNode()

function asClassNode(node?): ClassName

Parameters

node?: PostcssNode

Returns

ClassName

Defined in

types.ts:101


asCombinatorNode()

function asCombinatorNode(node?): Combinator

Parameters

node?: PostcssNode

Returns

Combinator

Defined in

types.ts:118


asIdentifierNode()

function asIdentifierNode(node?): Identifier

Parameters

node?: PostcssNode

Returns

Identifier

Defined in

types.ts:135


asPostcssNodeWithChildren()

function asPostcssNodeWithChildren(node?): PostcssNodeWithChildren

Parameters

node?: PostcssNode

Returns

PostcssNodeWithChildren

Defined in

types.ts:63


asPseudoNode()

function asPseudoNode(node?): Pseudo

Parameters

node?: PostcssNode

Returns

Pseudo

Defined in

types.ts:155


asTagNode()

function asTagNode(node?): Tag

Parameters

node?: PostcssNode

Returns

Tag

Defined in

types.ts:172


isAttributeNode()

function isAttributeNode(node): node is Attribute

Parameters

node: unknown

Returns

node is Attribute

Defined in

types.ts:81


isClassNode()

function isClassNode(node): node is ClassName

Parameters

node: unknown

Returns

node is ClassName

Defined in

types.ts:98


isCombinatorNode()

function isCombinatorNode(node): node is Combinator

Parameters

node: unknown

Returns

node is Combinator

Defined in

types.ts:115


isIdentifierNode()

function isIdentifierNode(node): node is Identifier

Parameters

node: any

Returns

node is Identifier

Defined in

types.ts:132


isPostcssNodeWithChildren()

function isPostcssNodeWithChildren(
node,
): node is PostcssNodeWithChildren

Parameters

node: any

Returns

node is PostcssNodeWithChildren

Defined in

types.ts:58


isPseudoNode()

function isPseudoNode(node): node is Pseudo

Parameters

node: unknown

Returns

node is Pseudo

Defined in

types.ts:152


isSelectorNode()

function isSelectorNode(node): node is Selector

Parameters

node: any

Returns

node is Selector

Defined in

types.ts:149


isTagNode()

function isTagNode(node): node is Tag

Parameters

node: unknown

Returns

node is Tag

Defined in

types.ts:169


walk()

function walk(state): Promise<ParserState>

Parameters

state: ParserState

Returns

Promise<ParserState>

Defined in

index.ts:56