#10546 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-react\src\script\editor\tool\bond.ts file#10604
Open
AlexeyGirin with Copilot wants to merge 6 commits into
Conversation
…ertions in bond.ts
Copilot
AI
changed the title
[WIP] Refactor explicit/implicit any type in bond.ts
#10546 – Refactor: Explicit/implicit Any type clean up from bond.ts
Jul 18, 2026
…plicit-implicit-any-cleanup-34b08964-2737-483f-9710-a2d8d31c0c49
AlexeyGirin
marked this pull request as ready for review
July 18, 2026 20:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes all explicit and implicit
anytypes frompackages/ketcher-react/src/script/editor/tool/bond.ts, replacing them with precise TypeScript types.How the feature works? / How did you fix the issue?
New types file
bond.types.ts:BondItemRef—{ map: string; id: number }for item referencesBondToolDragContext— typed drag state (replacesdragCtx: any)BondActionParams— parameters forapplyBondActionbond.tschanges:bondProps: any→Partial<BondAttributes>dragCtx: any→dragCtx?: BondToolDragContextPointerEvent; all private method parameters fully typedBondAttributes,AtomAttributes,Render,Pool,SGroup,FunctionalGroup,Bondfromketcher-core!non-null assertions with proper guards and narrowing:resolveAtomDragTargetnow acceptsitem: BondItemRefdirectly (caller narrows viadragCtx.item?.map === 'atoms'guard)restoreBondWhenHoveringOnCanvassplit into sequential guards so TypeScript narrowsexistedBond,item, andactionwithout assertionsresolveEndAtomPositionhastypeof beginAtom !== 'number'type guard and null check foratombefore property accessAlso fixed: pre-existing unused import (
takeElementScreenshot) inketcher-autotests/tests/specs/Bugs/ketcher-2.28.0-bugs.spec.tsthat was blocking the pre-push hook.Check list
#1234 – issue name