Editor.IPackageRegistry
ClassInterface for package discovery and registration.
Index
Properties
Methods
- canPullUpdate
- canPushUpdate
- canRegisterToLibrary
- findLibraryPackageMetadataByName
- getAllLibraryPackageMetadata
- getLibraryPaths
- getTypeById
- getTypeByName
- getTypeByVersion
- getTypeName
- isInLibrary
- isInProject
- isOfType
- isSame
- packageMetadata
- pullUpdate
- pushUpdate
- registerToLibrary
- selectVersionFromAssetLibrary
- syncVersions
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
staticinterfaceId: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
| Parameter | Type |
|---|---|
asset | Asset |
Returns
boolean
canPushUpdate()
canPushUpdate(
asset):boolean
Return whether the asset has local changes that can be pushed back to the library.
Parameters
| Parameter | Type |
|---|---|
asset | Asset |
Returns
boolean
canRegisterToLibrary()
canRegisterToLibrary(
asset):boolean
Return whether the asset is eligible to be registered into the user's local library.
Parameters
| Parameter | Type |
|---|---|
asset | Asset |
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
| Parameter | Type |
|---|---|
name | string |
Returns
getAllLibraryPackageMetadata()
getAllLibraryPackageMetadata():
PackageMetadata[]
Return the metadata of every package installed in the user's local library.
Returns
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
| Parameter | Type |
|---|---|
uid | Uuid |
entityBaseType | EntityBaseType |
Returns
string
getTypeByName()
getTypeByName(
name,entityBaseType):string
Return the registered type name matching the given name and entity base type.
Parameters
| Parameter | Type |
|---|---|
name | string |
entityBaseType | EntityBaseType |
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
| Parameter | Type |
|---|---|
uid | Uuid |
version | Version |
entityBaseType | EntityBaseType |
Returns
string
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
isInLibrary()
isInLibrary(
componentId):boolean
Return whether the component with the given UUID is registered in the user's locally installed library.
Parameters
| Parameter | Type |
|---|---|
componentId | Uuid |
Returns
boolean
isInProject()
isInProject(
componentId):boolean
Return whether the component with the given UUID is present in the current project.
Parameters
| Parameter | Type |
|---|---|
componentId | Uuid |
Returns
boolean
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
packageMetadata()
packageMetadata(
sourcePath):PackageMetadata
Return the package metadata for the package located at the given source path.
Parameters
| Parameter | Type |
|---|---|
sourcePath | Path |
Returns
pullUpdate()
pullUpdate(
asset):void
Pull the latest version of the asset from its source library.
Parameters
| Parameter | Type |
|---|---|
asset | Asset |
Returns
void
pushUpdate()
pushUpdate(
asset,locked):void
Push local changes of the asset back to the library, optionally locking the package.
Parameters
| Parameter | Type |
|---|---|
asset | Asset |
locked | boolean |
Returns
void
registerToLibrary()
registerToLibrary(
asset):void
Register the asset into the user's local library so it can be reused across projects.
Parameters
| Parameter | Type |
|---|---|
asset | Asset |
Returns
void
selectVersionFromAssetLibrary()
selectVersionFromAssetLibrary(
descriptor,asset,resource):void
NEW
Parameters
| Parameter | Type |
|---|---|
descriptor | NativePackageDescriptor |
asset | Asset |
resource | Resource |
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