Editor.Version
ClassVersion information for the editor or plugin.
Index
Example
// Editor.Version is a read-only {major, minor, patch} struct returned
// by editor APIs — most commonly Asset.maxLsVersion (max Lens Studio
// version an Asset Library asset was published for).
//
// It is NOT the same as `LensStudio:App.version` — App.version is a
// plain string ("5.21.0") and reflects the running Lens Studio binary.
// Editor.Version is a structured value attached to assets/metadata.
//
// To *set* a version on a Script Asset, use the sibling class
// Editor.Assets.Version (public ctor):
// scriptAsset.version = new Editor.Assets.Version(1, 2, 3);
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;
const env = new EnvironmentSetting();
env.environment = Environment.Production;
env.space = Space.Public;
const filter = new AssetFilter();
filter.searchText = 'material';
const resp = await provider.assetService.fetchAsync(
new AssetListRequest(env, filter)
);
if (resp.ok && resp.data && resp.data.assets[0]) {
const v = resp.data.assets[0].maxLsVersion; // Editor.Version
console.log(`max LS: ${v.major}.${v.minor}.${v.patch}`);
}
Properties
major
readonlymajor:number
Major version number.
minor
readonlyminor:number
Minor version number.
patch
readonlypatch:number
Patch version number.