UNPKG

2.4 kBTypeScriptView Raw
1import { CallGraphResult, DepGraph, DepTree, ScannedProject, SupportedPackageManagers } from './common';
2export interface SingleSubprojectPlugin {
3 inspect(root: string, targetFile?: string, options?: SingleSubprojectInspectOptions): Promise<SinglePackageResult>;
4 pluginName?(): string;
5}
6export interface Plugin extends SingleSubprojectPlugin {
7 inspect(root: string, targetFile?: string, options?: InspectOptions): Promise<InspectResult>;
8 inspect(root: string, targetFile?: string, options?: SingleSubprojectInspectOptions): Promise<SinglePackageResult>;
9 inspect(root: string, targetFile: string | undefined, options: MultiSubprojectInspectOptions): Promise<MultiProjectResult>;
10}
11export declare function adaptSingleProjectPlugin(plugin: SingleSubprojectPlugin): Plugin;
12export interface BaseInspectOptions {
13 dev?: boolean;
14 skipUnresolved?: boolean;
15 args?: string[];
16 useDepGraph?: boolean;
17}
18export interface SingleSubprojectInspectOptions extends BaseInspectOptions {
19 subProject?: string;
20}
21export interface MultiSubprojectInspectOptions extends BaseInspectOptions {
22 allSubProjects: true;
23}
24export declare type InspectOptions = SingleSubprojectInspectOptions | MultiSubprojectInspectOptions;
25export declare type InspectResult = SinglePackageResult | MultiProjectResult;
26export declare function isMultiSubProject(options: InspectOptions): options is MultiSubprojectInspectOptions;
27export interface PluginMetadata {
28 name: string;
29 runtime?: string;
30 targetRuntime?: string;
31 targetFile?: string;
32 packageManager?: SupportedPackageManagers;
33 meta?: {
34 allSubProjectNames?: string[];
35 versionBuildInfo?: VersionBuildInfo;
36 targetFile?: string;
37 };
38 dockerImageId?: any;
39 imageLayers?: any;
40 packageFormatVersion?: string;
41}
42export interface VersionBuildInfo {
43 gradleVersion?: string;
44 metaBuildVersion: {
45 [index: string]: string;
46 };
47}
48export interface SinglePackageResult {
49 plugin: PluginMetadata;
50 package?: DepTree;
51 dependencyGraph?: DepGraph;
52 callGraph?: CallGraphResult;
53 meta?: {
54 gradleProjectName?: string;
55 versionBuildInfo?: VersionBuildInfo;
56 };
57}
58export interface MultiProjectResult {
59 plugin: PluginMetadata;
60 scannedProjects: ScannedProject[];
61}
62export declare function isMultiResult(res: InspectResult): res is MultiProjectResult;