Skip to content
Snippets Groups Projects
Unverified Commit 2178da04 authored by DJ Mountney's avatar DJ Mountney Committed by GitHub
Browse files

Fix some additional incorrect types (#2676)

* Fix some additional incorrect types

- This is part of working towards having enough correct types to be able to run tsc on our packed api without error.
- Working towards being able to ship types for the api in the package

* Add release note
parent f8809df5
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ export function ThemeSelector({ style }: ThemeSelectorProps) { ...@@ -26,6 +26,7 @@ export function ThemeSelector({ style }: ThemeSelectorProps) {
dark: SvgMoonStars, dark: SvgMoonStars,
auto: SvgSystem, auto: SvgSystem,
midnight: SvgMoonStars, midnight: SvgMoonStars,
development: SvgMoonStars,
} as const; } as const;
function onMenuSelect(newTheme: Theme) { function onMenuSelect(newTheme: Theme) {
......
...@@ -33,7 +33,11 @@ export function useTheme() { ...@@ -33,7 +33,11 @@ export function useTheme() {
export function ThemeStyle() { export function ThemeStyle() {
const [theme] = useTheme(); const [theme] = useTheme();
const [themeColors, setThemeColors] = useState< const [themeColors, setThemeColors] = useState<
typeof lightTheme | typeof darkTheme | typeof midnightTheme | undefined | typeof lightTheme
| typeof darkTheme
| typeof midnightTheme
| typeof developmentTheme
| undefined
>(undefined); >(undefined);
useEffect(() => { useEffect(() => {
......
...@@ -2,6 +2,7 @@ export type * from './account'; ...@@ -2,6 +2,7 @@ export type * from './account';
export type * from './category'; export type * from './category';
export type * from './category-group'; export type * from './category-group';
export type * from './gocardless'; export type * from './gocardless';
export type * from './simplefin';
export type * from './note'; export type * from './note';
export type * from './payee'; export type * from './payee';
export type * from './reports'; export type * from './reports';
......
...@@ -26,7 +26,11 @@ export interface NewTransactionEntity { ...@@ -26,7 +26,11 @@ export interface NewTransactionEntity {
subtransactions?: Omit<NewTransactionEntity, 'account' | 'date'>[]; subtransactions?: Omit<NewTransactionEntity, 'account' | 'date'>[];
} }
export interface TransactionEntity extends NewTransactionEntity { export interface TransactionEntity
extends Omit<
NewTransactionEntity,
'account' | 'category' | 'payee' | 'schedule' | 'subtransactions'
> {
id: string; id: string;
account: AccountEntity; account: AccountEntity;
category?: CategoryEntity; category?: CategoryEntity;
......
...@@ -58,10 +58,12 @@ export type LocalPrefs = Partial< ...@@ -58,10 +58,12 @@ export type LocalPrefs = Partial<
} & Record<`flags.${FeatureFlag}`, boolean> } & Record<`flags.${FeatureFlag}`, boolean>
>; >;
export type Theme = 'light' | 'dark' | 'auto' | 'midnight'; export type Theme = 'light' | 'dark' | 'auto' | 'midnight' | 'development';
export type GlobalPrefs = Partial<{ export type GlobalPrefs = Partial<{
floatingSidebar: boolean; floatingSidebar: boolean;
maxMonths: number; maxMonths: number;
autoUpdate: boolean;
keyId?: string;
theme: Theme; theme: Theme;
documentDir: string; // Electron only documentDir: string; // Electron only
}>; }>;
import { GlobalPrefs, LocalPrefs } from '../client/state-types/prefs';
import { ParseFileResult } from '../server/accounts/parse-file'; import { ParseFileResult } from '../server/accounts/parse-file';
import { batchUpdateTransactions } from '../server/accounts/transactions'; import { batchUpdateTransactions } from '../server/accounts/transactions';
import { Backup } from '../server/backups'; import { Backup } from '../server/backups';
...@@ -17,6 +16,7 @@ import { ...@@ -17,6 +16,7 @@ import {
SimpleFinAccount, SimpleFinAccount,
PayeeEntity, PayeeEntity,
} from './models'; } from './models';
import { GlobalPrefs, LocalPrefs } from './prefs';
import { EmptyObject } from './util'; import { EmptyObject } from './util';
export interface ServerHandlers { export interface ServerHandlers {
......
---
category: Maintenance
authors: [twk3]
---
Fix some type errors found by the API packaging
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment