-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't access any internal types #11240
Comments
Thank you for the suggestions. We are constantly improving the types definitions. I will report this idea internally and update you once I have any updates. |
Great! For a more detail example, take this function I have written below: const getCells: HandsonTypes.GridSettings["cells"] = (...props) => {
const [x, y] = props;
if (data?.[x]?.[y]) {
const isReadOnly = data[x][y].editable === false;
return {
readOnly: isReadOnly,
};
}
return {};
};
const memData = useMemo(
() => data.map((row) => row.map((cell) => cell.value)),
[]
); I see from the type defs you're exporting the entire namespace, and i'm unsure if there's a way to export the types without the namespace as a flat object, but I think it would be a much nicer experience. Accessing the Firstly, aesthetics. It's not a huge deal, but needing to import the namespace, then dot-access the object I want to use followed by needing to index on that object to retrieve the property type is sort of unintuitive, and frankly doesn't look super nice. I could remap them all to named types at the top of my file, but at that point I'd hope the library would export them as such. Secondly, intellisense. I had no way of knowing how to access these types with clicking through 3 files of type definitions and hoping that my import would work. Generally, if a type is used in the type definition of function or object, I'd expect it to be available as a direct import from the library. in this screenshot we have Anyway, I'm enjoying Handsontable and I understand how type exporting is always something each org has a different opinion on. I just wanted to highlight a couple ways I think the experience of using Handsontable could be made more seamless and simple. |
just wanted to upvote this. I have a project that uses internal type(s) from
|
Thank you for your input. We really appreciate it. I have already added this enhancement to our internal board and will update you as soon as I have any news on the topic. |
Describe the bug
I am unable to type my component properly as I cannot import
CellMeta
,GridSettings
etc from react or base libraries.This is how I've resorted to accessing the types:
I would be great to be able to import
import type { CellMeta } from "handsontable/base"
or"handsontable"
directlyVideo/Screenshots
No response
Provide a link to the demo with the bug reproduction
No response
Handsontable version
14.6.1
Framework version
No response
Your environment
MacOS
The text was updated successfully, but these errors were encountered: