LensStudio:PluginVerifier.PluginVerifier
ClassBase class for plugin verifiers; extend this to implement a verify() method that tests plugin functionality against the editor.
Index
Properties
Methods
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
| Parameter | Type |
|---|---|
pluginSystem | PluginSystem |
descriptor? | Descriptor |
Returns
PluginVerifier
Overrides
Editor.IPlugin.constructor
Properties
id
readonlyid:string
Unique string identifier of the plugin instance.
Inherited from
pluginSystem
readonlypluginSystem:PluginSystem
The plugin system instance this verifier operates within.
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
verify()
verify(
pluginDescriptor,outputDir):Promise<void>
Runs verification tests against a plugin descriptor and writes output artifacts to the specified directory.
Parameters
| Parameter | Type |
|---|---|
pluginDescriptor | IPluginDescriptor |
outputDir | Path |
Returns
Promise<void>