diff --git a/src/Form.tsx b/src/Form.tsx index 45cb145..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:

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/AntdSimpleCells.tsx b/src/cells/AntdSimpleCells.tsx index 03100f0..86df2ea 100644 --- a/src/cells/AntdSimpleCells.tsx +++ b/src/cells/AntdSimpleCells.tsx @@ -7,10 +7,8 @@ * * SPDX-License-Identifier: GPL-3.0-only ********************************************************************************/ -import { get } from 'lodash-es'; - import React from 'react'; -import { Button, Card, Image, Row, Col, Rate } from 'antd'; +import { Button, Image, Rate } from 'antd'; import { rankWith, @@ -37,7 +35,7 @@ import './cell.css'; /** * AntdBooleanCell */ -export const AntdBooleanCell = (props: any) => { +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 (