Refactor IPC handlers to enforce consistent return types and enhance type definitions
- Update return types for IPC handlers in `character.ipc.ts`, `chapter.ipc.ts`, and `location.ipc.ts` for stricter type safety. - Introduce new type definitions for better structure and clarity. - Remove redundant console logs and unnecessary comments for cleaner code.
This commit is contained in:
@@ -2,6 +2,7 @@ import { ipcMain } from 'electron';
|
||||
import { createHandler } from '../database/LocalSystem.js';
|
||||
import Book from '../database/models/Book.js';
|
||||
import type { BookProps, GuideLine, GuideLineAI, Act, Issue, WorldProps } from '../database/models/Book.js';
|
||||
import type { ChapterProps } from '../database/models/Chapter.js';
|
||||
|
||||
interface UpdateBookBasicData {
|
||||
title: string;
|
||||
@@ -34,7 +35,7 @@ interface StoryData {
|
||||
interface UpdateStoryData {
|
||||
bookId: string;
|
||||
acts: Act[];
|
||||
mainChapters: any[]; // ChapterProps[] from your API
|
||||
mainChapters: ChapterProps[];
|
||||
}
|
||||
|
||||
interface CreateBookData {
|
||||
|
||||
Reference in New Issue
Block a user