refactor(type)!: use explicit parameters in all functions#616
refactor(type)!: use explicit parameters in all functions#616
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
|
||
| // Invokes the function on the editor using the args | ||
| action.apply(this, args); | ||
| action(this, cell, evt); |
There was a problem hiding this comment.
question: check if removing the binding to this may not introduce regression.
We probably should revert this change as it is out of the scope of this PR.
| return (<Editor>this.editor).graph.cloneCell(ptype); | ||
| } | ||
| return null; | ||
| return (<Editor>this.editor).graph.cloneCell(ptype); |
There was a problem hiding this comment.
question: check if this simplification doesn't introduce regression.
We should revert it, as it is out of the scope of this PR
ab8db8d to
f8c0ee5
Compare
f8c0ee5 to
fbc885b
Compare
|
| */ | ||
| send( | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type -- require a generic function type | ||
| onload: Function | null = null, |
There was a problem hiding this comment.
"Onload" specific signature can be inferred because it is used in this method .
This applies to onLoad parameters of all methods and functions of this file.
… for parameters Editor.ts: fix unprecised function usage
… of the API) Used as parameter of Editor.addAction
|
|
|
||
| // Invokes the function on the editor using the args | ||
| action.apply(this, args); | ||
| action(this, cell, evt); |
There was a problem hiding this comment.
We may have changed the behavior here by removing the binding to this.
To be reviewed.
Otherwise keep the former implementation
| import type { AbstractGraph } from '../view/AbstractGraph'; | ||
| import EventObject from '../view/event/EventObject'; | ||
| import type { DropHandler } from '../view/other/DragSource'; | ||
| import { EventListenerFunction } from '../types'; |
| ): MarkerFunction | null; | ||
| } | ||
|
|
||
| // TODO rename to EventListener? |
There was a problem hiding this comment.
Keep the name and remove todo
| eventObject: EventObject | ||
| ) => void; | ||
|
|
||
| // TODO rename to EditorAction? |
There was a problem hiding this comment.
Keep the name and remove todo
| import { applyGraphMixins } from './mixins/_graph-mixins-apply'; | ||
| import { isNullish } from '../internal/utils'; | ||
| import { isI18nEnabled } from '../internal/i18n-utils'; | ||
| import AbstractCanvas2D from './canvas/AbstractCanvas2D'; |
|
|
||
| import GraphHierarchyNode from '../datatypes/GraphHierarchyNode'; | ||
| import GraphHierarchyEdge from '../datatypes/GraphHierarchyEdge'; | ||
| import GraphAbstractHierarchyCell from '../datatypes/GraphAbstractHierarchyCell'; |
| addEdge('images/entity.gif', 50, 50, {}); | ||
| addToolbarLine(); | ||
|
|
||
| const selectFunction: (evt: MouseEvent, cell: Cell | null) => void = () => { |
There was a problem hiding this comment.
question: why are we introducing this and why is it used instead of func in 2 locations here?



DISCLAIMER: this is a work in progress and subject to force push
This mainly implies using specific signature for functions instead of using the generic "Function" type.
BREAKING CHANGES: TODO
Tasks
This PR initially tried to bump all eslint plugins and to fix all eslint errors/warnings. As this was a too large task, it has been split: