Migrate Pegasus Electron app to TypeScript with gradual migration infrastructure #142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Establishes TypeScript infrastructure for gradual migration of ~4000 lines of JavaScript. Converts main process and IPC bridge to TypeScript with full type safety while allowing coexistence of JS/TS files.
Infrastructure
allowJs: true,noImplicitAny: false)@types/electronType Definitions (
types.d.ts)Comprehensive type system covering:
ImageInfo,ImageProcessOptions,Color,CropCoordinatesContextMenuOptions,MenuItemConfig,LayerEventPayloadConverted Files
main.ts(372 lines)BrowserWindow,ipcMain,dialog,Menuutils/ipc_bridge.ts(118 lines)(event: IpcMainEvent, ...args: any[]) => voidExample
Migration Path
Remaining 17 files can be migrated incrementally using
TYPESCRIPT_MIGRATION.mdguide. Priority order:Build scripts updated:
npm run compile→npm startOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.