import { ResourceParser } from './common/resourceParser.js'; import type { Suppression, ValidationResponse } from './common/sarif.js'; import type { CustomSchema, Plugin, Resource } from './common/types.js'; import { Config } from './config/parse.js'; import { PluginMetadataWithConfig, PluginName, RuleMetadataWithConfig, ValidateParams, Validator } from './types.js'; import { Fixer, Suppressor } from './sarif/index.js'; import { SchemaLoader } from './validators/index.js'; import { PluginLoader } from './pluginLoaders/PluginLoader.js'; import { ValidationConfig } from '@monokle/types'; import { PluginContext } from './pluginLoaders/types.js'; export declare type ValidatorInit = { loader: PluginLoader; parser: ResourceParser; suppressors: Suppressor[]; fixer: Fixer; schemaLoader: SchemaLoader; }; export declare class MonokleValidator implements Validator { _config: Config; _abortController: AbortController; _loading?: Promise; _pluginContext: PluginContext; _loader: PluginLoader; _previousPluginsInit?: Record; _plugins: Plugin[]; _failedPlugins: string[]; _customSchemas: Record; _suppressions: Suppression[]; private _suppressor; constructor(init: ValidatorInit, config?: ValidationConfig); get config(): Config; get metadata(): Record; get rules(): Record; /** * Whether the plugin is loaded. * * @params name - The plugin name. * @example "open-policy-agent" */ private isPluginLoaded; /** * The plugins that are loaded in this validator. */ getPlugins(): Plugin[]; /** * The plugins that failed to load in this validator. */ getFailedPlugins(): string[]; /** * The plugin with the given name. * * @params name - The plugin name */ getPlugin(name: string): Plugin | undefined; /** * Eagerly load and configure the validation plugins. * * @param config - the new configuration of the validator. * @param suppressions - a list with suppression requests. */ preload(config?: Config, suppressions?: Suppression[]): Promise; /** * Load the plugin and prepare it. * Afterward plugin and rule metadata are available. * * @see config.plugins */ private load; private cancelLoad; private doLoad; private doUnload; /** * Validates the resources. */ validate({ resources, incremental, baseline, abortSignal: externalAbortSignal, srcroot, }: ValidateParams): Promise; applySuppressions(response: ValidationResponse, resources: Resource[], suppressions?: Suppression[]): Promise; /** * Compares the validation result with a baseline. * * @remarks comparison uses fingerprints. * @remark enhances the result with baseline guid & state. */ private compareWithBaseline; private compareRunWithBaseline; private preprocessCustomResourceDefinitions; registerCustomSchema(schema: CustomSchema, crd?: Resource): Promise; unregisterCustomSchema(schema: Omit): Promise; /** * Clear the incremental caches. */ clear(): Promise; /** * Unloads the Monokle Validator, so it can be used as new. */ unload(): Promise; private debug; }