import { FormatValidator, FormatDefinition } from 'ajv';
import { UiSchema as rjsfUiSchema } from '@rjsf/core';
import { Widget } from './widgets/widget-util';
export { JSONSchema7 as JSONSchema } from 'json-schema';

export const JsonTypes = {
	array: 'array',
	object: 'object',
	number: 'number',
	integer: 'integer',
	string: 'string',
	boolean: 'boolean',
	null: 'null',
} as const;

export interface JsonTypesTypeMap {
	array: unknown[];
	object: {};
	number: number;
	integer: number;
	string: string;
	boolean: boolean;
	null: null;
}

export type DefinedValue =
	| number
	| string
	| boolean
	| { [key: string]: any }
	| any[];

export type Value = DefinedValue | null;

export interface UiSchema
	extends Pick<rjsfUiSchema, 'ui:options' | 'ui:order'> {
	'ui:widget'?: string;
	'ui:title'?: string;
	'ui:description'?: string;
	'ui:value'?: Value;
}

export interface Format {
	name: string;
	format: FormatValidator | FormatDefinition;
	widget?: Widget;
}

import { FormatValidator, FormatDefinition } from 'ajv';
import { UiSchema as rjsfUiSchema } from '@rjsf/core';
import { Widget } from './widgets/widget-util';
export type { JSONSchema7 as JSONSchema } from 'json-schema';

export const JsonTypes = {
	array: 'array',
	object: 'object',
	number: 'number',
	integer: 'integer',
	string: 'string',
	boolean: 'boolean',
	null: 'null',
} as const;

export interface JsonTypesTypeMap {
	array: unknown[];
	object: {};
	number: number;
	integer: number;
	string: string;
	boolean: boolean;
	null: null;
}

export type DefinedValue =
	| number
	| string
	| boolean
	| { [key: string]: any }
	| any[];

export type Value = DefinedValue | null;

export interface UiSchema
	extends Pick<rjsfUiSchema, 'ui:options' | 'ui:order'> {
	'ui:widget'?: string;
	'ui:title'?: string;
	'ui:description'?: string;
	'ui:value'?: Value;
}

export interface Format {
	name: string;
	format: FormatValidator | FormatDefinition;
	widget?: Widget;
}

Fix storybook issue trying to import type only json-schema package
Fix storybook issue trying to import type only json-schema package

Change-type: patch
See: https://www.flowdock.com/app/rulemotion/f-rendition/threads/vX8HYnTNYCHgAWMbkVOUFR0oA_e
Signed-off-by: Thodoris Greasidis <5791bdc4541e79bd43d586e3c3eff1e39c16665f@balena.io>