/** * Kotlin source scanners for the import parser (issue #546). * * Dependency-free leaf. Both scanners are single-pass and linear. The mask is LENGTH-PRESERVING: an * offset or line number in the result is the same offset or line number in the input. */ /** * Return `content` with comments and string-literal text replaced by spaces, newlines kept. * Code inside a `${ … }` template expression is kept, because it is code. Nested block comments, * raw strings, character literals, and backtick identifiers are handled. An unterminated literal * or comment runs to the end of input. */ export declare function kotlinCodeMask(content: string): string; export type KotlinDeclarationKind = 'function' | 'property' | 'class' | 'interface' | 'object' | 'enum' | 'typealias'; export interface KotlinDeclaration { kind: KotlinDeclarationKind; /** Declared name, without backticks. */ name: string; /** Receiver type of an extension function or property, as written, without `?`. */ receiverType?: string; /** Modifiers written before the keyword (`private`, `suspend`, `expect`, `data`, `fun`, …). */ modifiers: string[]; /** Annotation names written before the keyword, without `@` or a use-site target. */ annotations: string[]; /** Offset of the declaring keyword (`fun`, `val`, `class`, …) in the source. */ offset: number; } export interface KotlinImport { /** Fully qualified name; for `import a.b.*` the package `a.b`. */ fqn: string; alias?: string; wildcard: boolean; } export interface KotlinFileHeader { /** Declared package; the empty string for the root package. */ packageName: string; imports: KotlinImport[]; /** Declarations at package level only. A member of a class or object is never listed. */ declarations: KotlinDeclaration[]; } /** * The Kotlin default-import packages (Kotlin language specification, "Default imports", JVM * target). A name they supply is external to the repository: a project symbol of the same simple * name binds only when the file imports it or shares its package. */ export declare const KOTLIN_DEFAULT_IMPORT_PACKAGES: readonly string[]; /** * Read the package, the imports, and the package-level declarations of a Kotlin file from its * text. Deterministic and linear; no parser is needed, so the synchronous import bridge can call * it. A declaration inside a class, object, function, or lambda is never returned. */ export declare function scanKotlinFile(content: string): KotlinFileHeader; //# sourceMappingURL=kotlin-source.d.ts.map