fix: Allow overriding VariableModel via options.plugins. (#9257)

This commit is contained in:
Aaron Dodson
2025-07-30 08:58:30 -07:00
committed by GitHub
parent c661dd1c94
commit 8a578f5ce3
2 changed files with 5 additions and 5 deletions

View File

@@ -119,9 +119,9 @@ export class Type<_T> {
/** @internal */
static PASTER = new Type<IPaster<ICopyData, ICopyable<ICopyData>>>('paster');
static VARIABLE_MODEL = new Type<IVariableModelStatic<IVariableState>>(
'variableModel',
);
static VARIABLE_MODEL = new Type<
IVariableModelStatic<IVariableState> & IVariableModel<IVariableState>
>('variableModel');
static VARIABLE_MAP = new Type<IVariableMap<IVariableModel<IVariableState>>>(
'variableMap',

View File

@@ -255,9 +255,9 @@ export class VariableMap
}
const id = opt_id || idGenerator.genUid();
const type = opt_type || '';
const VariableModel = registry.getObject(
const VariableModel = registry.getClassFromOptions(
registry.Type.VARIABLE_MODEL,
registry.DEFAULT,
this.workspace.options,
true,
);
if (!VariableModel) {