Overview
What @sdeck/plugin exports, at a glance.
Everything a plugin needs comes from @sdeck/plugin, and the helpers for looks from @sdeck/schema.
Your editor shows the types and what each of them is for; these pages are the overview.
| Export | What it is for |
|---|---|
createPlugin | Makes a plugin and its parts |
setting | The fields of a form |
Permissions, PermissionError | What a plugin asks to do |
Shared, following, useShared | Several live values from one connection |
ManagedConnection, PermanentError | A connection that looks after itself |
onSettingsChange | Acts on changed settings |
OAuthError | What a failed sign-in throws |
layoutText, fitText | Text that fits, for overlays |
formatDate, formatDuration, formatNumber | The formats of expressions, in code |
usePress, useHold, useHostState and other hooks | For actions that draw themselves |
createPlugin
| Field | |
|---|---|
id | The package's name |
name, version | Shown to users; the version matches package.json |
description | |
namespace | Prefix of live values and events. By default the name without sdeck-plugin- |
permissions | Everything it may ask for |
settings | The plugin's own settings |
The builder it returns has action, state, trigger, source, command and link, the running
plugin's context, its overlays, and define, which takes the parts plus onboarding and
activate.
API versions
apiVersion in package.json says what a plugin needs. Each version only adds to the one before.