import type { WidgetPluginProps } from '@ui-schema/react/WidgetEngine'; import type { SchemaPlugin } from '@ui-schema/ui-schema/SchemaPlugin'; import type { SchemaResource } from '@ui-schema/ui-schema/SchemaResource'; export declare const findLeastCommonMultiple: (...values: number[]) => number; /** * @todo rewrite as a more reliable schema-reduction, only a first PoC scribble * - `properties` should only be needed to be merged in first level, but if a property exists in multiple * applied schemas, their schema could be added as `allOf`, to not merge lower levels directly but once that property is rendered * - similar for `items`/`prefixItems` * - especially tuple type items must not be concatenated, maybe build an intersection * - merge all `required` into a single list * - `enum` must be reduced to their intersection * - same for minLength/maxLength and all other validation keywords where this is possible * - conflicting `const` must be kept, to apply as `allOf.const` * - same for `pattern` and all other validation keywords here no intersection can be produced * - BUT WHY? validation for this level has already happened, all `const` don't need to be available for anything atm. * does this mean, all already validated and non-rendering-influencing keywords should be handled? what/where to decide? * @todo add support to throw errors on conflicting keywords * @todo add cleanup of baseSchema * only possible for the first/direct level, as e.g. `allOf` was used to produce the `appliedSchema`, * the `allOf` don't need to handled here and can be removed, * it would only be needed in recursive `mergeSchema` usages, * BUT all those are for keywords which should be already handled and be removed from the merged schema. * * Merge the applied schemas into a single branch for the current level. * * It implements specific strategies for various keywords to produce a predictable, * render-ready schema from a base schema and a list of applied sub-schemas. * * @param baseSchema The initial schema. * @param appliedSchemas A spread array of schemas to merge into the base schema. * @returns A new, merged schema. */ export declare function mergeSchemas(baseSchema: any, ...appliedSchemas: any[]): any; /** * @todo make as setup function, to support custom `mergeSchemas`; * or should `mergeSchemas` also be in meta context? * or the reduction login in general? * e.g. the table widget must know what `.items` exists, before rendering a row (without value), * while all others only need to get the needed schema once rendering an actual item (with value) */ export declare const validatorPlugin: SchemaPlugin & { resource?: SchemaResource; }>;