FlowrConfig: {
    amend(
        config: FlowrConfig,
        amendmentFunc: (
            config: {
                abstractInterpretation: {
                    dataFrame: {
                        maxColNames: number;
                        readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
                    };
                    wideningThreshold: number;
                };
                defaultEngine?: "r-shell"
                | "tree-sitter";
                engines: (
                    | { rPath?: string; type: "r-shell"; [key: string]: unknown }
                    | {
                        lax?: boolean;
                        treeSitterWasmPath?: string;
                        type: "tree-sitter";
                        wasmPath?: string;
                        [key: string]: unknown;
                    }
                )[];
                ignoreSourceCalls: boolean;
                project: { resolveUnknownPathsOnDisk: boolean };
                repl: { dfProcessorHeat: boolean; quickStats: boolean };
                semantics: {
                    environment: {
                        overwriteBuiltIns: {
                            definitions: (
                                | {
                                    assumePrimitive?: boolean;
                                    names: ((...) | (...))[];
                                    type: "constant";
                                    value: unknown;
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    config: { constructName?: (...)
                                    | (...); readIndices: boolean };
                                    names: ((...) | (...))[];
                                    suffixes: ((...) | (...))[];
                                    type: "replacement";
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    config?: | {
                                        forceFollow?: ...;
                                        includeFunctionCall?: ...;
                                        libFn?: ...;
                                    }
                                    | { forceArgs?: ...; libFn?: ...; treatIndicesAsString: ... }
                                    | {
                                        indexOfFunction?: ...;
                                        libFn?: ...;
                                        nameOfFunctionArgument?: ...;
                                        resolveInEnvironment?: ...;
                                        resolveValue?: ...;
                                        unquoteFunction?: ...;
                                        [key: ...]: ...;
                                    }
                                    | {
                                        canBeReplacement?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        mayHaveMoreArgs?: ...;
                                        modesForFn?: ...;
                                        quoteSource?: ...;
                                        superAssignment?: ...;
                                        swapSourceAndTarget?: ...;
                                        targetVariable?: ...;
                                    }
                                    | {
                                        canBeReplacement?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        mayHaveMoreArgs?: ...;
                                        modesForFn?: ...;
                                        quoteSource?: ...;
                                        source: ...;
                                        superAssignment?: ...;
                                        swapSourceAndTarget?: ...;
                                        target: ...;
                                        targetVariable?: ...;
                                    }
                                    | {
                                        cfg?: ...;
                                        forceArgs?: ...;
                                        hasUnknownSideEffects?: ...;
                                        libFn?: ...;
                                        readAllArguments?: ...;
                                        returnsNthArgument?: ...;
                                        treatAsFnCall?: ...;
                                        useAsProcessor?: ...;
                                    }
                                    | { forceArgs?: ...; libFn?: ...; useAsProcessor?: ... }
                                    | { includeFunctionCall?: ...; libFn?: ... }
                                    | { args?: ...; libFn?: ... }
                                    | { args: ...; libFn?: ... }
                                    | { forceArgs?: ...; libFn?: ...; quoteArgumentsWithIndex?: ... }
                                    | { args: ...; hook: ...; libFn?: ... }
                                    | {
                                        assignmentOperator?: ...;
                                        assignRootId?: ...;
                                        constructName?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        readIndices?: ...;
                                    }
                                    | { args: ...; inferFromClosure?: ...; libFn?: ... }
                                    | { args: ...; libFn?: ... }
                                    | { evalRhsWhen: ...; forceArgs?: ...; lazy: ...; libFn?: ... }
                                    | { block: ...; handlers: ...; libFn?: ... };
                                    evalHandler?: string;
                                    names: ((...) | (...))[];
                                    processor:
                                        | Access
                                        | Apply
                                        | Assignment
                                        | AssignmentLike
                                        | Default
                                        | DefaultReadAllArgs
                                        | Eval
                                        | ExpressionList
                                        | ForLoop
                                        | FunctionDefinition
                                        | Get
                                        | IfThenElse
                                        | Library
                                        | List
                                        | Local
                                        | Pipe
                                        | Quote
                                        | Recall
                                        | RegisterHook
                                        | RepeatLoop
                                        | Replacement
                                        | Rm
                                        | S3Dispatch
                                        | S7NewGeneric
                                        | S7Dispatch
                                        | Source
                                        | SpecialBinOp
                                        | StopIfNot
                                        | Try
                                        | Vector
                                        | WhileLoop;
                                    type: "function";
                                }
                            )[];
                            loadDefaults?: boolean;
                        };
                    };
                };
                solver: {
                    evalStrings: boolean;
                    instrument: {
                        dataflowExtractors?: (
                            extractor: DataflowProcessors<ParentInformation>,
                            ctx: FlowrAnalyzerContext,
                        ) => DataflowProcessors<ParentInformation>;
                    };
                    resolveSource?: {
                        applyReplacements?: { [key: string]: string }[];
                        dropPaths: DropPathsOption;
                        ignoreCapitalization: boolean;
                        inferWorkingDirectory: InferWorkingDirectory;
                        repeatedSourceLimit?: number;
                        searchPath: string[];
                        [key: string]: unknown;
                    };
                    slicer?: { threshold?: number };
                    variables: VariableResolve;
                };
                [key: string]: unknown;
            },
        ) => void
        | FlowrConfig,
    ): FlowrConfig;
    clone(config: FlowrConfig): FlowrConfig;
    default(): FlowrConfig;
    fromFile(configFile?: string, configWorkingDirectory?: string): FlowrConfig;
    getForEngine<T extends "r-shell" | "tree-sitter">(
        config: FlowrConfig,
        engine: T,
    ): undefined | (EngineConfig & { type: T; });
    name: "FlowrConfig";
    parse(jsonString: string): undefined | FlowrConfig;
    Schema: ObjectSchema<any>;
    setInConfig<Path extends string>(
        config: FlowrConfig,
        key: Path,
        value: PathValue<FlowrConfig, Path>,
    ): FlowrConfig;
    setInConfigInPlace<Path extends string>(
        config: FlowrConfig,
        key: Path,
        value: PathValue<FlowrConfig, Path>,
    ): void;
}

