The LearnCard Type
What is a LearnCard?
To add better type safety to a project using LearnCards, it is highly recommended you use TypeScript and take advantage of the LearnCard
type.
How to use the LearnCard
type
LearnCard
typeOption 1: Specify a list of plugins
If you know the exact order and number of plugins you have, you can use the LearnCard
type to specify a LearnCard
with those plugins like so:
With this code, CustomLearnCard
will automatically infer all methods and planes implemented by PluginA
, PluginB
, and PluginC
!
Option 2: Specify implemented planes and/or methods
If you don't know the exact order and number of plugins you have, but you know that you would like to specify a LearnCard
that implements certain planes or methods, you can do that like this:
Last updated
Was this helpful?