Skip to main content

Editor.IPackageRegistry

Class

Interface for package discovery and registration.

Index

Example

// Resolve IPackageRegistry to discover registered package library paths.
const registry = this.pluginSystem.findInterface(
Editor.IPackageRegistry.interfaceId
) as Editor.IPackageRegistry;
if (Editor.isNull(registry)) {
console.log('IPackageRegistry not available');
return;
}

const libraryPaths = registry.getLibraryPaths();
console.log('Library paths count:', libraryPaths.length);
for (const p of libraryPaths) {
console.log(' Library path:', p.toString());
}

Extends

Properties

interfaceId

static interfaceId: InterfaceId

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

Methods

canPullUpdate()

canPullUpdate(asset): boolean

Return whether a newer version of the asset can be pulled from the library.

Parameters

ParameterType
assetAsset

Returns

boolean


canPushUpdate()

canPushUpdate(asset): boolean

Return whether the asset has local changes that can be pushed back to the library.

Parameters

ParameterType
assetAsset

Returns

boolean


canRegisterToLibrary()

canRegisterToLibrary(asset): boolean

Return whether the asset is eligible to be registered into the user's local library.

Parameters

ParameterType
assetAsset

Returns

boolean


findLibraryPackageMetadataByName()

findLibraryPackageMetadataByName(name): PackageMetadata

Return the metadata of the library package with the given name, preferring the highest installed version, or undefined if no package matches.

Parameters

ParameterType
namestring

Returns

PackageMetadata


getAllLibraryPackageMetadata()

getAllLibraryPackageMetadata(): PackageMetadata[]

Return the metadata of every package installed in the user's local library.

Returns

PackageMetadata[]


getLibraryPaths()

getLibraryPaths(): Path[]

Return the filesystem paths of all local library paths.

Returns

Path[]


getTypeById()

getTypeById(uid, entityBaseType): string

Return the registered type name for an entity given its UUID and base type.

Parameters

ParameterType
uidUuid
entityBaseTypeEntityBaseType

Returns

string


getTypeByName()

getTypeByName(name, entityBaseType): string

Return the registered type name matching the given name and entity base type.

Parameters

ParameterType
namestring
entityBaseTypeEntityBaseType

Returns

string


getTypeByVersion()

getTypeByVersion(uid, version, entityBaseType): string

Return the registered type name for an entity matching the given UUID, version, and base type.

Parameters

ParameterType
uidUuid
versionVersion
entityBaseTypeEntityBaseType

Returns

string


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


isInLibrary()

isInLibrary(componentId): boolean

Return whether the component with the given UUID is registered in the user's locally installed library.

Parameters

ParameterType
componentIdUuid

Returns

boolean


isInProject()

isInProject(componentId): boolean

Return whether the component with the given UUID is present in the current project.

Parameters

ParameterType
componentIdUuid

Returns

boolean


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


packageMetadata()

packageMetadata(sourcePath): PackageMetadata

Return the package metadata for the package located at the given source path.

Parameters

ParameterType
sourcePathPath

Returns

PackageMetadata


pullUpdate()

pullUpdate(asset): void

Pull the latest version of the asset from its source library.

Parameters

ParameterType
assetAsset

Returns

void


pushUpdate()

pushUpdate(asset, locked): void

Push local changes of the asset back to the library, optionally locking the package.

Parameters

ParameterType
assetAsset
lockedboolean

Returns

void


registerToLibrary()

registerToLibrary(asset): void

Register the asset into the user's local library so it can be reused across projects.

Parameters

ParameterType
assetAsset

Returns

void


selectVersionFromAssetLibrary()

selectVersionFromAssetLibrary(descriptor, asset, resource): void

NEW

Parameters

ParameterType
descriptorNativePackageDescriptor
assetAsset
resourceResource

Returns

void


syncVersions()

syncVersions(): void

Resolve a consistent set of versions for the project's packages and apply it without a confirmation dialog. Logs an error if no consistent set exists and does nothing when packages are already in sync.

Returns

void