import type { Diagnostic } from './types.js'; /** Explicit variant identities, including names reserved for formerly unnamed sites. */ declare const definitions: readonly [readonly ["ampscript/html-wrapped-comment", "amp-no-html-comment", true, true], readonly ["ampscript/html-comment", "amp-no-html-comment", true, true], readonly ["ampscript/js-line-comment", "amp-no-js-line-comment", true, true], readonly ["ampscript/nested-script-tag", "amp-no-nested-script-tag", true, true], readonly ["ampscript/nested-delimiter-in-script", "amp-no-nested-ampscript-delimiter", true, true], readonly ["ampscript/nested-delimiter", "amp-no-nested-ampscript-delimiter", true, true], readonly ["ampscript/deprecated-function", "amp-no-deprecated-function", true, true], readonly ["ampscript/nonfunctional-function", "amp-no-nonfunctional-function", true, true], readonly ["ampscript/unknown-function", "amp-no-unknown-function", true, true], readonly ["ampscript/function-arity", "amp-function-arity", true, true], readonly ["ampscript/arg-type", "amp-arg-types", true, true], readonly ["ampscript/enum-value", "amp-arg-types", true, true], readonly ["ampscript/smart-quotes", "amp-no-smart-quotes", true, true], readonly ["ampscript/set-no-target", "amp-set-requires-target", true, true], readonly ["ampscript/mcn-unsupported-function", "amp-no-mcn-unsupported", true, true], readonly ["ampscript/unclosed-block", "amp-balanced-delimiters", false, false], readonly ["ampscript/unexpected-block-close", "amp-balanced-delimiters", false, false], readonly ["ampscript/unclosed-inline", "amp-balanced-delimiters", false, false], readonly ["ampscript/unexpected-inline-close", "amp-balanced-delimiters", false, false], readonly ["ampscript/unmatched-endif", "amp-balanced-control-flow", false, false], readonly ["ampscript/unmatched-next", "amp-balanced-control-flow", false, false], readonly ["ampscript/unclosed-if", "amp-balanced-control-flow", false, false], readonly ["ampscript/unclosed-for", "amp-balanced-control-flow", false, false], readonly ["ampscript/prefer-attribute-value", "amp-prefer-attribute-value", true, false], readonly ["ssjs/polyfill-required", "ssjs-no-unavailable-method", true, true], readonly ["ssjs/replace-with-platform-function", "ssjs-no-unavailable-method", true, true], readonly ["ssjs/mcn-not-supported", "ssjs-no-mcn-unsupported", true, true], readonly ["ssjs/require-platform-load", "ssjs-require-platform-load", true, true], readonly ["ssjs/platform-load-version", "ssjs-prefer-platform-load-version", true, true], readonly ["ssjs/unsupported-syntax", "ssjs-no-unsupported-syntax", true, true], readonly ["ssjs/clr-header-access", "ssjs-no-clr-header-access", true, true], readonly ["ssjs/clr-content-access", "ssjs-require-string-clr-content", true, true], readonly ["ssjs/invalid-http-property-value", "ssjs-http-property-value", true, true], readonly ["ssjs/invalid-property-access", "ssjs-no-invalid-property-access", true, true], readonly ["ssjs/nonexistent-global", "ssjs-no-nonexistent-global", true, true], readonly ["ssjs/deprecated", "ssjs-no-deprecated-function", true, true], readonly ["ssjs/invalid-arity", "ssjs-platform-function-arity", true, true], readonly ["ssjs/nonfunctional-method", "ssjs-no-nonfunctional-method", true, true], readonly ["ssjs/switch-fallthrough", "ssjs-no-switch-fallthrough", true, true], readonly ["ssjs/new-object-returning-constructor", "ssjs-no-object-returning-constructor", false, true], readonly ["ssjs/cross-block-forward-reference", "ssjs-no-cross-block-forward-reference", false, true], readonly ["handlebars/syntax-error", "hbs-syntax-error", false, true], readonly ["handlebars/unsupported-construct", "hbs-no-unsupported-construct", true, true], readonly ["handlebars/unknown-helper", "hbs-no-unknown-helper", true, true], readonly ["handlebars/unknown-binding", "hbs-no-unknown-binding", true, true], readonly ["gtl/unexpected-close", "gtl-balanced-blocks", false, false], readonly ["gtl/unclosed-block", "gtl-balanced-blocks", false, false]]; export type DiagnosticVariant = (typeof definitions)[number][0]; export type DiagnosticRuleId = `sfmc/${(typeof definitions)[number][1]}`; /** One row per internal variant, not per public rule (which may be many-to-one). */ export interface DiagnosticRule { readonly variant: DiagnosticVariant; readonly ruleId: DiagnosticRuleId; readonly documentationPath: string; /** Null for previously unnamed emissions; never match those by message text. */ readonly legacyCode: DiagnosticVariant | null; /** Null means LSP-only, even if an ESLint rule has a superficially similar name. */ readonly eslintRuleId: DiagnosticRuleId | null; /** Includes the intentional AttributeValue correction, applied upon validator migration. */ readonly suppressWithEslint: boolean; } export declare const DIAGNOSTIC_RULES: readonly DiagnosticRule[]; /** Namespaced transport data. Payload is opaque and is never flattened or coerced. */ export interface SfmcDiagnosticData { sfmc: { variant: DiagnosticVariant; payload: T; }; } /** Normalized input for existing quick-fix handlers. */ export interface DecodedDiagnosticData { variant: DiagnosticVariant; payload: T; } /** * Resolve an internal variant without accepting inherited object properties. * @param variant - Internal variant identity. * @returns The registry row, or undefined for an unknown identity. */ export declare function getDiagnosticRule(variant: string): DiagnosticRule | undefined; /** * Build an owning-package release link; development tags may not exist yet. * @param variant - Internal variant identity. * @returns An HTTPS link pinned to the LSP package version. */ export declare function getDiagnosticDocumentationUrl(variant: DiagnosticVariant): string; /** * Preserve primitive and object payloads under a namespaced envelope. * @param variant - Exact internal check identity. * @param payload - Original JSON-serializable diagnostic data, or undefined when absent. * @returns The transport envelope without mutation or cloning of the payload. */ export declare function encodeDiagnosticData(variant: DiagnosticVariant, payload: T): SfmcDiagnosticData; /** * Decode legacy data or canonical envelopes into the same quick-fix input. * Canonical many-to-one rules always require a matching explicit variant. * Unnamed legacy diagnostics cannot be decoded without inventing an identity. * @param code - Protocol diagnostic code (numeric third-party codes are ignored). * @param data - Original diagnostic data or namespaced envelope. * @returns Normalized input, or undefined for unknown, malformed or ambiguous codes. */ export declare function decodeDiagnosticData(code: string | number | undefined, data: unknown): DecodedDiagnosticData | undefined; /** * Attach the public identity and release documentation to a first-party emission. * @param variant - Exact internal check identity, including formerly unnamed checks. * @param diagnostic - Diagnostic content with the original opaque payload. * @returns A new diagnostic carrying canonical metadata and a lossless envelope. */ export declare function createDiagnostic(variant: DiagnosticVariant, diagnostic: Omit): Diagnostic; export { LSP_PACKAGE_VERSION } from './package-version.js'; //# sourceMappingURL=diagnostic-rules.d.ts.map