import { Project } from "@atomist/automation-client"; import { SdmContext } from "@atomist/sdm"; import { Classified, ProjectAnalysis, ProjectAnalysisOptions, TechnologyElement } from "./ProjectAnalysis"; import { HasMessages } from "./support/messageGoal"; /** * Subset of Project that is efficient and can be used during a precheck */ export declare type FastProject = Pick; /** * Scan the given project for a particular element. * Ordering is significant, as we can see the analysis to date. * It is important that scanners are efficient, because many may be * invoked on every push. Thus a scanner should determine as quickly * as possible if it should run expensive checks such as parsing, * and should use results in the analysis so far if possible. * Scanners that can analyse to varying depth should check the options parameter. */ export declare type TechnologyScanner = (p: Project, ctx: SdmContext, analysisSoFar: ProjectAnalysis, options: ProjectAnalysisOptions) => Promise; /** * Result of quickly classifying a project. */ export declare type TechnologyClassification = Classified & HasMessages; /** * More elaborate scanner that can work in phases */ export interface PhasedTechnologyScanner { /** * Quick classification of this project. Should be efficient. */ classify: (p: FastProject, ctx: SdmContext) => Promise; /** * Perform a scan of the project. */ scan: TechnologyScanner; } export declare function isPhasedTechnologyScanner(a: any): a is PhasedTechnologyScanner; export declare function toPhasedTechnologyScanner(sa: ScannerAction): PhasedTechnologyScanner; export declare type ScannerAction = TechnologyScanner | PhasedTechnologyScanner;