import * as ts from "typescript"; import type { DataShapePolicy } from "@stripe/formspec-core"; import type { ConstraintSemanticDiagnostic } from "./semantic-targets.js"; /** * The source root and the generation semantics used to inspect its fields. * @internal */ export type DataShapeAnalysisTarget = { readonly declaration: ts.ClassDeclaration | ts.InterfaceDeclaration | ts.TypeAliasDeclaration; } | { readonly type: ts.Type; readonly sourceNode: ts.Node; readonly name?: string; }; /** * Options for checking source types before canonicalization can discard their shape. * @internal */ export type AnalyzeDataShapeOptions = DataShapeAnalysisTarget & { readonly checker: ts.TypeChecker; readonly policy: DataShapePolicy; /** The build consumer supplies its existing custom-type registration resolver. */ readonly isCustomType?: (type: ts.Type, source: ts.Node) => boolean; }; /** * Checks the reachable data fields of a static schema target using its existing * checker. Diagnostics describe source fields rather than generated schema paths. * This belongs before lowering: e.g. an `any` field can otherwise become a string. * @internal */ export declare function analyzeDataShape(options: AnalyzeDataShapeOptions): ConstraintSemanticDiagnostic[]; //# sourceMappingURL=data-shape.d.ts.map