Skip to main content

LensStudio:PluginVerifier.PluginVerifier

Class

Base class for plugin verifiers; extend this to implement a verify() method that tests plugin functionality against the editor.

Index

Example

// PluginVerifier is the base class for plugins that verify other plugins'
// output before export or publishing.
//
// Key members:
// verify(pluginDescriptor: IPluginDescriptor, outputDir: Editor.Path): Promise<void>
// Called by the framework when a matching plugin is exported.
// Throw an error to fail the export with a message.
// pluginSystem (readonly) — resolves interface dependencies.

export class PluginVerifierClassExampleVerifier extends PluginVerifier {
connections: any[];
static descriptor() {
const d = new Descriptor();
d.id = 'com.docs.PluginVerifierClassExample';
d.name = 'Plugin Verifier Class Example';
d.description = 'Demonstrates PluginVerifier with verify() override';
d.canVerify = (desc: any) => {
return true;
};
return d;
}
constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
super(pluginSystem, descriptor);
this.connections = [];
}
async verify(pluginDescriptor: any, outputDir: Editor.Path): Promise<void> {
console.log(`Running verification for: ${pluginDescriptor.id}`);
console.log(`Checking output at: ${outputDir}`);
// Throw to fail the export:
// throw new Error('Verification failed: missing required file');
}
}

Extends

Constructors

Constructor

new PluginVerifier(pluginSystem, descriptor?): PluginVerifier

Constructs a PluginVerifier instance bound to the given plugin system and optional descriptor.

Parameters

ParameterType
pluginSystemPluginSystem
descriptor?Descriptor

Returns

PluginVerifier

Overrides

Editor.IPlugin.constructor

Properties

id

readonly id: string

Unique string identifier of the plugin instance.

Inherited from

IPlugin.id


pluginSystem

readonly pluginSystem: PluginSystem

The plugin system instance this verifier operates within.

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IPlugin.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IPlugin.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

IPlugin.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

IPlugin.isSame


verify()

verify(pluginDescriptor, outputDir): Promise<void>

Runs verification tests against a plugin descriptor and writes output artifacts to the specified directory.

Parameters

ParameterType
pluginDescriptorIPluginDescriptor
outputDirPath

Returns

Promise<void>