@autorest/cadl
Version:
AutoRest Cadl plugin
36 lines • 986 B
TypeScript
export interface ResolveModuleOptions {
baseDir: string;
resolveMain?: (pkg: any) => string;
}
export interface ResolveModuleHost {
/**
* Resolve the real path for the current host.
*/
realpath(path: string): Promise<string>;
/**
* Get information about the given path
*/
stat(path: string): Promise<{
isDirectory(): boolean;
isFile(): boolean;
}>;
/**
* Read a utf-8 encoded file.
*/
readFile(path: string): Promise<string>;
}
type ResolveModuleErrorCode = "MODULE_NOT_FOUND";
export declare class ResolveModuleError extends Error {
code: ResolveModuleErrorCode;
constructor(code: ResolveModuleErrorCode, message: string);
}
/**
* Resolve a module
* @param host
* @param name
* @param options
* @returns
*/
export declare function resolveModule(host: ResolveModuleHost, name: string, options: ResolveModuleOptions): Promise<string>;
export {};
//# sourceMappingURL=module-resolver.d.ts.map