mirror of
https://github.com/codex-team/editor.js
synced 2024-05-17 05:46:46 +02:00
chore(types): a generic type for tool config added (#1517)
* Add a generic type to ToolSettings * Update tool-settings.d.ts Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
parent
78478ace2b
commit
4ddba9208d
|
@ -2,6 +2,7 @@
|
|||
|
||||
### 2.19.2
|
||||
|
||||
- `Improvements` - A generic type for Tool config added [#1516](https://github.com/codex-team/editor.js/issues/1516)
|
||||
- `Improvements` - Remove unused `force` option in `Caret.navigateNext()` and `Caret.navigatePrevious()` [#857](https://github.com/codex-team/editor.js/issues/857#issuecomment-770363438).
|
||||
- `Improvements` - Remove bundles from the repo [#1541](https://github.com/codex-team/editor.js/pull/1541).
|
||||
- `Fix` - Fix BlockManager.setCurrentBlockByChildNode() with multiple Editor.js instances [#1503](https://github.com/codex-team/editor.js/issues/1503).
|
||||
|
|
6
types/tools/tool-settings.d.ts
vendored
6
types/tools/tool-settings.d.ts
vendored
|
@ -18,8 +18,10 @@ export interface ToolboxConfig {
|
|||
|
||||
/**
|
||||
* Object passed to the Tool's constructor by {@link EditorConfig#tools}
|
||||
*
|
||||
* @template Config - the structure describing a config object supported by the tool
|
||||
*/
|
||||
export interface ToolSettings {
|
||||
export interface ToolSettings <Config extends object = any> {
|
||||
|
||||
/**
|
||||
* Tool's class
|
||||
|
@ -29,7 +31,7 @@ export interface ToolSettings {
|
|||
/**
|
||||
* User configuration object that will be passed to the Tool's constructor
|
||||
*/
|
||||
config?: ToolConfig;
|
||||
config?: ToolConfig<Config>;
|
||||
|
||||
/**
|
||||
* Is need to show Inline Toolbar.
|
||||
|
|
Loading…
Reference in a new issue