@eagleoutice/flowr - v2.15.8
    Preparing search index...
    Resolve: {
        argument: {
            name: "argument";
            stringVector: (
                id: NodeId | RArgument<(...)> | undefined,
                info: ResolveInfo,
            ) => (...)[] | undefined;
            symbolName: (
                id: NodeId | RArgument<(...)> | undefined,
                info: ResolveInfo,
            ) => string | undefined;
            toName: (
                id: NodeId | RArgument<(...)> | undefined,
                info: ResolveInfo,
            ) => string | undefined;
            value: (
                id: NodeId | RArgument<(...)> | undefined,
                info: ResolveInfo,
            ) => string | number | boolean | (...)[] | undefined;
            vectorLength: (
                id: NodeId | RArgument<(...)> | undefined,
                info: ResolveInfo,
            ) => number | undefined;
        };
        byName: (
            id: Identifier,
            environment: REnvironmentInformation,
        ) => IdentifierDefinition[] | undefined;
        byNameAndType: (
            id: Identifier,
            environment: REnvironmentInformation,
            target: ReferenceType,
        ) => readonly IdentifierDefinition[] | undefined;
        info(
            this: void,
            graph: DataflowGraph,
            ctx: ReadOnlyFlowrAnalyzerContext,
        ): ResolveInfo;
        infoOf(
            this: void,
            analyzer: ReadonlyFlowrAnalysisProvider,
        ): Promise<ResolveInfo>;
        isBuiltIn: (
            name: Identifier,
            environment: REnvironmentInformation,
            target: Function | Constant,
        ) => boolean;
        name: "Resolve";
        toBuiltIn: (
            name: Identifier | undefined,
            environment: REnvironmentInformation,
            wantedValue: unknown,
        ) => Ternary;
        toConstants: (
            name: Identifier | undefined,
            environment: REnvironmentInformation,
        ) => ResolveResult;
        toSingleString: (
            id: NodeId | RNodeWithParent | undefined,
            info: ResolveInfo,
        ) => string | undefined;
        toValue: (
            id: NodeId | RNodeWithParent | undefined,
            environment: ResolveInfo,
        ) => ResolveResult;
    } = ...

    The helper object for resolution: from a name to the definitions it may refer to, and from a node to the value(s) it may hold.

    Resolve.info and Resolve.infoOf state where to resolve, which everything below takes; from an analyzer that is one call, with no need to assemble the graph, the id map and the context by hand.

    Take the narrowest entry point that answers your question, they differ a lot in cost:

    • Resolve.byName walks the environment layers once and answers repeat questions from the layer's own lookup cache. Use it whenever the ReferenceType does not matter.
    • Resolve.byNameAndType additionally filters and merges the definitions of every layer it passes. Given the unknown reference type it only forwards to Resolve.byName, so ask that one directly instead.
    • Resolve.toValue and the Resolve.argument family run the evaluator on top of a resolution.

    Type Declaration

    const where = await Resolve.infoOf(analyzer);
    Resolve.byName('x', environment); // every definition `x` may refer to
    Resolve.toValue(id, where); // the value(s) the node may hold
    Resolve.argument.value(call, 'file', ...); // the value of a named argument