UNPKG

2.37 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 targetFile?: string;
31 packageManager?: SupportedPackageManagers;
32 meta?: {
33 allSubProjectNames?: string[];
34 versionBuildInfo?: VersionBuildInfo;
35 targetFile?: string;
36 };
37 dockerImageId?: any;
38 imageLayers?: any;
39 packageFormatVersion?: string;
40}
41export interface VersionBuildInfo {
42 gradleVersion?: string;
43 metaBuildVersion: {
44 [index: string]: string;
45 };
46}
47export interface SinglePackageResult {
48 plugin: PluginMetadata;
49 package?: DepTree;
50 dependencyGraph?: DepGraph;
51 callGraph?: CallGraphResult;
52 meta?: {
53 gradleProjectName?: string;
54 versionBuildInfo?: VersionBuildInfo;
55 };
56}
57export interface MultiProjectResult {
58 plugin: PluginMetadata;
59 scannedProjects: ScannedProject[];
60}
61export declare function isMultiResult(res: InspectResult): res is MultiProjectResult;