import { type CatalogResolver, type PropertyScope } from './project.js'; import type { ProjectFile, ReleaseDoctorFinding } from './types.js'; export declare const TARGET_SDK_SOURCE = "https://support.google.com/googleplay/android-developer/answer/11926878"; export declare function targetPolicy(now: Date): { minimum: number | null; scheduleCurrent: boolean; effectiveDate?: string; }; /** An app module judged against the Target API rule: its build script plus the scripts it `apply from:`s. */ interface TargetSdkModule { file: ProjectFile; scripts: ProjectFile[]; /** * The module's build-root project script and the scripts it applies: their `subprojects { … }` / * `allprojects { … }` blocks (with any `afterEvaluate`, `plugins.withId`, `pluginManager.withPlugin` inside) * configure every module, so their targetSdk assignments always count for the module. */ inherited?: ProjectFile[]; /** Build scripts of the module's parent projects (between the build root and the module): extra properties only. */ hierarchy?: ProjectFile[]; /** * Scripts the build root applies inside `subprojects { … }` / `allprojects { … }` (`apply from:` there): they run in * every module, so all their targetSdk settings count for the module, wherever the script lives. */ everyProject?: ProjectFile[]; /** `apply from:` references of the module or its build root that could not be read (a URL, a computed path, …). */ unfollowed?: string[]; } /** How one judged module's targetSdk was resolved (also in the JSON report as `targetSdkModules`). */ export interface TargetSdkModuleVerdict { module: string; /** Values the module was proven to use (several with flavors or inherited every-project settings). */ values: Array<{ value: number; file: string; }>; /** False when any targetSdk assignment of the module could not be evaluated, or none was found. */ resolved: boolean; /** Why the module is unresolved, as written in the build script. */ unresolved: string[]; } /** * One `targetSdk` / `targetSdkVersion` / `setTargetSdkVersion` token in a scanned script — the fail-closed net's * inventory (in the JSON report as `targetSdkTokens`). */ export interface TargetSdkToken { file: string; line: number; /** * `assign`: sets targetSdk. `define`: defines an extra property or local of that name (`ext.targetSdkVersion = 36`, * `def targetSdk = 36`). `read`: reads it on a right-hand side or as an argument. `other`: lint's or the test * runner's own targetSdk. `unknown`: a shape the scanner does not model, which keeps the verdict from TARGET_SDK_OK. */ kind: 'assign' | 'define' | 'read' | 'other' | 'unknown'; /** The value an `assign` token resolved to, when it did. */ value?: number; /** Evaluated as part of a judged app module (its own scripts or its build root's every-project blocks). */ attributed: boolean; /** Why the script is out of the net (`sample`, `library`, `specialized`, `template`, `outside`). */ excluded?: string; } /** A Gradle script for the net, with the reason it is out of scope (then its tokens are only inventoried). */ interface TargetSdkNetScript { file: ProjectFile; excluded?: string; /** Its build root's scripts, whose extra properties the script sees. */ inherited?: ProjectFile[]; } /** Index ranges of `subprojects { … }` / `allprojects { … }` blocks (their nested closures included). */ export declare function everyProjectBlocks(text: string): Array; /** * The Target API verdict, fail-closed in two layers. * * Per module: each judged app module is evaluated on its own scripts AND the `subprojects` / `allprojects` blocks of * its build root (with any `afterEvaluate`, `plugins.withId`, `pluginManager.withPlugin` inside); every value found * counts, so the lowest wins. A module with any assignment it cannot evaluate — or none at all — is unresolved. * * Global net: every targetSdk token in the in-scope Gradle scripts (non-sample, non-library, non-specialized: * build, settings, applied, and convention scripts) is inventoried. A token of a shape the scanner does not model, or * an assignment it cannot attribute to a judged module (a root project's own configuration, `project(':x') { … }`, a * settings `gradle.beforeProject`, a convention plugin) whose value is unresolved or below the minimum, keeps the * verdict at TARGET_SDK_UNRESOLVED, citing the file and line. * * INVARIANT: TARGET_SDK_OK only when every judged module resolved AND the net found every in-scope token recognised * with every value at or above the minimum. A judged module's proven value below the minimum is a blocker, even next * to unresolved modules (blockers win). */ export declare function targetSdkFindings(gradleFiles: ProjectFile[], now: Date, supplementalEvidence?: Array<{ file: string; value: number; }>, resolveCatalogs?: CatalogResolver, properties?: { scope: PropertyScope; ciOverrides: Set; settingsTexts?: string[]; }, modules?: TargetSdkModule[], net?: TargetSdkNetScript[], /** Convention-build roots the walk could not read completely: the net is incomplete there. */ unreadConventionRoots?: string[]): { findings: ReleaseDoctorFinding[]; modules: TargetSdkModuleVerdict[]; tokens: TargetSdkToken[]; }; export {};