diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx index 7f8365474fe..8a903955dfc 100644 --- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx @@ -398,7 +398,7 @@ function SingleAutocomplete({ }, onBlur: e => { // Should this be e.nativeEvent - e.preventDownshiftDefault = true; + e['preventDownshiftDefault'] = true; inputProps.onBlur?.(e); if (!closeOnBlur) return; diff --git a/packages/desktop-client/src/components/common/Input.tsx b/packages/desktop-client/src/components/common/Input.tsx index 6e0cbbcda94..c02b9bd86c0 100644 --- a/packages/desktop-client/src/components/common/Input.tsx +++ b/packages/desktop-client/src/components/common/Input.tsx @@ -2,7 +2,7 @@ import React, { useRef, type KeyboardEvent, type Ref, - type HTMLProps, + type InputHTMLAttributes, } from 'react'; import mergeRefs from 'react-merge-refs'; @@ -21,7 +21,7 @@ export const defaultInputStyle = { border: '1px solid ' + theme.formInputBorder, }; -type InputProps = HTMLProps & { +type InputProps = InputHTMLAttributes & { style?: CSSProperties; inputRef?: Ref; onEnter?: (event: KeyboardEvent) => void; diff --git a/packages/desktop-client/src/components/modals/CreateAccount.js b/packages/desktop-client/src/components/modals/CreateAccount.tsx similarity index 100% rename from packages/desktop-client/src/components/modals/CreateAccount.js rename to packages/desktop-client/src/components/modals/CreateAccount.tsx diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js b/packages/desktop-client/src/components/modals/CreateEncryptionKey.tsx similarity index 95% rename from packages/desktop-client/src/components/modals/CreateEncryptionKey.js rename to packages/desktop-client/src/components/modals/CreateEncryptionKey.tsx index 9ead88f342e..eb1f6471839 100644 --- a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js +++ b/packages/desktop-client/src/components/modals/CreateEncryptionKey.tsx @@ -5,7 +5,9 @@ import { css } from 'glamor'; import { send } from 'loot-core/src/platform/client/fetch'; import { getCreateKeyError } from 'loot-core/src/shared/errors'; +import { type BoundActions } from '../../hooks/useActions'; import { theme } from '../../style'; +import { type CommonModalProps } from '../../types/modals'; import { ButtonWithLoading } from '../common/Button'; import ExternalLink from '../common/ExternalLink'; import InitialFocus from '../common/InitialFocus'; @@ -15,11 +17,19 @@ import Paragraph from '../common/Paragraph'; import Text from '../common/Text'; import View from '../common/View'; +type CreateEncryptionKeyProps = { + modalProps: CommonModalProps; + actions: BoundActions; + options: { + recreate?: boolean; + }; +}; + export default function CreateEncryptionKey({ modalProps, actions, options = {}, -}) { +}: CreateEncryptionKeyProps) { let [password, setPassword] = useState(''); let [loading, setLoading] = useState(false); let [error, setError] = useState(''); diff --git a/packages/desktop-client/src/components/modals/countries.js b/packages/desktop-client/src/components/modals/countries.ts similarity index 100% rename from packages/desktop-client/src/components/modals/countries.js rename to packages/desktop-client/src/components/modals/countries.ts diff --git a/packages/loot-core/src/types/handlers.d.ts b/packages/loot-core/src/types/handlers.d.ts index 802e0d3bece..2537c027962 100644 --- a/packages/loot-core/src/types/handlers.d.ts +++ b/packages/loot-core/src/types/handlers.d.ts @@ -1,6 +1,7 @@ import type { BudgetHandlers } from '../server/budget/types/handlers'; import type { FiltersHandlers } from '../server/filters/types/handlers'; import type { NotesHandlers } from '../server/notes/types/handlers'; +import type { RulesHandlers } from '../server/rules/types/handlers'; import type { SchedulesHandlers } from '../server/schedules/types/handlers'; import type { ToolsHandlers } from '../server/tools/types/handlers'; @@ -13,5 +14,6 @@ export interface Handlers BudgetHandlers, FiltersHandlers, NotesHandlers, + RulesHandlers, SchedulesHandlers, ToolsHandlers {} diff --git a/packages/loot-core/src/types/server-handlers.d.ts b/packages/loot-core/src/types/server-handlers.d.ts index 6d673054350..ceaa91df30a 100644 --- a/packages/loot-core/src/types/server-handlers.d.ts +++ b/packages/loot-core/src/types/server-handlers.d.ts @@ -233,7 +233,9 @@ export interface ServerHandlers { 'sync-repair': () => Promise; - 'key-make': (arg: { password }) => Promise; + 'key-make': (arg: { + password; + }) => Promise<{ error?: { reason: string; meta?: unknown } }>; 'key-test': (arg: { fileId; diff --git a/upcoming-release-notes/1755.md b/upcoming-release-notes/1755.md new file mode 100644 index 00000000000..9a27e1ed88c --- /dev/null +++ b/upcoming-release-notes/1755.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MikesGlitch] +--- + +Convert CreateAccount and CreateEncryptionKey components to TypeScript.