Helper Object to work with FlowrConfig, provides the default config and the Joi schema for validation.

Type declaration

  • amend:function
    • Creates a new flowr config that has the updated values.

      Parameters

      • config: FlowrConfig
      • amendmentFunc: (
            config: {
                abstractInterpretation: {
                    dataFrame: {
                        maxColNames: number;
                        readLoadedData: { maxReadLines: number; readExternalFiles: boolean };
                    };
                    wideningThreshold: number;
                };
                defaultEngine?: "r-shell"
                | "tree-sitter";
                engines: (
                    | { rPath?: string; type: "r-shell"; [key: string]: unknown }
                    | {
                        lax?: boolean;
                        treeSitterWasmPath?: string;
                        type: "tree-sitter";
                        wasmPath?: string;
                        [key: string]: unknown;
                    }
                )[];
                ignoreSourceCalls: boolean;
                project: { resolveUnknownPathsOnDisk: boolean };
                repl: { dfProcessorHeat: boolean; quickStats: boolean };
                semantics: {
                    environment: {
                        overwriteBuiltIns: {
                            definitions: (
                                | {
                                    assumePrimitive?: boolean;
                                    names: ((...) | (...))[];
                                    type: "constant";
                                    value: unknown;
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    config: { constructName?: (...)
                                    | (...); readIndices: boolean };
                                    names: ((...) | (...))[];
                                    suffixes: ((...) | (...))[];
                                    type: "replacement";
                                }
                                | {
                                    assumePrimitive?: boolean;
                                    config?: | {
                                        forceFollow?: ...;
                                        includeFunctionCall?: ...;
                                        libFn?: ...;
                                    }
                                    | { forceArgs?: ...; libFn?: ...; treatIndicesAsString: ... }
                                    | {
                                        indexOfFunction?: ...;
                                        libFn?: ...;
                                        nameOfFunctionArgument?: ...;
                                        resolveInEnvironment?: ...;
                                        resolveValue?: ...;
                                        unquoteFunction?: ...;
                                        [key: ...]: ...;
                                    }
                                    | {
                                        canBeReplacement?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        mayHaveMoreArgs?: ...;
                                        modesForFn?: ...;
                                        quoteSource?: ...;
                                        superAssignment?: ...;
                                        swapSourceAndTarget?: ...;
                                        targetVariable?: ...;
                                    }
                                    | {
                                        canBeReplacement?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        mayHaveMoreArgs?: ...;
                                        modesForFn?: ...;
                                        quoteSource?: ...;
                                        source: ...;
                                        superAssignment?: ...;
                                        swapSourceAndTarget?: ...;
                                        target: ...;
                                        targetVariable?: ...;
                                    }
                                    | {
                                        cfg?: ...;
                                        forceArgs?: ...;
                                        hasUnknownSideEffects?: ...;
                                        libFn?: ...;
                                        readAllArguments?: ...;
                                        returnsNthArgument?: ...;
                                        treatAsFnCall?: ...;
                                        useAsProcessor?: ...;
                                    }
                                    | { forceArgs?: ...; libFn?: ...; useAsProcessor?: ... }
                                    | { includeFunctionCall?: ...; libFn?: ... }
                                    | { args?: ...; libFn?: ... }
                                    | { args: ...; libFn?: ... }
                                    | { forceArgs?: ...; libFn?: ...; quoteArgumentsWithIndex?: ... }
                                    | { args: ...; hook: ...; libFn?: ... }
                                    | {
                                        assignmentOperator?: ...;
                                        assignRootId?: ...;
                                        constructName?: ...;
                                        forceArgs?: ...;
                                        libFn?: ...;
                                        makeMaybe?: ...;
                                        readIndices?: ...;
                                    }
                                    | { args: ...; inferFromClosure?: ...; libFn?: ... }
                                    | { args: ...; libFn?: ... }
                                    | { evalRhsWhen: ...; forceArgs?: ...; lazy: ...; libFn?: ... }
                                    | { block: ...; handlers: ...; libFn?: ... };
                                    evalHandler?: string;
                                    names: ((...) | (...))[];
                                    processor:
                                        | Access
                                        | Apply
                                        | Assignment
                                        | AssignmentLike
                                        | Default
                                        | DefaultReadAllArgs
                                        | Eval
                                        | ExpressionList
                                        | ForLoop
                                        | FunctionDefinition
                                        | Get
                                        | IfThenElse
                                        | Library
                                        | List
                                        | Local
                                        | Pipe
                                        | Quote
                                        | Recall
                                        | RegisterHook
                                        | RepeatLoop
                                        | Replacement
                                        | Rm
                                        | S3Dispatch
                                        | S7NewGeneric
                                        | S7Dispatch
                                        | Source
                                        | SpecialBinOp
                                        | StopIfNot
                                        | Try
                                        | Vector
                                        | WhileLoop;
                                    type: "function";
                                }
                            )[];
                            loadDefaults?: boolean;
                        };
                    };
                };
                solver: {
                    evalStrings: boolean;
                    instrument: {
                        dataflowExtractors?: (
                            extractor: DataflowProcessors<ParentInformation>,
                            ctx: FlowrAnalyzerContext,
                        ) => DataflowProcessors<ParentInformation>;
                    };
                    resolveSource?: {
                        applyReplacements?: { [key: string]: string }[];
                        dropPaths: DropPathsOption;
                        ignoreCapitalization: boolean;
                        inferWorkingDirectory: InferWorkingDirectory;
                        repeatedSourceLimit?: number;
                        searchPath: string[];
                        [key: string]: unknown;
                    };
                    slicer?: { threshold?: number };
                    variables: VariableResolve;
                };
                [key: string]: unknown;
            },
        ) => void
        | FlowrConfig

      Returns FlowrConfig

  • clone:function
  • default:function
    • The default configuration for flowR, used when no config file is found or when a config file is missing some options. You can use this as a base for your own config and only specify the options you want to change.

      Returns FlowrConfig

  • fromFile:function
    • Loads the flowr config from the given file or the default locations. Please note that you can also use this without a path parameter to infer the config from flowR's default locations. This is mostly useful for user-facing features.

      Parameters

      • OptionalconfigFile: string
      • configWorkingDirectory: string = ...

      Returns FlowrConfig

  • getForEngine:function
    • Gets the configuration for the given engine type from the config.

      Type Parameters

      • T extends "r-shell" | "tree-sitter"

      Parameters

      Returns undefined | (EngineConfig & { type: T; })

  • Readonlyname: "FlowrConfig"
  • parse:function
    • Parses the given JSON string as a flowR config file, returning the resulting config object if the parsing and validation were successful, or undefined if there was an error.

      Parameters

      • jsonString: string

      Returns undefined | FlowrConfig

  • ReadonlySchema: ObjectSchema<any>

    The Joi schema for validating a config file, use this to validate your config file before using it. You can also use this to generate documentation for the config file format.

  • setInConfig:function
    • Returns a new config object with the given value set at the given key, where the key is a dot-separated path to the value in the config object.

      Type Parameters

      • Path extends string

      Parameters

      Returns FlowrConfig

      setInConfigInPlace for a version that modifies the config object in place instead of returning a new one.

      const config = FlowrConfig.default();
      const newConfig = FlowrConfig.setInConfig(config, 'solver.variables', VariableResolve.Builtin);
      console.log(config.solver.variables); // Output: "alias"
      console.log(newConfig.solver.variables); // Output: "builtin"
  • setInConfigInPlace:function
    • Modifies the given config object in place by setting the given value at the given key, where the key is a dot-separated path to the value in the config object.

      Type Parameters

      • Path extends string

      Parameters

      Returns void

      setInConfig for a version that returns a new config object instead of modifying the given one in place.