From 4574b7f03ccc85c4bebdbfd9475788456086704f Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 8 Aug 2024 12:27:40 -0400 Subject: many changes to add typing in place of 'any's etc --- src/client/views/nodes/AudioBox.tsx | 57 ++++++------- .../views/nodes/CollectionFreeFormDocumentView.tsx | 24 ++++-- src/client/views/nodes/ComparisonBox.tsx | 7 +- src/client/views/nodes/DataVizBox/DataVizBox.tsx | 8 +- .../views/nodes/DataVizBox/SchemaCSVPopUp.tsx | 2 - .../views/nodes/DataVizBox/components/TableBox.tsx | 56 +++++++------ src/client/views/nodes/DocumentContentsView.tsx | 46 +++++++---- src/client/views/nodes/DocumentLinksButton.tsx | 4 +- src/client/views/nodes/DocumentView.tsx | 39 +++++---- src/client/views/nodes/EquationBox.tsx | 11 ++- src/client/views/nodes/FieldView.tsx | 3 +- .../views/nodes/FontIconBox/ButtonInterface.ts | 12 --- src/client/views/nodes/FontIconBox/FontIconBox.tsx | 46 +++++------ src/client/views/nodes/ImageBox.tsx | 9 +- src/client/views/nodes/KeyValueBox.tsx | 14 ++-- src/client/views/nodes/KeyValuePair.tsx | 9 +- src/client/views/nodes/LinkBox.tsx | 14 ++-- src/client/views/nodes/LinkDocPreview.tsx | 6 +- src/client/views/nodes/LoadingBox.tsx | 2 +- src/client/views/nodes/MapBox/MapBox.tsx | 8 +- src/client/views/nodes/PDFBox.tsx | 18 ++-- .../nodes/PhysicsBox/PhysicsSimulationBox.tsx | 15 ++-- .../views/nodes/RecordingBox/RecordingBox.tsx | 5 +- src/client/views/nodes/ScreenshotBox.tsx | 35 ++++---- src/client/views/nodes/ScriptingBox.tsx | 96 ++++++++++------------ src/client/views/nodes/VideoBox.tsx | 18 ++-- src/client/views/nodes/WebBox.tsx | 47 ++++++----- src/client/views/nodes/WebBoxRenderer.js | 18 ++-- src/client/views/nodes/audio/AudioWaveform.tsx | 2 +- .../nodes/formattedText/DashDocCommentView.tsx | 38 +++++---- .../views/nodes/formattedText/DashDocView.tsx | 29 ++++--- .../views/nodes/formattedText/DashFieldView.tsx | 34 ++++---- .../views/nodes/formattedText/EquationEditor.tsx | 17 ++-- .../views/nodes/formattedText/EquationView.tsx | 22 +++-- .../views/nodes/formattedText/FormattedTextBox.tsx | 89 +++++++++++--------- .../formattedText/FormattedTextBoxComment.tsx | 4 +- .../views/nodes/formattedText/ParagraphNodeSpec.ts | 36 ++++++-- .../views/nodes/formattedText/RichTextMenu.tsx | 42 +++++----- .../views/nodes/formattedText/RichTextRules.ts | 56 ++++++------- src/client/views/nodes/formattedText/marks_rts.ts | 40 ++++----- src/client/views/nodes/formattedText/nodes_rts.ts | 91 +++++++++++++------- 41 files changed, 595 insertions(+), 534 deletions(-) delete mode 100644 src/client/views/nodes/FontIconBox/ButtonInterface.ts (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx index 9deed4de4..59349da8b 100644 --- a/src/client/views/nodes/AudioBox.tsx +++ b/src/client/views/nodes/AudioBox.tsx @@ -1,5 +1,3 @@ -/* eslint-disable jsx-a11y/no-static-element-interactions */ -/* eslint-disable jsx-a11y/click-events-have-key-events */ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Tooltip } from '@mui/material'; import { action, computed, IReactionDisposer, makeObservable, observable, runInAction } from 'mobx'; @@ -7,7 +5,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { returnFalse, setupMoveUpEvents } from '../../../ClientUtils'; import { DateField } from '../../../fields/DateField'; -import { Doc } from '../../../fields/Doc'; +import { Doc, Opt } from '../../../fields/Doc'; import { DocData } from '../../../fields/DocSymbols'; import { ComputedField } from '../../../fields/ScriptField'; import { Cast, DateCast, NumCast } from '../../../fields/Types'; @@ -44,9 +42,9 @@ import { OpenWhere } from './OpenWhere'; */ // used as a wrapper class for MediaStream from MediaDevices API -declare class MediaRecorder { - constructor(e: any); // whatever MediaRecorder has -} +// declare class MediaRecorder { +// constructor(e: unknown); // whatever MediaRecorder has +// } export enum mediaState { PendingRecording = 'pendingRecording', @@ -61,9 +59,7 @@ export class AudioBox extends ViewBoxAnnotatableComponent() { return FieldView.LayoutString(AudioBox, fieldKey); } - public static Enabled = false; - - constructor(props: any) { + constructor(props: FieldViewProps) { super(props); makeObservable(this); } @@ -74,12 +70,12 @@ export class AudioBox extends ViewBoxAnnotatableComponent() { _dropDisposer?: DragManager.DragDropDisposer; _disposers: { [name: string]: IReactionDisposer } = {}; _ele: HTMLAudioElement | null = null; //