UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

30 lines (29 loc) 1.97 kB
import type { RShell } from '../../r-bridge/shell'; import type { Queries, QueryResults, SupportedQueryTypes } from '../../queries/query'; import { DEFAULT_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines'; import type { SupportedVirtualQueryTypes } from '../../queries/virtual-query/virtual-queries'; import type { VirtualCompoundConstraint } from '../../queries/virtual-query/compound-query'; import type { PipelineOutput } from '../../core/steps/pipeline/pipeline'; export interface ShowQueryOptions<Base extends SupportedQueryTypes> { readonly showCode?: boolean; readonly collapseResult?: boolean; readonly collapseQuery?: boolean; readonly addOutput?: (result: QueryResults<Base>, pipeline: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>) => string; } export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(shell: RShell, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, addOutput }?: ShowQueryOptions<Base>): Promise<string>; export interface QueryDocumentation { readonly name: string; readonly type: 'virtual' | 'active'; readonly shortDescription: string; readonly functionName: string; readonly functionFile: string; readonly buildExplanation: (shell: RShell) => Promise<string>; } export declare const RegisteredQueries: { active: Map<string, QueryDocumentation>; virtual: Map<string, QueryDocumentation>; }; export declare function registerQueryDocumentation(query: SupportedQueryTypes | SupportedVirtualQueryTypes, doc: QueryDocumentation): void; export declare function linkToQueryOfName(id: SupportedQueryTypes | SupportedVirtualQueryTypes): string; export declare function tocForQueryType(type: 'active' | 'virtual'): string; export declare function explainQueries(shell: RShell, type: 'active' | 'virtual'): Promise<string>;