glimmer-analyzer
Version:
Statically analyzes Handlebars templates and components for dependency trees and other information.
44 lines (43 loc) • 1.51 kB
TypeScript
import Resolver, { BasicModuleRegistry, ResolverConfiguration } from '@glimmer/resolver';
import { Dict } from '@glimmer/util';
import { PackageJSON } from './utils/load-package-json';
import { Config } from './utils/load-config-factory';
export interface ResolutionMap {
[specifier: string]: string;
}
export declare class Template {
string: string;
specifier: string;
constructor(templateString: string, specifier: string);
}
export interface ProjectPaths {
config: string;
src: string;
}
export interface ProjectOptions {
environment?: string;
paths?: Partial<ProjectPaths>;
}
export default class Project {
projectDir: string;
environment: string;
pkg: PackageJSON;
paths: ProjectPaths;
config: Config;
resolverConfig: ResolverConfiguration;
protected _map: ResolutionMap;
protected _resolver: Resolver;
protected _registry: BasicModuleRegistry;
protected _pathMap: Dict<string>;
constructor(projectDir: string, options?: ProjectOptions);
readonly map: ResolutionMap;
readonly pathMap: Dict<string>;
readonly resolver: Resolver;
readonly registry: BasicModuleRegistry;
templateFor(templateName: string): Template;
specifierForPath(objectPath: string): string | null;
pathForSpecifier(specifier: string): string | null;
protected loadPackageJSON(projectDir: string): void;
protected loadEnvironmentConfig(projectDir: string, environment: string): void;
protected buildResolverConfig(): void;
}