mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Fix strict type errors
This commit is contained in:
@@ -855,8 +855,8 @@ async function createCategory({
|
||||
}: {
|
||||
name: CategoryEntity['name'];
|
||||
groupId: CategoryGroupEntity['id'];
|
||||
isIncome: CategoryEntity['is_income'];
|
||||
hidden: CategoryEntity['hidden'];
|
||||
isIncome?: CategoryEntity['is_income'] | undefined;
|
||||
hidden?: CategoryEntity['hidden'] | undefined;
|
||||
}): Promise<CategoryEntity['id']> {
|
||||
if (!groupId) {
|
||||
throw APIError('Creating a category: groupId is required');
|
||||
@@ -958,8 +958,8 @@ async function createCategoryGroup({
|
||||
hidden,
|
||||
}: {
|
||||
name: CategoryGroupEntity['name'];
|
||||
isIncome: CategoryGroupEntity['is_income'];
|
||||
hidden: CategoryGroupEntity['hidden'];
|
||||
isIncome?: CategoryGroupEntity['is_income'] | undefined;
|
||||
hidden?: CategoryGroupEntity['hidden'] | undefined;
|
||||
}): Promise<CategoryGroupEntity['id']> {
|
||||
return await db.insertCategoryGroup({
|
||||
name,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-strict-ignore
|
||||
import { type HandlerFunctions } from '../types/handlers';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type AnyFunction = (...args: any[]) => any;
|
||||
|
||||
export function sequential<T extends HandlerFunctions>(
|
||||
export function sequential<T extends AnyFunction>(
|
||||
fn: T,
|
||||
): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> {
|
||||
const sequenceState: {
|
||||
@@ -47,7 +47,7 @@ export function sequential<T extends HandlerFunctions>(
|
||||
};
|
||||
}
|
||||
|
||||
export function once<T extends HandlerFunctions>(
|
||||
export function once<T extends AnyFunction>(
|
||||
fn: T,
|
||||
): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> | null {
|
||||
let promise: Promise<Awaited<ReturnType<T>>> | null = null;
|
||||
|
||||
Reference in New Issue
Block a user