/** * SSJS language data for the language server. * * Re-exports SSJS function/object metadata from ssjs-data (the single * source of truth) into formats suitable for LSP completions, hover, * and diagnostics. No hand-maintained copies — updates to ssjs-data * propagate automatically. */ export interface SsjsFunctionParam { name: string; description: string; type?: string; optional?: boolean; } export interface SsjsFunction { name: string; minArgs: number; maxArgs: number; description: string; prefix?: string; params?: SsjsFunctionParam[]; returnType?: string; syntax?: string; example?: string; isStatic?: boolean; deprecated?: boolean; notDefinedAtRuntime?: boolean; /** * True when the member EXISTS/RESOLVES at runtime but has no known working * invocation (every tested call fails). Unlike notDefinedAtRuntime it is KEPT * in completions/hover; call sites are warned instead. */ nonFunctionalAtRuntime?: boolean; officialDocsNote?: string; requiresCoreLoad?: boolean; aliasOf?: string; /** * Exact set of permitted argument counts for a discontinuous overload where a * contiguous minArgs..maxArgs range would wrongly accept intermediate counts. * When present, a call is valid only when its argument count is within * [minArgs, maxArgs] AND a member of this array (e.g. HTTPGet accepts only 1 or * 6 arguments; 2-5 throw at runtime). Absent → pure contiguous range. */ validArities?: number[]; } export interface EcmascriptBuiltin { name: string; owner: string; description: string; caveat?: string; params?: SsjsFunctionParam[]; returnType?: string; syntax?: string; example?: string; guideUrl?: string; mdnUrl?: string; } export interface PolyfillableMethod { method: string; owner: string; esVersion: 3 | 5 | 6; isStatic: boolean; category: 'unavailable' | 'broken'; ambiguousWithString?: boolean; description: string; polyfill: string; } export interface SsjsObject { name: string; methods: string[]; description: string; deprecated?: boolean; } export declare const platformMethods: SsjsFunction[]; export declare const platformFunctions: SsjsFunction[]; export declare const platformFunctionLookup: Map; export declare const ssjsGlobals: SsjsFunction[]; export declare const platformVariableMethods: SsjsFunction[]; export declare const platformResponseMethods: SsjsFunction[]; export declare const platformRequestMethods: SsjsFunction[]; export declare const coreRequestMethods: SsjsFunction[]; export declare const coreLibraryObjects: SsjsObject[]; /** Set of Core Library object names (e.g. `FilterDefinition`, `DataExtension.Rows`). */ export declare const coreObjectNameSet: Set; /** * Core Library methods that resolve at runtime but have no known working * invocation (nonFunctionalAtRuntime). Map> re-exposed from ssjs-data so validators can warn at call sites and * surface the entry's officialDocsNote. */ export declare const coreNonFunctionalMethodLookup: Map>; /** * Core Library methods that still work at runtime but are deprecated (superseded * by newer functionality, e.g. Content Builder assets replacing Classic Content). * Map> re-exposed from ssjs-data so * validators/hover/completions can surface deprecation warnings and notes. */ export declare const coreDeprecatedMethodLookup: Map>; export declare const wsproxyMethods: SsjsFunction[]; export declare const httpMethods: SsjsFunction[]; export declare const httpHeaderMethods: SsjsFunction[]; export declare const dateTimeMethods: SsjsFunction[]; export declare const dateTimeTimezoneMethods: SsjsFunction[]; export declare const errorUtilMethods: SsjsFunction[]; export declare const platformRecipientMethods: SsjsFunction[]; export declare const scriptUtilConstructors: SsjsFunction[]; export declare const scriptUtilRequestMethods: SsjsFunction[]; /** * Bare-name globals (e.g. Stringify, Write, Now, GUID) that require a * preceding `Platform.Load("core", "1.1.5")` call. Object-typed entries * (Attribute, HTTPHeader, DateTime, ErrorUtil) are excluded because the * validator already has dedicated patterns for those. */ export declare const requiresCoreLoadGlobals: Set; /** * SSJS globals that are officially documented but proven NOT to exist at runtime * (calling them throws a ReferenceError), e.g. `Redirect`. Keyed by the exact * documented name so the validator can flag bare-name usage and suggest the * supported `Platform.*` replacement carried on the entry. */ export declare const nonexistentGlobals: Map; /** * Bare-name SSJS globals flagged `deprecated` in ssjs-data (e.g. `ContentArea`, * `ContentAreaByName`). Keyed by the exact documented name. Consumed by the * validator to emit a deprecation warning on bare-name usage. */ export declare const deprecatedGlobals: Map; export declare const ecmascriptBuiltins: EcmascriptBuiltin[]; /** * ECMAScript members empirically confirmed ABSENT or BROKEN in the SFMC SSJS * engine but for which a verified polyfill exists in ssjs-data. Consumed by * validateSsjs to warn when authored/generated SSJS references one and to offer * an "insert polyfill" code action carrying the polyfill source. */ export declare const polyfillableMethods: PolyfillableMethod[]; /** * Static polyfillable members keyed by `Owner.method` (lowercased), e.g. * `array.isarray`, `array.of`, `math.max`. Flagged unambiguously on an * explicit owner match. */ export declare const polyfillableStaticLookup: Map; /** * Prototype (instance) polyfillable members keyed by method name (lowercased), * e.g. `foreach`, `map`, `filter`. Members also valid on String.prototype in * ES3 (`ambiguousWithString`, e.g. slice/indexOf/lastIndexOf) are EXCLUDED to * avoid false-positive squiggles on string receivers — a regex validator cannot * prove the receiver type. Those still surface via hover caveats and (with AST) * the eslint plugin. */ export declare const polyfillablePrototypeLookup: Map; export interface ReplaceableMethod { member: string; owner: string; replacement: string; suggestion: string; } /** * Static members with NO polyfill that have a direct `Platform.Function.*` * replacement (e.g. `JSON.parse` → `Platform.Function.ParseJSON`). Keyed by * `Owner.member` (lowercased). Consumed by validateSsjs to emit a * `ssjs/replace-with-platform-function` diagnostic carrying the replacement, * so the editor can offer a "replace with …" quick-fix. */ export declare const replaceableStaticLookup: Map; /** * A value constraint on a writable HttpRequest / HttpGet instance property. * `enum` — the value must be one of the listed literals (case-sensitive strings). * `numeric` — the value must be a number of that kind (`integer` = whole number), * optionally `>= min`. */ export interface HttpPropertyValueConstraint { enum?: Array; enumLabels?: Record; numeric?: 'integer' | 'number'; min?: number; } /** * Writable HttpRequest / HttpGet property that carries a value constraint, * keyed by property name. Built once from ssjs-data (single source of truth) so * the validator can flag invalid literal assignments such as * `req.emptyContentHandling = 5` or `req.method = 'POT'`. When both HttpRequest * and HttpGet define the same property, the constraints are identical, so a * single map keyed by name is sufficient. */ export declare const httpPropertyConstraintLookup: Map; //# sourceMappingURL=ssjs.d.ts.map