mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 18:40:34 -05:00
Move some .d.ts files to .ts (#4862)
* Move loot-core types to `.ts` * Add release notes * PR feedback
This commit is contained in:
committed by
GitHub
parent
94600731d9
commit
92f444f548
@@ -64,7 +64,7 @@ handlers['make-filters-from-conditions'] = async function ({
|
||||
};
|
||||
|
||||
handlers['query'] = async function (query) {
|
||||
if (query.table == null) {
|
||||
if (query['table'] == null) {
|
||||
throw new Error('query has no table, did you forgot to call `.serialize`?');
|
||||
}
|
||||
|
||||
|
||||
@@ -187,5 +187,6 @@ export async function batchUpdateTransactions({
|
||||
return {
|
||||
added: resultAdded,
|
||||
updated: runTransfers ? transfersUpdated : resultUpdated,
|
||||
deleted: allDeleted,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// @ts-strict-ignore
|
||||
import { ImportTransactionsOpts } from '@actual-app/api';
|
||||
|
||||
import type {
|
||||
@@ -7,10 +8,10 @@ import type {
|
||||
APIFileEntity,
|
||||
APIPayeeEntity,
|
||||
} from '../server/api-models';
|
||||
import { BudgetFileHandlers } from '../server/budgetfiles/app';
|
||||
import { type batchUpdateTransactions } from '../server/transactions';
|
||||
|
||||
import type { NewRuleEntity, RuleEntity, TransactionEntity } from './models';
|
||||
import { type ServerHandlers } from './server-handlers';
|
||||
|
||||
export interface ApiHandlers {
|
||||
'api/batch-budget-start': () => Promise<unknown>;
|
||||
@@ -18,7 +19,7 @@ export interface ApiHandlers {
|
||||
'api/batch-budget-end': () => Promise<unknown>;
|
||||
|
||||
'api/load-budget': (
|
||||
...args: Parameters<ServerHandlers['load-budget']>
|
||||
...args: Parameters<BudgetFileHandlers['load-budget']>
|
||||
) => Promise<void>;
|
||||
|
||||
'api/download-budget': (arg: {
|
||||
@@ -9,7 +9,7 @@ export type TimeFrame = {
|
||||
|
||||
type AbstractWidget<
|
||||
T extends string,
|
||||
Meta extends Record<string, unknown> = null,
|
||||
Meta extends Record<string, unknown> | null = null,
|
||||
> = {
|
||||
id: string;
|
||||
type: T;
|
||||
@@ -81,7 +81,7 @@ export interface DataEntity {
|
||||
totalTotals: number;
|
||||
}
|
||||
|
||||
type LegendEntity = {
|
||||
export type LegendEntity = {
|
||||
name: string;
|
||||
id: string | null;
|
||||
color: string;
|
||||
@@ -15,7 +15,7 @@ export type SimpleFinAccount = {
|
||||
};
|
||||
|
||||
export interface SimpleFinBatchSyncResponse {
|
||||
[accountId: AccountEntity['account_id']]: BankSyncResponse;
|
||||
[accountId: NonNullable<AccountEntity['account_id']>]: BankSyncResponse;
|
||||
}
|
||||
|
||||
export type SyncServerSimpleFinAccount = {
|
||||
@@ -4,9 +4,9 @@ export type StripNever<T> = {
|
||||
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
||||
};
|
||||
|
||||
export type EverythingButIdOptional<T> = { id: T['id'] } & Partial<
|
||||
Omit<T, 'id'>
|
||||
>;
|
||||
export type EverythingButIdOptional<T extends { id: unknown }> = {
|
||||
id: T['id'];
|
||||
} & Partial<Omit<T, 'id'>>;
|
||||
|
||||
export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
||||
|
||||
6
upcoming-release-notes/4862.md
Normal file
6
upcoming-release-notes/4862.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [jfdoming]
|
||||
---
|
||||
|
||||
Move some .d.ts files to .ts
|
||||
Reference in New Issue
Block a user