Skip to content

#10524 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\ketcher.ts file#10616

Open
AlexeyGirin with Copilot wants to merge 6 commits into
masterfrom
copilot/refactor-explicit-implicit-any-cleanup-3fc74430-5289-44ee-b212-b135f2b1c45e
Open

#10524 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\ketcher.ts file#10616
AlexeyGirin with Copilot wants to merge 6 commits into
masterfrom
copilot/refactor-explicit-implicit-any-cleanup-3fc74430-5289-44ee-b212-b135f2b1c45e

Conversation

Copilot AI commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

How the feature works? / How did you fix the issue?

packages/ketcher-core/src/application/ketcher.ts relied on loose settings typing and a few untyped values that weakened the public Ketcher API surface. This change narrows those paths to explicit types and aligns the API consumers in autotests with the stricter contract.

  • Typed Ketcher API settings

    • added exported KetcherApiSettings typing in ketcher.types.ts
    • mapped public API keys to concrete value types instead of leaving them loosely inferred
  • Tightened ketcher.ts settings flow

    • typed the settings getter result around the supported API-exposed keys
    • typed setSettings() against the exported API settings contract
    • replaced untyped intermediate settings payload handling with explicit key/value mapping
  • Removed remaining loose values

    • added explicit typing for previously loose locals such as blobPart
    • changed catch handling to unknown and preserved safe error normalization
  • Aligned editor and consumers

    • refined Editor.options() / Editor.setOptions() signatures in editor.types.ts
    • updated autotest callers to pass correctly typed values and removed obsolete suppression

Example of the tightened API shape:

window.ketcher.setSettings({
  'general.dearomatize-on-load': true,
  bondThickness: 22,
  disableQueryElements: ['Pol', 'CYH', 'CXH'],
});

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

Copilot AI changed the title [WIP] Refactor explicit and implicit any types in ketcher.ts #10524 – Refactor explicit and implicit any cleanup in ketcher core Jul 18, 2026
Copilot AI requested a review from AlexeyGirin July 18, 2026 19:03
…plicit-implicit-any-cleanup-3fc74430-5289-44ee-b212-b135f2b1c45e
@AlexeyGirin
AlexeyGirin marked this pull request as ready for review July 18, 2026 20:31
@AlexeyGirin AlexeyGirin changed the title #10524 – Refactor explicit and implicit any cleanup in ketcher core #10524 - Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\ketcher.ts file Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Explicit/implicit Any type clean up from packages\ketcher-core\src\application\ketcher.ts file

2 participants