@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
385 lines (384 loc) • 30.4 kB
TypeScript
import { type CallContextQuery } from './catalog/call-context-query/call-context-query-format';
import type { BaseQueryFormat, BaseQueryResult, BasicQueryData } from './base-query-format';
import { type VirtualQueryArgumentsWithType } from './virtual-query/virtual-queries';
import type { VirtualCompoundConstraint } from './virtual-query/compound-query';
import { type DataflowQuery } from './catalog/dataflow-query/dataflow-query-format';
import { type IdMapQuery } from './catalog/id-map-query/id-map-query-format';
import { type NormalizedAstQuery } from './catalog/normalized-ast-query/normalized-ast-query-format';
import { type StaticSliceQuery } from './catalog/static-slice-query/static-slice-query-format';
import { type DataflowClusterQuery } from './catalog/cluster-query/cluster-query-format';
import { type DependenciesQuery } from './catalog/dependencies-query/dependencies-query-format';
import type { OutputFormatter } from '../util/text/ansi';
import Joi from 'joi';
import { type LocationMapQuery } from './catalog/location-map-query/location-map-query-format';
import { type ConfigQuery } from './catalog/config-query/config-query-format';
import { type SearchQuery } from './catalog/search-query/search-query-format';
import { type HappensBeforeQuery } from './catalog/happens-before-query/happens-before-query-format';
import { type ResolveValueQuery } from './catalog/resolve-value-query/resolve-value-query-format';
import { type DataflowLensQuery } from './catalog/dataflow-lens-query/dataflow-lens-query-format';
import { type ProjectQuery } from './catalog/project-query/project-query-format';
import { type SignatureQuery } from './catalog/signature-query/signature-query-format';
import { type OriginQuery } from './catalog/origin-query/origin-query-format';
import { type LinterQuery } from './catalog/linter-query/linter-query-format';
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
import { type ControlFlowQuery } from './catalog/control-flow-query/control-flow-query-format';
import type { AsyncOrSync } from 'ts-essentials';
import type { FlowrConfig } from '../config';
import { type InspectHigherOrderQuery } from './catalog/inspect-higher-order-query/inspect-higher-order-query-format';
import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
import type { ReplOutput } from '../cli/repl/commands/repl-main';
import type { CommandCompletions } from '../cli/repl/core';
import type { FilesQuery } from './catalog/files-query/files-query-format';
import type { CallGraphQuery } from './catalog/call-graph-query/call-graph-query-format';
import type { InspectRecursionQuery } from './catalog/inspect-recursion-query/inspect-recursion-query-format';
import type { DoesCallQuery } from './catalog/does-call-query/does-call-query-format';
import type { InspectExceptionQuery } from './catalog/inspect-exceptions-query/inspect-exception-query-format';
import type { InputSourcesQuery } from './catalog/input-sources-query/input-sources-query-format';
import type { ProvenanceQuery } from './catalog/provenance-query/provenance-query-format';
import type { LintingResultCertainty } from '../linter/linter-format';
import { type DiceQuery } from './catalog/dice-query/dice-query-format';
import { type GuessDepVersionsQuery } from './catalog/guess-dep-versions-query/guess-dep-versions-query-format';
import { type AbsintQuery } from './catalog/absint-query/absint-query-format';
/**
* These are all queries that can be executed from within flowR
*/
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | AbsintQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | SignatureQuery | OriginQuery | LinterQuery | ProvenanceQuery | InputSourcesQuery | DiceQuery | GuessDepVersionsQuery;
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
type: QueryType;
};
export type QueryExecutor<Query extends BaseQueryFormat, Result extends Promise<BaseQueryResult>> = (data: BasicQueryData, query: readonly Query[]) => Result;
/**
* The result of parsing a query line from, e.g., the repl.
*/
export interface ParsedQueryLine<QueryType extends BaseQueryFormat['type']> {
/** The parsed query or queries from the line. */
query: QueryArgumentsWithType<QueryType> | QueryArgumentsWithType<QueryType>[] | undefined;
/** Optional R code associated with the query. */
rCode?: string;
}
export interface SupportedQuery<QueryType extends BaseQueryFormat['type'] = BaseQueryFormat['type']> {
executor: QueryExecutor<QueryArgumentsWithType<QueryType>, Promise<BaseQueryResult>>;
/** optional completion in, e.g., the repl */
completer?: (splitLine: readonly string[], startingNewArg: boolean, config: FlowrConfig) => CommandCompletions;
/** optional query construction from an, e.g., repl line */
fromLine?: (output: ReplOutput, splitLine: readonly string[], config: FlowrConfig) => ParsedQueryLine<QueryType>;
/** optional one-line usage of the repl `@`-shorthand `fromLine` accepts, shown by `:query ?<type>` */
syntax?: string;
/** the human-readable name, e.g. `Call-Context Query`; also names its wiki page, see {@link queryWikiPage} */
title: string;
/**
* Generates an ASCII summary of the query result to be printed in, e.g., the REPL.
* @returns whether a summary was produced (`true` if so, `false` if not, in this case a default/generic summary will be created)
*/
asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider, queryResults: BaseQueryResult, resultStrings: string[], query: readonly Query[]) => AsyncOrSync<boolean>;
jsonFormatter?: (queryResults: BaseQueryResult) => object;
schema: Joi.ObjectSchema;
/**
* Flattens the involved query nodes to be added to a flowR search when the {@link fromQuery} function is used based on the given result after this query is executed.
* If this query does not involve any nodes, an empty array can be returned.
*/
flattenInvolvedNodes: (queryResults: BaseQueryResult, query: readonly Query[], certainty?: LintingResultCertainty) => NodeId[];
}
export declare const SupportedQueries: {
readonly 'call-context': {
readonly title: "Call-Context Query";
readonly executor: typeof import("./catalog/call-context-query/call-context-query-executor").executeCallContextQueries;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly config: {
readonly title: "Config Query";
readonly syntax: "@config [<path> | <glob>] | @config +<path>=<value> | @config +reset";
readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
readonly completer: (partialLine: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"config">;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly 'control-flow': {
readonly title: "Control-Flow Query";
readonly executor: typeof import("./catalog/control-flow-query/control-flow-query-executor").executeControlFlowQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'call-graph': {
readonly title: "Call-Graph Query";
readonly executor: typeof import("./catalog/call-graph-query/call-graph-query-executor").executeCallGraphQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly dataflow: {
readonly title: "Dataflow Query";
readonly executor: typeof import("./catalog/dataflow-query/dataflow-query-executor").executeDataflowQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'does-call': {
readonly title: "Does-Call Query";
readonly executor: typeof import("./catalog/does-call-query/does-call-query-executor").executeDoesCallQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"does-call">;
readonly syntax: "@does-call (<criterion>:$<id>|\"<name>\") <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'dataflow-lens': {
readonly title: "Dataflow Lens Query";
readonly executor: typeof import("./catalog/dataflow-lens-query/dataflow-lens-query-executor").executeDataflowLensQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly absint: {
readonly title: "Abstract Interpretation Query";
readonly executor: typeof import("./catalog/absint-query/absint-query-executor").executeAbsintQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly jsonFormatter: (queryResults: BaseQueryResult) => object;
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"absint">;
readonly syntax: "@absint <inference-type> [(<criteria>)] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly files: {
readonly title: "Files Query";
readonly executor: typeof import("./catalog/files-query/files-query-executor").executeFileQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"files">;
readonly syntax: "@files [role:<r1>,<r2>,...] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[];
};
readonly 'id-map': {
readonly title: "Id-Map Query";
readonly executor: typeof import("./catalog/id-map-query/id-map-query-executor").executeIdMapQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly 'normalized-ast': {
readonly title: "Normalized AST Query";
readonly executor: typeof import("./catalog/normalized-ast-query/normalized-ast-query-executor").executeNormalizedAstQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly 'dataflow-cluster': {
readonly title: "Dataflow Cluster Query";
readonly executor: typeof import("./catalog/cluster-query/cluster-query-executor").executeDataflowClusterQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'static-slice': {
readonly title: "Static Slice Query";
readonly executor: typeof import("./catalog/static-slice-query/static-slice-query-executor").executeStaticSliceQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"static-slice">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@static-slice (<crit>;...)[fiIcB] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly provenance: {
readonly title: "Provenance Query";
readonly executor: typeof import("./catalog/provenance-query/provenance-query-executor").executeProvenanceQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"provenance">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@provenance (<criterion>)[f] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'input-sources': {
readonly title: "Input Sources Query";
readonly executor: typeof import("./catalog/input-sources-query/input-sources-query-executor").executeInputSourcesQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"input-sources">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@input-sources (<criterion>) <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly dependencies: {
readonly title: "Dependencies Query";
readonly executor: typeof import("./catalog/dependencies-query/dependencies-query-executor").executeDependenciesQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, query: readonly Query[]) => NodeId[];
};
readonly 'location-map': {
readonly title: "Location Map Query";
readonly executor: typeof import("./catalog/location-map-query/location-map-query-executor").executeLocationMapQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"location-map">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@location-map [(<crit>;...)] [token|full|statement] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly search: {
readonly title: "Search Query";
readonly executor: typeof import("./catalog/search-query/search-query-executor").executeSearch;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'happens-before': {
readonly title: "Happens-Before Query";
readonly executor: typeof import("./catalog/happens-before-query/happens-before-query-executor").executeHappensBefore;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly 'inspect-exception': {
readonly title: "Inspect Exceptions of Functions Query";
readonly executor: typeof import("./catalog/inspect-exceptions-query/inspect-exception-query-executor").executeExceptionQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-exception">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@inspect-exception [(<crit>;...)] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'inspect-higher-order': {
readonly title: "Inspect Higher-Order Functions Query";
readonly executor: typeof import("./catalog/inspect-higher-order-query/inspect-higher-order-query-executor").executeHigherOrderQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-higher-order">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@inspect-higher-order [(<crit>;...)] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'inspect-recursion': {
readonly title: "Inspect Recursive Functions Query";
readonly executor: typeof import("./catalog/inspect-recursion-query/inspect-recursion-query-executor").executeRecursionQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-recursion">;
readonly syntax: "@inspect-recursion [(<crit>;...)] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'resolve-value': {
readonly title: "Resolve Value Query";
readonly executor: typeof import("./catalog/resolve-value-query/resolve-value-query-executor").executeResolveValueQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"resolve-value">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@resolve-value (<crit>;...) <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly project: {
readonly title: "Project Query";
readonly executor: typeof import("./catalog/project-query/project-query-executor").executeProjectQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => never[];
};
readonly signature: {
readonly title: "Signature Query";
readonly executor: typeof import("./catalog/signature-query/signature-query-executor").executeSignatureQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], _query: readonly Query[]) => true;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"signature">;
readonly completer: typeof import("./catalog/signature-query/signature-query-executor").signatureQueryCompleter;
readonly syntax: "@signature [<pkg>[@<version>]] [<pkg>::<fn> | <fn>] [--param <name>[,...]] [--required <n>] [--cg] [--help]";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => NodeId[];
};
readonly origin: {
readonly title: "Origin Query";
readonly executor: typeof import("./catalog/origin-query/origin-query-executor").executeResolveValueQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"origin">;
readonly completer: typeof import("../cli/repl/parser/slice-query-parser").criteriaQueryCompleter;
readonly syntax: "@origin (<criterion>) <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly linter: {
readonly title: "Linter Query";
readonly executor: typeof import("./catalog/linter-query/linter-query-executor").executeLinterQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"linter">;
readonly syntax: "@linter [rules:<r1>,<r2>,...] [format:<fmt>] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, _queries: readonly Query[], certainty: LintingResultCertainty | undefined) => ((string & {
__brand?: "node-id";
}) | (number & {
__brand?: "node-id";
}))[];
};
readonly dice: {
readonly title: "Dice Query";
readonly executor: typeof import("./catalog/dice-query/dice-query-executor").executeDiceQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"dice">;
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
readonly syntax: "@dice (<crit>;...->crit;...)[iIcB] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
};
readonly 'guess-dep-versions': {
readonly title: "Guess Dependency Versions Query";
readonly executor: typeof import("./catalog/guess-dep-versions-query/guess-dep-versions-query-executor").executeGuessDepVersionsQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], _query: readonly Query[]) => true;
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"guess-dep-versions">;
readonly syntax: "@guess-dep-versions [<pkg> ...] [(clean | <=YYYY.MM.DD)] [--date YYYY.MM.DD] [--max <n>] [--iterations <n>] [--disabled <letters>] [--explode [--oldest] [--limit <n>] [--prefer <pkg>=<ver>]] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: () => NodeId[];
};
};
export type SupportedQueryTypes = keyof typeof SupportedQueries;
/** The wiki page documenting a query, derived from its {@link SupportedQuery.title}. */
export declare function queryWikiPage(title: string): string;
export type QueryResult<Type extends Query['type']> = Promise<ReturnType<typeof SupportedQueries[Type]['executor']>>;
/**
* Executes a set of queries that are all of the same type.
* Only use this function if you are sure all queries are of the same type.
* Otherwise, use {@link executeQueries}.
*/
export declare function executeQueriesOfSameType<SpecificQuery extends Query>(data: BasicQueryData, queries: readonly SpecificQuery[]): QueryResult<SpecificQuery['type']>;
export type QueryResults<Base extends SupportedQueryTypes = SupportedQueryTypes> = {
readonly [QueryType in Base]: Awaited<QueryResult<QueryType>>;
} & BaseQueryResult;
type OmitFromValues<T, K extends string | number | symbol> = {
[P in keyof T]?: Omit<T[P], K>;
};
export type QueryResultsWithoutMeta<Queries extends Query> = OmitFromValues<Omit<QueryResults<Queries['type']>, '.meta'>, '.meta'>;
export type Queries<Base extends SupportedQueryTypes = SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>> = readonly (QueryArgumentsWithType<Base> | VirtualQueryArgumentsWithType<Base, VirtualArguments>)[];
/**
* This is the main query execution function that takes a set of queries and executes them on the given data.
* @see {@link executeQueriesOfSameType}
*/
export declare function executeQueries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(data: BasicQueryData, queries: Queries<Base, VirtualArguments>): Promise<QueryResults<Base>>;
/**
* Produces a Joi schema representing all supported queries.
*/
export declare function SupportedQueriesSchema(): Joi.AlternativesSchema<any>;
export declare const CompoundQuerySchema: Joi.ObjectSchema<any>;
/**
* Produces a Joi schema representing all virtual queries.
*/
export declare function VirtualQuerySchema(): Joi.AlternativesSchema<any>;
/**
* Produces a Joi schema representing any supported query (including virtual queries).
*/
export declare function AnyQuerySchema(): Joi.AlternativesSchema<any>;
/**
* Produces a Joi schema representing an array of supported queries.
*/
export declare function QueriesSchema(): Joi.ArraySchema<any[]>;
/**
* Wraps a function that executes a REPL query and, if it fails, checks whether there were any requests to analyze.
*/
export declare function genericWrapReplFailIfNoRequest<T>(fn: () => Promise<T>, output: ReplOutput, analyzer: ReadonlyFlowrAnalysisProvider): Promise<T | undefined>;
export {};