import { ts, type Shape, type ObjectShape, type Diagnostics, type Compiler, type Record as FluentRecord } from '@servicenow/sdk-build-core'; export declare function toReference(shape: Shape): string | import("@servicenow/sdk-build-core").RecordId; /** * Reverses an object, swapping keys and values. **reverseObject** should only be used * where the key/values are all known ahead of time and the values are unique. * @example * reverseObject({ a: 'foo', b: 'bar' }) // { foo: 'a', bar: 'b' } */ export declare function reverseObject(obj: Record): Record; export declare function noThrow(action: () => T): T | Error; /** * Regex taken from: https://github.com/oozcitak/xmlbuilder-js/blob/b20136cd1591d0f17ab2f184053c7150150428b2/src/XMLStringifier.coffee#L119C15-L119C127 */ export declare const INVALID_XML_CHARACTERS: RegExp; export declare function applyPathMappings(path: string, mappings: Record): string; export declare function getCallExpressionName(node: ts.CallExpression): string; export declare function generateDeprecatedDiagnostics(object: ObjectShape, diagnostics: Diagnostics): void; /** * Validates that client-side scripts (Client Scripts and UI Policy scripts) don't contain * import or require statements. These scripts run in the browser and cannot use module imports. * * @param script - The script content to validate * @param compiler - The TypeScript compiler instance * @returns true if the script is valid (no imports/requires), false otherwise */ export declare function validateClientSideScript(script: string, compiler: Compiler): boolean; /** * Validates a script field, emitting diagnostics for unresolved module references or * inline function expressions (arrow functions or function expressions are not valid * for server-side script fields — a server module import or string literal is required). */ export declare function validateServerScriptField(shape: Shape, diagnostics: Diagnostics, serverModulesDir: string): void; /** * Shows a diagnostic error when a field expects a valid GUID but receives an invalid value. * * @param inputReceived - The shape containing the invalid value * @param fieldName - Name of the field being validated (e.g., 'annotationId', 'formatterRef') * @param tableName - ServiceNow table name for the expected reference (e.g., 'sys_ui_annotation') * @param diagnostics - Diagnostics collection to add the error to * * @example * if (!isGUID(annotationSysId)) { * showGuidFieldDiagnostic(annotationIdField, 'annotationId', 'sys_ui_annotation', diagnostics) * } */ export declare const showGuidFieldDiagnostic: (inputReceived: Shape | undefined, fieldName: string, tableName: string, diagnostics: Diagnostics) => void; /** * Parses a number from a shape record field with fallback to default value. * Returns undefined if the field doesn't exist and no default is provided. */ export declare function getFieldAsNumber(shape: FluentRecord, fieldName: string, defaultValue?: number): number | undefined;