Skip to content

Commit

Permalink
Migrate entrypoint to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Jun 22, 2022
1 parent 142501b commit b4baafd
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions _develop/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const constantPack = new webpack.DefinePlugin({
});

const source = [
'quill.js',
'core.js',
'quill.ts',
'core.ts',
'blots',
'core',
'formats',
Expand Down Expand Up @@ -87,8 +87,8 @@ const baseConfig = {
mode: 'development',
context: path.resolve(__dirname, '..'),
entry: {
'quill.js': ['./quill.js'],
'quill.core.js': ['./core.js'],
'quill.js': ['./quill.ts'],
'quill.core.js': ['./core.ts'],
'quill.core': './assets/core.styl',
'quill.bubble': './assets/bubble.styl',
'quill.snow': './assets/snow.styl',
Expand Down Expand Up @@ -134,7 +134,7 @@ module.exports = env => {
return {
...prodConfig,
mode: 'production',
entry: { 'quill.min.js': './quill.js' },
entry: { 'quill.min.js': './quill.ts' },
devtool: 'source-map',
};
}
Expand Down
File renamed without changes.
8 changes: 6 additions & 2 deletions core/quill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ class Quill {
}

static register(
path: string | BlotConstructor | Parchment.Attributor,
target?: BlotConstructor | Parchment.Attributor,
path:
| string
| BlotConstructor
| Parchment.Attributor
| Record<string, unknown>,
target?: BlotConstructor | Parchment.Attributor | boolean,
overwrite = false,
) {
if (typeof path !== 'string') {
Expand Down
2 changes: 1 addition & 1 deletion modules/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ function normalize(binding) {
return binding;
}

// TODO: Move into quill.js or editor.js
// TODO: Move into quill.ts or editor.ts
function deleteRange({ quill, range }) {
const lines = quill.getLines(range);
let formats = {};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"dist/quill.core.js",
"dist/quill.min.js.map",
"dist/quill.min.js",
"core.js",
"quill.js"
"core.ts",
"quill.ts"
],
"config": {
"ports": {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/unit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */

import Quill from '../quill.js';
import Quill from '../quill.ts';
import CodeBlock, { CodeBlockContainer } from '../formats/code';

import './helpers/unit';
Expand Down

0 comments on commit b4baafd

Please sign in to comment.