Editor.IPackageActions
ClassInterface for package-level actions.
Index
Properties
Methods
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
staticinterfaceId: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
| Parameter | Type |
|---|---|
scriptAsset | ScriptAsset |
Returns
exportAsZip()
exportAsZip(
exportPath,exportOptions,includeCache):void
Export the current project as a zip archive at the given path with the provided export options.
Parameters
| Parameter | Type |
|---|---|
exportPath | Path |
exportOptions | ExportOptions |
includeCache | boolean |
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
| Parameter | Type |
|---|---|
nativePackageDescriptor | NativePackageDescriptor |
path | Path |
exportOptions | ExportOptions |
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
| Parameter | Type |
|---|---|
scriptAsset | ScriptAsset |
path | Path |
exportOptions | ExportOptions |
Returns
void
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