#1788·ce

getSelection 可能返回 null,但类型定义没有反映此情况

作者: trrk创建于 2025年9月26日更新于 2025年9月26日

我注意到GetSelection可能在执行中无效返回,但索引.d.ts中的类型定义并没有反映这种可能性.

源代码( 显示可能的无效返回) : https://GitHub.com/jspreadsheet/ce/blob/7668cf06a067476f430b5f10cacda77c989fdd3f/src/utils/selection.js#L672

类型定义(不包括无效类型): https://GitHub.com/jspreadshet/ce/blob/7668cf06a067476f430b5f10cacda77c989fdd3f/dist/index.d.ts#L1720

类型定义应当更新,以显示 getSection可能返回为无效. 例如:

getSelection:()                                                                                                                                                                                                    

内容来源: jspreadsheet/ce