Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
"main": "dist/editorjs.umd.js",
"module": "dist/editorjs.mjs",
"types": "./types/index.d.ts",
"exports": {
".": {
"import": {
"types": "./types/index.d.mts",
"default": "./dist/editorjs.mjs"
},
"require": {
"types": "./types/index.d.ts",
"default": "./dist/editorjs.umd.js"
},
"default": "./dist/editorjs.umd.js"
},
"./package.json": "./package.json",
"./types": "./types/index.d.ts",
"./dist/*": "./dist/*",
"./*": "./*"
},
"keywords": [
"codex editor",
"text editor",
Expand All @@ -17,6 +34,7 @@
"dev": "vite",
"build": "vite build --mode production",
"build:test": "vite build --mode test",
"test:types": "tsc -p test/types/tsconfig.node16.json",
"lint": "eslint src/ --ext .ts && yarn lint:tests",
"lint:errors": "eslint src/ --ext .ts --quiet",
"lint:fix": "eslint src/ --ext .ts --fix",
Expand Down
7 changes: 7 additions & 0 deletions test/types/node16-default-import.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import EditorJS from '@editorjs/editorjs';

const editor = new EditorJS({
holder: 'editor',
});

editor.destroy();
12 changes: 12 additions & 0 deletions test/types/tsconfig.node16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"lib": ["DOM", "ES2022"],
"module": "Node16",
"moduleResolution": "Node16",
"noEmit": true,
"skipLibCheck": true,
"strict": true,
"target": "ES2022"
},
"include": ["node16-default-import.mts"]
}
14 changes: 14 additions & 0 deletions types/index.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type * from './index.js';
export {
BlockAddedMutationType,
BlockChangedMutationType,
BlockMovedMutationType,
BlockRemovedMutationType,
LogLevels,
PopoverEvent,
PopoverItemType,
} from './index.js';

declare const EditorJS: typeof import('./index.js').default;

export default EditorJS;