Improve TypeScript types and error handling
- Created proper TypeScript types for Office API operations - Replaced 'any' casts with appropriate types - Added type-safe utility functions in office-types.ts - Improved error handling with proper unknown type - Added helper functions for PowerPoint shape operations - Created proper TypeScript interface for webpack HMR These changes improve code quality, maintainability, and help catch potential bugs at compile time rather than runtime. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+15
-3
@@ -19,9 +19,21 @@ Office.onReady(() => {
|
||||
);
|
||||
});
|
||||
|
||||
if ((module as any).hot) {
|
||||
(module as any).hot.accept("./components/App", () => {
|
||||
// Define proper module hot interface for webpack hot module replacement
|
||||
interface HotModule extends NodeModule {
|
||||
hot?: {
|
||||
accept(path: string, callback: () => void): void;
|
||||
};
|
||||
}
|
||||
|
||||
// Use the proper type for module with HMR
|
||||
if ((module as HotModule).hot) {
|
||||
(module as HotModule).hot?.accept("./components/App", () => {
|
||||
const NextApp = require("./components/App").default;
|
||||
root?.render(NextApp);
|
||||
root?.render(
|
||||
<FluentProvider theme={webLightTheme}>
|
||||
<NextApp title={title} />
|
||||
</FluentProvider>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user