
Parsifly Docs
ExtensionBase
Documentation for ExtensionBase (128)
parsifly-extension-base / index / ExtensionBase
Abstract Class: ExtensionBase
Defined in: lib/ExtensionBase.ts:17
Constructors
Constructor
new ExtensionBase():
ExtensionBase
Defined in: lib/ExtensionBase.ts:25
Returns
ExtensionBase
Properties
application
readonlyapplication:object
Defined in: lib/ExtensionBase.ts:49
commands
readonlycommands:object
commands.callCustomCommand()
readonlycallCustomCommand: <GParam,GReturn>(key, ...args) =>Promise<GReturn>
Allow you to call a custom command from application
Type Parameters
GParam
GParam = unknown
GReturn
GReturn = unknown
Parameters
key
string
Name of the command
args
...GParam[]
List of arguments to be forwarded to the command call
Returns
Promise<GReturn>
commands.downloadFile()
readonlydownloadFile: (fileName,fileType,fileContent) =>Promise<void>
Allow you to download some content in a file
Parameters
fileName
string
Name of the generated file
fileType
string
extension of the file
fileContent
string
file content in string
Returns
Promise<void>
commands.downloadFiles()
readonlydownloadFiles: (downloadName,files) =>Promise<void>
Allow you to download a lot of files and folders as zip
Parameters
downloadName
string
Name of the download as zip
files
List of files or folders to download
Returns
Promise<void>
commands.editor
readonlyeditor:object
Grouped methods to editor configuration
commands.editor.feedback()
readonlyfeedback: (message,type) =>Promise<void>
Allow to show some feedback to the platform user
Parameters
message
string
Message of the feedback
type
type of the feedback
"warning" | "success" | "error" | "info"
Returns
Promise<void>
commands.editor.showPrimarySideBarByKey()
readonlyshowPrimarySideBarByKey: (key) =>Promise<void>
Allow to set primary side bar view by key
Parameters
key
string
Key to identify the view to show in the side bar
Returns
Promise<void>
commands.editor.showQuickPick()
readonlyshowQuickPick: (props) =>Promise<string|void>
Allow to capture user freeform text input
Parameters
props
Props to configure the quick pick
Returns
Promise<string | void>
commands.editor.showSecondarySideBarByKey()
readonlyshowSecondarySideBarByKey: (key) =>Promise<void>
Allow to set secondary side bar view by key
Parameters
key
string
Key to identify the view to show in the side bar
Returns
Promise<void>
dataProviders
readonlydataProviders:object
dataProviders.project()
project: () =>
IDoc<IProject<TProjectType>>
Gets a reference to a root Document (Singleton or starting point).
Returns
Example
provider.project<IProject>().value()
edition
readonlyedition:object
edition.close()
readonlyclose: (key) =>Promise<void>
Allow you to close a item if it is opened in the editor
Parameters
key
string
Identifier of a item to be closed
Returns
Promise<void>
edition.get()
readonlyget: () =>Promise<string[]>
Returns a list of selected items in the platform
Returns
Promise<string[]>
List of selected items
edition.open()
readonlyopen: (key) =>Promise<void>
Allow you to open a item in a editor based on the item type
Parameters
key
string
Identifier of a item to be opened for some editor
Returns
Promise<void>
edition.subscribe()
readonlysubscribe: (listener) => () =>void
Subscribe to edition item key change
Parameters
listener
(key) => Promise<void>
Returns
Unsubscribe function
():
void
Returns
void
editors
readonlyeditors:object
editors.register()
readonlyregister: (view) =>void
Parameters
view
Returns
void
editors.unregister()
readonlyunregister: (view) =>void
Parameters
view
Returns
void
fields
readonlyfields:object
fields.get()
readonlyget: (key) =>Promise<FieldDescriptor[]>
Returns a list of fields
Parameters
key
string
Resource key to be refreshed
Returns
List of fields
fields.refresh()
readonlyrefresh: (key) =>Promise<void>
Request the platform to get again all fields for this resource
Parameters
key
string
Resource key to be refreshed
Returns
Promise<void>
fields.register()
readonlyregister: (fields) =>void
Register a fields descriptor to platform. Make sure that key is at the manifest.json
Parameters
fields
Descriptor to be registered
Returns
void
fields.subscribe()
readonlysubscribe: (key,listener) => () =>void
Subscribe to form fields
Parameters
key
string
listener
(fields) => Promise<void>
Returns
Unsubscribe function
():
void
Returns
void
fields.unregister()
readonlyunregister: (fields) =>void
Unregister the descriptor
Parameters
fields
Descriptor to be unregistered
Returns
void
parsers
readonlyparsers:object
parsers.register()
readonlyregister: (parser) =>void
Parameters
parser
Returns
void
parsers.unregister()
readonlyunregister: (parser) =>void
Parameters
parser
Returns
void
platformActions
readonlyplatformActions:object
platformActions.register()
readonlyregister: (platformAction) =>void
Parameters
platformAction
Returns
void
platformActions.unregister()
readonlyunregister: (platformAction) =>void
Parameters
platformAction
Returns
void
selection
readonlyselection:object
selection.get()
readonlyget: () =>Promise<string[]>
Returns a list of selected items in the platform
Returns
Promise<string[]>
List of selected items
selection.select()
readonlyselect: (key) =>Promise<void>
Allow you to select a item
Parameters
key
string
Identifier of a item to be selected
Returns
Promise<void>
selection.subscribe()
readonlysubscribe: (listener) => () =>void
Subscribe to selection item key change
Parameters
listener
(key) => Promise<void>
Returns
Unsubscribe function
():
void
Returns
void
selection.unselect()
readonlyunselect: (key) =>Promise<void>
Allow you to unselect a item
Parameters
key
string
Identifier of a item to be unselected
Returns
Promise<void>
views
readonlyviews:object
views.refresh()
readonlyrefresh: (view) =>Promise<void>
Parameters
view
Returns
Promise<void>
views.register()
readonlyregister: (view) =>void
Parameters
view
Returns
void
views.unregister()
readonlyunregister: (view) =>void
Parameters
view
Returns
void
Methods
activate()
activate():
Promise<void>
Defined in: lib/ExtensionBase.ts:38
Automatically called when the extension start.
Returns
Promise<void>
deactivate()
deactivate():
Promise<void>
Defined in: lib/ExtensionBase.ts:45
Automatically called when the extension stop.
Returns
Promise<void>