cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

[Bug report] The API does not have type constraints for functions.

Open RSS1102 opened this issue 2 years ago • 0 comments

Describe the bug

  1. toolbar.toolbarHandlers.list(type:string) and toolbar.toolbarHandlers.graph(type:string). Both can accept string or number. However, in the source code, type is passed in as a type array index, can it only be number. 1694181627525

  2. The APIs does not have type constraints for functions. image

Reproduction

https://github.com/RSS1102/cherry-markdown-react-demo/blob/main/src/apis/toolbarHandlersApi.tsx#L17C1-L17C1

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 2.60 GB / 13.86 GB
  Binaries:
    Node: 18.12.1 - E:\node\node.EXE
    Yarn: 1.22.19 - E:\node\yarn.CMD
    npm: 9.8.0 - E:\node\npm.CMD
    pnpm: 8.6.9 - E:\node\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.2215.0), Chromium (116.0.1938.69)
    Internet Explorer: 11.0.22621.1

Validations

  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Help us

Yes, I would like to try submitting a PR for this issue.

RSS1102 avatar Sep 08 '23 14:09 RSS1102