The Plugin Type
What is a plugin?
Last updated
Was this helpful?
What is a plugin?
Last updated
Was this helpful?
If you're creating a plugin, it is highly recommended you use TypeScript and take advantage of the Plugin
type.
Plugin
TypeThe Plugin
type is a type, taking in up to five total generic parameters. A Plugin using all five parameters would look like this:
This type describes a plugin named 'Complex'
that implements the , as well as the method foo
. This plugin is also on plugins that implement the Control Plane, as well as the method bar.
Let's break down what each of these arguments are doing one at a time.
This argument simply names a plugin. It is a required string, and is used by some Control Planes.
Specifying a name will force objects that have been set to this type to use that name!
any
or never
, which specifies that this plugin does not implement any Control Planes
A single string (such as used in the example above), which specifies that this plugin implements a single Control Plane
This argument defaults to any
, specifying that this plugin does not implement any Control Planes.
Specifying one or more Control Planes implemented will force objects that have been set to this type to implement those planes!
This argument defaults to Record<never, never>
, specifying that this plugin does not implement any methods.
Specifying methods implemented will force objects that have been set to this type to implement those methods!
any
or never
, which specifies that this plugin does not depend on any Control Planes
A single string (such as used in the example above), which specifies that this plugin depends on a single Control Plane
This argument defaults to never
, specifying that this plugin does not depend on any Control Planes.
This argument defaults to Record<never, never>
, specifying that this plugin does not depend on any methods.
This argument specifies which the plugin implements. It can be:
A of strings (e.g. 'store' | 'read'
), which specifies that this plugin implements multiple Control Planes
This argument specifies which the plugin implements. It is an object whose values are functions.
This argument specifies which the plugin depends on. It can be:
A of strings (e.g. 'store' | 'read'
), which specifies that this plugin depends on multiple Control Planes
Specifying one or more Dependent Control Planes will add those planes to the passed into each plugin method!
Specifying Dependent Planes here will not force LearnCards to implement those planes when adding this plugin! Please see for more information.
This argument specifies which the plugin depends on. It is an object whose values are functions.
Specifying dependent methods will add those methods to the passed into each plugin method!
Specifying Dependent Methods here will not force LearnCards
to implement those methods when adding this plugin! Please see for more information.