UNPKG

hardhat

Version:

Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

56 lines 2.49 kB
import type { DependencyGraph } from "../../../../types/solidity/dependency-graph.js"; import type { ResolvedFile } from "../../../../types/solidity/resolved-file.js"; export interface DependencyGraphImplementationJson { readonly fileByInputSourceName: Record<string, ResolvedFile>; readonly rootByUserSourceName: Record<string, string>; readonly dependencies: Record<string, Record<string, string[]>>; } export declare class DependencyGraphImplementation implements DependencyGraph { #private; /** * Adds a root file to the graph. All the roots of the dependency graph must * be added before any dependencry. * * @param userSourceName The source name used to identify the file, as it * would appear in the artifacts and used by the user. This is not always the * same as the source name used by solc, as it differs when an npm file is * acting as a root. * @param root The root file. */ addRootFile(userSourceName: string, root: ResolvedFile): void; /** * Adds a dependency from a file to another one. * * @param from The file that depends on another one, which must be already * present in the graph. * @param to The dependency, which will be added to the list of dependencies * of the file, and added to the graph if needed. * @param remapping The remapping that was used to resolve this dependency, if * any. */ addDependency(from: ResolvedFile, to: ResolvedFile, remapping?: string): void; /** * Returns a map of user source names to root files. */ getRoots(): ReadonlyMap<string, ResolvedFile>; /** * Returns a sorted map of userSourceName to inputSourceName for every * root of the graph. */ getRootsUserSourceNameMap(): Record<string, string>; /** * Returns a set of all the files in the graph. */ getAllFiles(): Iterable<ResolvedFile>; hasFile(file: ResolvedFile): boolean; getDependencies(file: ResolvedFile): ReadonlySet<{ file: ResolvedFile; remappings: ReadonlySet<string>; }>; getFileByInputSourceName(inputSourceName: string): ResolvedFile | undefined; getSubgraph(...rootUserSourceNames: string[]): DependencyGraphImplementation; merge(other: DependencyGraphImplementation): DependencyGraphImplementation; getAllRemappings(): readonly string[]; toJSON(): DependencyGraphImplementationJson; } //# sourceMappingURL=dependency-graph.d.ts.map