Skip to main content

Editor.IPackageActions

Class

Interface for package-level actions.

Index

Example

// Resolve IPackageActions to access package and script export functionality.
const actions = this.pluginSystem.findInterface(
Editor.IPackageActions.interfaceId
) as Editor.IPackageActions;
if (Editor.isNull(actions)) {
console.log('IPackageActions not available');
return;
}
console.log('IPackageActions resolved successfully');
// actions.exportPackage(descriptor, path, exportOptions) exports a native package
// actions.exportScript(scriptAsset, path, exportOptions) exports a script asset

Extends

Properties

interfaceId

static interfaceId: InterfaceId

Static interface ID for resolving the package actions component via the plugin system.

Methods

createCustomComponent()

createCustomComponent(scriptAsset): AssetImportMetadata

Turn a script asset into an unpacked custom component in place by creating a package descriptor beside it with the script as its instantiable. Returns the descriptor's import metadata.

Parameters

ParameterType
scriptAssetScriptAsset

Returns

AssetImportMetadata


exportAsZip()

exportAsZip(exportPath, exportOptions, includeCache): void

Export the current project as a zip archive at the given path with the provided export options.

Parameters

ParameterType
exportPathPath
exportOptionsExportOptions
includeCacheboolean

Returns

void


exportPackage()

exportPackage(nativePackageDescriptor, path, exportOptions): void

Export a native package described by the descriptor to the given path with the provided export options.

Parameters

ParameterType
nativePackageDescriptorNativePackageDescriptor
pathPath
exportOptionsExportOptions

Returns

void


exportScript()

exportScript(scriptAsset, path, exportOptions): void

Export a script asset as a standalone package to the given path with the provided export options.

Parameters

ParameterType
scriptAssetScriptAsset
pathPath
exportOptionsExportOptions

Returns

void


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IPluginComponent.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IPluginComponent.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

IPluginComponent.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

IPluginComponent.isSame