TypeScript Types for editor are sparse.
TypeScript Types for editor are sparse.
I have a license to the Editor component, and I am building some field type plugins and would like to build them in TypeScript, but it looks like many of the types are not exported from @datatables.net/editor
Looking through the package folder, I see the types folder and a bunch of types, but most of them are not exported in types.d.ts
so I can't use them.
For example, I want to use the Field
class as a type. I see it in Field.d.ts
I try to import the type:
import Editor, { Field } from "@datatables.net/editor";
I get this TypeScript error:
Module '"@datatables.net/editor"' has no exported member 'Field'
Would it be possible to get all of the types exported so they can be used? Or maybe there's a way to use them that I am not seeing.
Answers
Hi,
Interesting one, as one of the points of feedback from the survey was that Editor didn't have complete typing. I could really understand that since all the options and API are fully typed. However, I hadn't considered the point you make about using it to create a field type plugin.
This is how it is done internally (this is the
hidden
field type):I can look at making the
IOptions
interface external, certainly. Is there any other you need? TheField
class is available underEditor.Field
from the default import.Allan