Skip to content

Commit

Permalink
Fix type library configuration (#217)
Browse files Browse the repository at this point in the history
* Fix main_types import/export

* Update typelib package
  • Loading branch information
huchenlei authored Nov 10, 2024
1 parent aadf01d commit edbdaf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions scripts/prepareTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ const mainPackage = require('../package.json');
const typesPackage = {
name: `${mainPackage.name}-types`,
version: mainPackage.version,
main: './index.mjs',
types: './index.d.ts',
exports: {
'.': {
types: './index.d.ts'
}
},
files: [
'index.d.ts'
'index.d.ts',
'index.mjs'
],
publishConfig: {
access: 'public'
Expand Down
8 changes: 3 additions & 5 deletions src/main_types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export * from './constants';
export * from './preload';
import { ElectronAPI } from './preload';
export type { ElectronAPI } from './preload';

import { ElectronAPI } from './preload';
declare global {
interface Window {
electronAPI: ElectronAPI;
}
const electronAPI: ElectronAPI;
}

0 comments on commit edbdaf2

Please sign in to comment.