Parsifly logo

Parsifly Docs

API Reference

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

readonly application: object

Defined in: lib/ExtensionBase.ts:49

commands

readonly commands: object

commands.callCustomCommand()

readonly callCustomCommand: <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()

readonly downloadFile: (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()

readonly downloadFiles: (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

TFileOrFolder[]

List of files or folders to download

Returns

Promise<void>

commands.editor

readonly editor: object

Grouped methods to editor configuration

commands.editor.feedback()

readonly feedback: (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()

readonly showPrimarySideBarByKey: (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()

readonly showQuickPick: (props) => Promise<string | void>

Allow to capture user freeform text input

Parameters
props

TQuickPick

Props to configure the quick pick

Returns

Promise<string | void>

commands.editor.showSecondarySideBarByKey()

readonly showSecondarySideBarByKey: (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

readonly dataProviders: object

dataProviders.project()

project: () => IDoc<IProject<TProjectType>>

Gets a reference to a root Document (Singleton or starting point).

Returns

IDoc<IProject<TProjectType>>

Example
provider.project<IProject>().value()

edition

readonly edition: object

edition.close()

readonly close: (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()

readonly get: () => Promise<string[]>

Returns a list of selected items in the platform

Returns

Promise<string[]>

List of selected items

edition.open()

readonly open: (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()

readonly subscribe: (listener) => () => void

Subscribe to edition item key change

Parameters
listener

(key) => Promise<void>

Returns

Unsubscribe function

(): void

Returns

void

editors

readonly editors: object

editors.register()

readonly register: (view) => void

Parameters
view

Editor

Returns

void

editors.unregister()

readonly unregister: (view) => void

Parameters
view

Editor

Returns

void

fields

readonly fields: object

fields.get()

readonly get: (key) => Promise<FieldDescriptor[]>

Returns a list of fields

Parameters
key

string

Resource key to be refreshed

Returns

Promise<FieldDescriptor[]>

List of fields

fields.refresh()

readonly refresh: (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()

readonly register: (fields) => void

Register a fields descriptor to platform. Make sure that key is at the manifest.json

Parameters
fields

FieldsDescriptor

Descriptor to be registered

Returns

void

fields.subscribe()

readonly subscribe: (key, listener) => () => void

Subscribe to form fields

Parameters
key

string

listener

(fields) => Promise<void>

Returns

Unsubscribe function

(): void

Returns

void

fields.unregister()

readonly unregister: (fields) => void

Unregister the descriptor

Parameters
fields

FieldsDescriptor

Descriptor to be unregistered

Returns

void

parsers

readonly parsers: object

parsers.register()

readonly register: (parser) => void

Parameters
parser

Parser

Returns

void

parsers.unregister()

readonly unregister: (parser) => void

Parameters
parser

Parser

Returns

void

platformActions

readonly platformActions: object

platformActions.register()

readonly register: (platformAction) => void

Parameters
platformAction

PlatformAction

Returns

void

platformActions.unregister()

readonly unregister: (platformAction) => void

Parameters
platformAction

PlatformAction

Returns

void

selection

readonly selection: object

selection.get()

readonly get: () => Promise<string[]>

Returns a list of selected items in the platform

Returns

Promise<string[]>

List of selected items

selection.select()

readonly select: (key) => Promise<void>

Allow you to select a item

Parameters
key

string

Identifier of a item to be selected

Returns

Promise<void>

selection.subscribe()

readonly subscribe: (listener) => () => void

Subscribe to selection item key change

Parameters
listener

(key) => Promise<void>

Returns

Unsubscribe function

(): void

Returns

void

selection.unselect()

readonly unselect: (key) => Promise<void>

Allow you to unselect a item

Parameters
key

string

Identifier of a item to be unselected

Returns

Promise<void>

views

readonly views: object

views.refresh()

readonly refresh: (view) => Promise<void>

Parameters
view

TabsView | View

Returns

Promise<void>

views.register()

readonly register: (view) => void

Parameters
view

TabsView | View

Returns

void

views.unregister()

readonly unregister: (view) => void

Parameters
view

TabsView | 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>