import type { BeanCollection } from '../context/context'; import type { GridOptions } from '../entities/gridOptions'; import type { ValidationModuleName } from '../interfaces/iModule'; import type { RowModelType } from '../interfaces/iRowModel'; import type { ErrorId, GetErrorParams } from './errorMessages/errorText'; import type { LogService } from './logService'; /** * A validation result that resolves to a first-class error id (so it is captured by the diagnostic * overlay and throw mode), rather than a free-text message. Build via {@link _createValidationWarning}. * `emit` is captured at construction, where the id/params pairing is concrete. * @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export interface ValidationWarning { errorId: ErrorId; /** Emit through the emitting grid's log service, so the diagnostic is attributed to that grid. */ emit: (log: LogService) => void; } /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _createValidationWarning(errorId: TId, params: GetErrorParams): ValidationWarning; /** * As {@link _createValidationWarning}, but the diagnostic is captured as a deprecation (see {@link _deprecated}). * @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _createDeprecationWarning(errorId: TId, params: GetErrorParams): ValidationWarning; /** * Emits a validation result that may be either a first-class {@link ValidationWarning} or a legacy * free-text string (logged under the generic id 322), through the emitting grid's log service so the * diagnostic is attributed to that grid. * @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _emitValidationWarning(warning: string | ValidationWarning, log: LogService): void; /** Build the set of all property names that should be accepted without warning. */ export declare function buildAllValidNames(allProperties: string[], deprecations: Deprecations, propertyExceptions?: string[]): Set; export interface OptionsValidator { objectName: string; allProperties: string[]; /** Pre-computed set of all accepted property names (valid + deprecated + exceptions + Vue). */ allValidNames: Set; docsUrl?: `${string}/`; deprecations: Deprecations; validations: Validations; } export type Deprecations = Partial<{ [key in keyof T]: { version: string; message?: string; }; }>; type GetRequiredModule = (options: T, gridOptions: GridOptions, beans: BeanCollection) => ValidationModuleName | ValidationModuleName[] | null; export type RequiredModule = GetRequiredModule | ValidationModuleName | ValidationModuleName[]; export type ModuleValidation = { [key in keyof T]?: RequiredModule; }; export type Validations = { [key in keyof T]?: OptionsValidation; }; interface OptionsValidation { supportedRowModels?: RowModelType[]; dependencies?: RequiredOptions; validate?: (options: T, gridOptions: GridOptions, beans: BeanCollection) => string | ValidationWarning | null; /** Currently only supports boolean or number */ expectedType?: 'boolean' | 'number'; } export type DependentValues = { required: T[K][]; reason?: string; }; export type RequiredOptions = { [K in keyof T]: DependentValues; }; export {};