UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

38 lines (37 loc) 1.99 kB
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format'; import Joi from 'joi'; import type { ParsedQueryLine } from '../../query'; import { executeFileQuery } from './files-query-executor'; import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id'; import { FileRole } from '../../../project/context/flowr-file'; import type { ReplOutput } from '../../../cli/repl/commands/repl-main'; import type { FlowrConfig } from '../../../config'; import type { CommandCompletions } from '../../../cli/repl/core'; /** * Returns the content(s) of all files matching the given pattern. */ export interface FilesQuery extends BaseQueryFormat { readonly type: 'files'; /** If you provide roles, only files with all the given roles are returned. Supply multiple queries if you want a union! */ readonly roles?: FileRole[]; readonly matchesPathRegex?: string; } export interface FileQueryInfo<T = object> { roles?: readonly FileRole[]; path: string; content: T; } export interface FilesQueryResult extends BaseQueryResult { files: FileQueryInfo[]; } declare function filesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'files'>; declare function filesQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions; export declare const FilesQueryDefinition: { readonly executor: typeof executeFileQuery; readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true; readonly completer: typeof filesQueryCompleter; readonly fromLine: typeof filesQueryLineParser; readonly schema: Joi.ObjectSchema<any>; readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[]; }; export {};