import type { Diagnostic } from '../types.js'; import type { SfmcSettings } from '../types.js'; export declare const DIAG_CODE_SSJS_POLYFILL_REQUIRED = "ssjs/polyfill-required"; export declare const DIAG_CODE_SSJS_MCN_NOT_SUPPORTED = "ssjs/mcn-not-supported"; export declare const DIAG_CODE_SSJS_REPLACE_WITH_PLATFORM_FUNCTION = "ssjs/replace-with-platform-function"; export declare const DIAG_CODE_SSJS_REQUIRE_PLATFORM_LOAD = "ssjs/require-platform-load"; export declare const DIAG_CODE_SSJS_PLATFORM_LOAD_VERSION = "ssjs/platform-load-version"; export declare const DIAG_CODE_SSJS_UNSUPPORTED_SYNTAX = "ssjs/unsupported-syntax"; export declare const DIAG_CODE_SSJS_CLR_HEADER_ACCESS = "ssjs/clr-header-access"; export declare const DIAG_CODE_SSJS_CLR_CONTENT_ACCESS = "ssjs/clr-content-access"; export declare const DIAG_CODE_SSJS_INVALID_HTTP_PROPERTY = "ssjs/invalid-http-property-value"; export declare const DIAG_CODE_SSJS_NONEXISTENT_GLOBAL = "ssjs/nonexistent-global"; export declare const DIAG_CODE_SSJS_DEPRECATED = "ssjs/deprecated"; export declare const DIAG_CODE_SSJS_INVALID_ARITY = "ssjs/invalid-arity"; export declare const DIAG_CODE_SSJS_NONFUNCTIONAL_METHOD = "ssjs/nonfunctional-method"; /** * SSJS diagnostic codes that duplicate eslint-plugin-sfmc rules and can be * suppressed via the `disableLspDiagnosticsForEslintRules` setting: * - polyfill-required / replace-with-platform-function → `ssjs-no-unavailable-method` * - mcn-not-supported → `ssjs-no-mcn-unsupported` (enabled in the `-next` configs) * - require-platform-load → `ssjs-require-platform-load` * - platform-load-version → `ssjs-prefer-platform-load-version` * - unsupported-syntax → `ssjs-no-unsupported-syntax` * - clr-header-access → `ssjs-no-clr-header-access` * - clr-content-access → `ssjs-require-string-clr-content` * - invalid-http-property-value → `ssjs-http-property-value` * - nonexistent-global → `ssjs-no-nonexistent-global` * - deprecated → `ssjs-no-deprecated-function` * - invalid-arity → `ssjs-platform-function-arity` * - nonfunctional-method → `ssjs-no-nonfunctional-method` */ export declare const SSJS_ESLINT_DUPLICATE_DIAG_CODES: Set; /** * Payload attached to `ssjs/polyfill-required` diagnostics so the code action * can insert the polyfill without re-deriving it from ssjs-data. */ export interface PolyfillDiagnosticData { owner: string; method: string; polyfill: string; } /** * Payload attached to `ssjs/replace-with-platform-function` diagnostics so the * code action can rewrite the call (e.g. `JSON.parse` → `Platform.Function.ParseJSON`). */ export interface ReplaceDiagnosticData { owner: string; member: string; replacement: string; } /** * Payload attached to `ssjs/clr-header-access` diagnostics so the code action * can rewrite the access to `getHeaderMap()[]` and insert the * helper. `respName` is the response variable; `keyText` is the header-key * expression source (e.g. `"Content-Type"`), or empty when none was found. */ export interface ClrHeaderAccessDiagnosticData { respName: string; keyText: string; } /** * Payload attached to `ssjs/clr-content-access` diagnostics so the code action * can wrap the flagged access in `String(...)`. `contentText` is the source of * the flagged `.content` member expression (e.g. `resp.content`). */ export interface ClrContentAccessDiagnosticData { respName: string; contentText: string; } /** * A single replacement offered by the `ssjs/invalid-http-property-value` quick-fix. * `code` is the source-ready literal to insert (already quoted for string enums, * e.g. `'GET'`, or a numeric literal like `0`); `label` is an optional short * human-readable meaning shown in the action title (e.g. `continue` for `0`). */ export interface InvalidHttpPropertySuggestion { code: string; label?: string; } /** * Payload attached to `ssjs/invalid-http-property-value` diagnostics so the code * action can offer valid replacement values. `propName` is the property (e.g. * `method`); `suggestions` are the replacements to offer, each with its * source-ready `code` and an optional descriptive `label`. */ export interface InvalidHttpPropertyDiagnosticData { propName: string; suggestions: InvalidHttpPropertySuggestion[]; } /** * Validate an SSJS document and return LSP Diagnostics. * @param text - Full document text. * @param settings - Validation settings. * @returns Array of LSP Diagnostic objects. */ export declare function validateSsjs(text: string, settings?: SfmcSettings): Diagnostic[]; //# sourceMappingURL=ssjs.d.ts.map