/** * Where a module's Look values and Look imports are written, and the small * readings of one written value a check needs: the builder names in scope, a * condition's term count, the first relative CSS asset an unsafe stylesheet * addresses, and whether a declared domain mentions a spelled visual unit. * * D115 P4 R3a: each is a question about a program or a node rather than about * the analyzer, so they read as a module. */ import { type Span } from "@velarscript/compiler"; import { type Expression, type Program, type ValueType } from "@velarscript/compiler/extension"; /** * D103: where one Look value was written — which property it sets, the span of * the whole entry, and the directive spelling if it is one. A migration needs * all three, because a `look:property="text"` attribute and a * `property = "text"` block entry are rewritten differently. */ export interface LookValueSite { readonly property: string; readonly entrySpan: Span; readonly directive: "look" | "style" | null; } /** * D103: where a migration writes a `velar/look` import. `declaration` is the * module's existing import of that module when it has one, so the rewrite grows * that line rather than adding a second import of the same module; `insertAt` * is where a first one goes otherwise — after the last import, or before the * first statement of a module with none. */ export interface LookImportSite { readonly declaration: { readonly span: Span; /** * D114 WB-I2: `reads` is how many times this module names the specifier's * local — every identifier read of it, the import line itself excluded. A * rewrite that consumes the last one leaves the specifier behind naming * nothing, so the import edit needs the count to know whether the name it * is replacing still has a reader. */ readonly specifiers: readonly { readonly imported: string; readonly local: string; readonly reads: number; }[]; } | null; readonly insertAt: number; readonly leadingBlankLine: boolean; } export declare function collectLookImportSite(program: Program): LookImportSite; /** Local names bound to a velar/look builder, including aliased imports. */ export declare function collectLookBuilderNames(program: Program): ReadonlyMap; export declare function lookConditionTermCount(expression: Expression, negated?: boolean): number; export declare function firstRelativeCssAssetAddress(source: string): { readonly value: string; readonly syntax: string; } | null; /** True when a property's declared domain includes a spelled visual unit type. */ export declare function mentionsLookUnitType(type: ValueType): boolean; export declare function lookLiteralZero(expression: Expression): boolean; export declare const lookJoin: (left: ValueType, right: ValueType) => ValueType | null; export declare function containsCssImport(source: string): boolean; //# sourceMappingURL=look-sites.d.ts.map