export interface SourceRange { /** Inclusive start offset. */ start: number; /** Exclusive end offset. */ end: number; } export interface SourceAttribute extends SourceRange { /** Attribute name exactly as written in source. */ name: string; /** Inclusive offset where the attribute name starts. */ name_start: number; /** Exclusive offset where the attribute name ends. */ name_end: number; /** Parsed string value when the attribute has one. */ value?: string | undefined; } export interface ScriptRegion extends SourceRange { /** Offset where the opening `` character. */ opening_tag_end: number; /** Offset immediately after the `script` tag name. */ tag_name_end: number; /** Offset where script content starts. */ content_start: number; /** Offset where script content ends. */ content_end: number; /** Offset where the closing `` tag starts. */ closing_tag_start: number; /** Offset immediately after the closing `` tag. */ closing_tag_end: number; /** Raw attribute text between `script` and `>`. */ attributes_text: string; /** Parsed opening tag attributes. */ attributes: readonly SourceAttribute[]; /** Script content between the opening and closing tags. */ text: string; /** Whether this is a module script. */ is_module: boolean; /** Whether the script has a `lang` attribute. */ has_lang: boolean; /** Parsed `lang` value when present. */ lang?: string | undefined; /** Whether this script should be parsed as TypeScript. */ is_typescript: boolean; /** Whether this script has SER's `effect` attribute. */ has_effect: boolean; /** Range of the `effect` attribute, including leading whitespace. */ effect_attribute?: SourceRange | undefined; } export interface MarkupBraceExpression { /** Offset of the opening `{`. */ open: number; /** Offset of the closing `}`. */ close: number; /** Offset where the expression body starts. */ inner_start: number; /** Offset where the expression body ends. */ inner_end: number; /** Raw expression body between braces. */ inner: string; /** Trimmed expression body. */ expression_text: string; /** Attribute name when the expression is an attribute value. */ attribute_name?: string | undefined; } export interface BareConstDeclarationTag { /** Offset of the opening `{`. */ open: number; /** Offset after `{` where `@` should be inserted. */ insert_position: number; /** Brace expression that contains the bare declaration. */ expression: MarkupBraceExpression; } export interface SvelteEffectSourceScan { /** Source filename used for diagnostics and debugging. */ filename: string; /** Full component source that was scanned. */ source: string; /** Complete root-level script regions in source order. */ scripts: readonly ScriptRegion[]; /** Complete root-level style tag ranges in source order. */ styles: readonly SourceRange[]; /** HTML comment ranges in source order. */ comments: readonly SourceRange[]; /** Merged ranges where markup brace scanning should not enter. */ excluded_ranges: readonly SourceRange[]; /** Markup brace expressions outside excluded ranges. */ markup_expressions: readonly MarkupBraceExpression[]; /** Lexical binding names introduced by markup blocks and directives. */ markup_binding_names: readonly string[]; /** Bare `{const ...}` tags outside excluded ranges. */ bare_const_tags: readonly BareConstDeclarationTag[]; /** First non-module script, if present. */ instance_script?: ScriptRegion | undefined; /** First non-module script with SER's `effect` attribute, if present. */ effect_script?: ScriptRegion | undefined; } export declare function scan_svelte_effect_source(source: string, filename?: string): SvelteEffectSourceScan; /** Reuses scan offsets after bare-const normalization inserts characters. */ export declare function shift_scan_after_at_insertions(scan: SvelteEffectSourceScan, normalized_source: string, insert_positions: readonly number[]): SvelteEffectSourceScan;