From eab3518665101323ac61a4f925dd30ca585f4f12 Mon Sep 17 00:00:00 2001 From: aeksandla Date: Thu, 16 Jan 2025 17:14:41 +0300 Subject: [PATCH] feat: update params typing --- src/blocks/Slider/schema.ts | 13 ++++++++++++- src/blocks/SliderNew/schema.ts | 13 ++++++++++++- src/models/constructor-items/blocks.ts | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/blocks/Slider/schema.ts b/src/blocks/Slider/schema.ts index 27c0b7a00..6605ed84e 100644 --- a/src/blocks/Slider/schema.ts +++ b/src/blocks/Slider/schema.ts @@ -26,7 +26,18 @@ const LoadableProps = { type: 'object', patternProperties: { '.*': { - type: ['string', 'number', 'boolean'], + oneOf: [ + { + type: ['string', 'number', 'boolean'], + }, + { + type: 'object', + additionalProperties: true, + }, + { + type: 'array', + }, + ], }, }, }, diff --git a/src/blocks/SliderNew/schema.ts b/src/blocks/SliderNew/schema.ts index 3f20233a6..10fb8f758 100644 --- a/src/blocks/SliderNew/schema.ts +++ b/src/blocks/SliderNew/schema.ts @@ -26,7 +26,18 @@ const LoadableProps = { type: 'object', patternProperties: { '.*': { - type: ['string', 'number', 'boolean'], + oneOf: [ + { + type: ['string', 'number', 'boolean'], + }, + { + type: 'object', + additionalProperties: true, + }, + { + type: 'array', + }, + ], }, }, }, diff --git a/src/models/constructor-items/blocks.ts b/src/models/constructor-items/blocks.ts index 715d0f235..6c747e2b0 100644 --- a/src/models/constructor-items/blocks.ts +++ b/src/models/constructor-items/blocks.ts @@ -91,7 +91,7 @@ export interface LoadableProps { * @deprecated Will be moved to params */ serviceId?: number; - params?: Record; + params?: Record; } export interface LoadableChildren {