MSP-3423 add types
This commit is contained in:
1 parent
3373b9851d
commit
a034f10829
1 file changed
+89
@@ -0,0 +1,89 @@
|
||||
import {ConfigType, ResponseSchemaType} from '@pages/ModulesPage/module.type.ts'
|
||||
import {ComponentType, Dispatch, MutableRefObject, ReactNode, SetStateAction} from 'react'
|
||||
|
||||
|
||||
export interface ConfigurationEditorPropsType {
|
||||
jsonSchema?: ResponseSchemaType
|
||||
bufConfig?: ConfigType
|
||||
setBufConfig: Dispatch<SetStateAction<ConfigType | undefined>>
|
||||
isCurrentConfigLoading: boolean
|
||||
setDisableBtn?: Dispatch<SetStateAction<boolean>>
|
||||
submitRef?: MutableRefObject<null>
|
||||
}
|
||||
|
||||
export interface DescriptionPropsType {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface Schema {
|
||||
type: string;
|
||||
dynamic?: boolean;
|
||||
}
|
||||
|
||||
export interface FieldTemplatePropsType {
|
||||
id: string;
|
||||
classNames?: string;
|
||||
label?: string;
|
||||
rawHelp?: string;
|
||||
required?: boolean;
|
||||
rawDescription?: string;
|
||||
rawErrors?: string[];
|
||||
children: ReactNode;
|
||||
displayLabel?: boolean;
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
|
||||
export interface ArrayFieldTemplatePropsType {
|
||||
items: {
|
||||
index: number;
|
||||
children: ReactNode;
|
||||
onDropIndexClick: (index: number) => () => void;
|
||||
}[];
|
||||
onAddClick: (event: MouseEvent) => void
|
||||
canAdd: boolean;
|
||||
title: string;
|
||||
titleField?: ComponentType<any>;
|
||||
idSchema: { $id: string };
|
||||
schema: { description?: string };
|
||||
}
|
||||
|
||||
|
||||
export interface ObjectFieldTemplatePropertyType {
|
||||
name: string;
|
||||
content: ReactNode;
|
||||
}
|
||||
|
||||
export interface SchemaPropertiesType {
|
||||
[key: string]: {
|
||||
type?: string;
|
||||
title?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ObjectFieldTemplatePropsType {
|
||||
properties: ObjectFieldTemplatePropertyType[];
|
||||
idSchema: {
|
||||
$id: string;
|
||||
};
|
||||
schema: {
|
||||
properties: SchemaPropertiesType;
|
||||
};
|
||||
activeTabKey: string;
|
||||
handleTabsChange: (key: string) => void;
|
||||
}
|
||||
|
||||
export interface ErrorsObjType {
|
||||
message: string;
|
||||
name: string;
|
||||
params: {
|
||||
missingProperty?: string;
|
||||
};
|
||||
property: string;
|
||||
schemaPath: string;
|
||||
stack: string;
|
||||
}
|
||||
|
||||
export interface SortPropType {
|
||||
name: string;
|
||||
}
|
||||
Reference in new issue
Block a user