diff --git a/src/Form.tsx b/src/Form.tsx index cf295e8..70f1faf 100644 --- a/src/Form.tsx +++ b/src/Form.tsx @@ -21,6 +21,7 @@ import { MstContext } from './MstContext'; import { UnknownRenderer } from './UnknownRenderer'; import { RankedTester } from './testers'; import { IViewDescr, IViewDescrElement, IViewKind, IViewKindElement } from './models/uischema'; +import { JsObject } from '@agentlab/sparql-jsld-client'; export interface ControlComponent { data: any; @@ -83,7 +84,7 @@ export interface DispatchCellProps extends RenderProps { [key: string]: any; } -export function mstJsonLdIds(o: any) { +export function mstJsonLdIds(o: JsObject): JsObject | undefined { if (o) return { '@id': o['@id'], '@type': o['@type'] }; else return undefined; } @@ -180,7 +181,7 @@ export const FormsDispatch = observer((props) => { } }); -export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) { +export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps): JSX.Element { return (

Something went wrong:

@@ -228,8 +229,8 @@ export const Form = observer((props) => { } return ( {}}> - {viewKindObs.elements.map((el: IViewKindElement) => ( - + {viewKindObs.elements.map((el: IViewKindElement, idx: number) => ( + ))} ); diff --git a/src/UnknownRenderer.tsx b/src/UnknownRenderer.tsx index fde78a2..ca1c447 100644 --- a/src/UnknownRenderer.tsx +++ b/src/UnknownRenderer.tsx @@ -26,7 +26,7 @@ export interface UnknownRendererProps { * A renderer that will be used in case no other renderer is applicable. */ export class UnknownRenderer extends Component { - render() { + render(): JSX.Element { return (
No applicable {this.props.type} found for element with id={this.props.elementId} and type= diff --git a/src/cells/AntdCellCardLayout.tsx b/src/cells/AntdCellCardLayout.tsx index 76bbf73..bdc2b57 100644 --- a/src/cells/AntdCellCardLayout.tsx +++ b/src/cells/AntdCellCardLayout.tsx @@ -17,7 +17,7 @@ import { Card } from 'antd'; import { DispatchCell } from '../DispatchCell'; import './cell.css'; -export const AntdCellCardLayout = (props: any) => { +export const AntdCellCardLayout = (props: any): JSX.Element => { const { viewKind, viewKindElement, viewDescr, viewDescrElement, schema, data, id } = props; const createCardChilds = () => viewKindElement.elements diff --git a/src/cells/AntdCellG2.tsx b/src/cells/AntdCellG2.tsx index 0003177..f9972ca 100644 --- a/src/cells/AntdCellG2.tsx +++ b/src/cells/AntdCellG2.tsx @@ -10,7 +10,7 @@ const template: any = { 'https://www.wildberries.ru/catalog/16170086/detail.aspx': '/img/chart_3.png', 'https://www.wildberries.ru/catalog/18247707/detail.aspx': '/img/chart_4.png', }; -export const AntdCellG2 = (props: any) => { +export const AntdCellG2 = (props: any): JSX.Element => { return ; }; diff --git a/src/cells/AntdCellHorizontalLayout.tsx b/src/cells/AntdCellHorizontalLayout.tsx index 624feea..ed4c887 100644 --- a/src/cells/AntdCellHorizontalLayout.tsx +++ b/src/cells/AntdCellHorizontalLayout.tsx @@ -69,6 +69,7 @@ export const AntdCellHorizontalLayoutRenderer: React.FC = ({ {(viewKindElement.elements || []).map((e: IViewKindElement, idx: number) => ( { +export const AntdBooleanCell = (props: any): JSX.Element => { return ; }; export const antdBooleanCellTester: RankedTester = rankWith(2, isBooleanControl); @@ -46,7 +44,7 @@ export const AntdBooleanCellWithStore = withStoreToCellProps(AntdBooleanCell); /** * AntdButtonCell */ -export const AntdButtonCell = (props: any) => { +export const AntdButtonCell = (props: any): JSX.Element => { const options = props.uiOptions; return (