Mutation API
Methods for locally mutating the token tree.
You access each of the mutation methods over:
sdtfEngine.mutation.[method]
addToken
addToken
Add a new token to the token tree.
function addToken(param:{
parentPath: Array<string>,
name: string,
tokenProperties: {
$type: string;
$value: unknown;
$description?: string;
$extensions?: Record<string, unknown>;
},
}): void;
renameToken
renameToken
Rename a token.
function renameToken(param: { atPath: Array<string>; name: string }): void;
updateTokenDescription
updateTokenDescription
Update the description of a token.
function updateTokenDescription(param: {
atPath: Array<string>;
description: string;
}): void;
updateTokenExtensions
updateTokenExtensions
Update the extensions of a token.
function updateTokenExtensions(param: {
atPath: Array<string>;
extensions: treeNodeExtensionsSchema;
}): void;
updateTokenValue
updateTokenValue
Update the value of a token.
function updateTokenValue(param:{
atPath: Array<string>,
// We cannot know with type of the value since no type is enforced
value: unknown,
}): void;
updateTokenModeValue
updateTokenModeValue
Update the value of a token for a given mode.
function updateTokenModeValue(param:{
mode: string,
// We cannot know with type of the value since no type is enforced
value: unknown,
}): void;
renameTokenMode
renameTokenMode
Rename a token mode.
function renameTokenMode(param: {
atPath: Array<string>;
fromMode: string;
toMode: string;
}): void;
createTokenModeValue
createTokenModeValue
Create a new token mode value.
function createTokenModeValue(param:{
atPath: Array<string>,
mode: string,
// We cannot know with type of the value since no type is enforced
value: unknown,
}): void;
deleteTokenModeValue
deleteTokenModeValue
Delete a token mode value.
function deleteTokenModeValue(param: {
atPath: Array<string>;
mode: string;
}): void;
deleteToken
deleteToken
Delete a token.
function deleteToken(param: { atPath: Array<string> }): void;
moveToken
moveToken
Move a token.
function moveToken(param: {
atPath: Array<string>;
toPath: Array<string>;
}): void;
addCollection
addCollection
Add a new collection to the token tree.
function addCollection(param: {
parentPath: Array<string>;
name: string;
collectionProperties: {
$collection: {$modes: Array<string>};
$description?: string;
$extensions?: Record<string, unknown>;
};
}): void;
renameCollection
renameCollection
Rename a collection.
function renameCollection(param: {
atPath: Array<string>;
name: string;
}): void;
updateCollectionDescription
updateCollectionDescription
Update the description of a collection.
function updateCollectionDescription(param: {
atPath: Array<string>;
description: string;
}): void;
updateCollectionExtensions
updateCollectionExtensions
Update the extensions of a collection.
function updateCollectionExtensions(param: {
atPath: Array<string>;
extensions: treeNodeExtensionsSchema;
}): void;
renameCollectionMode
renameCollectionMode
Rename a collection mode.
function renameCollectionMode(param: {
atPath: Array<string>;
fromMode: string;
toMode: string;
}): void;
truncateCollection
truncateCollection
Truncate a collection.
function truncateCollection(param: { atPath: Array<string> }): void;
deleteCollection
deleteCollection
Delete a collection.
function deleteCollection(param: { atPath: Array<string> }): void;
deleteCollectionMode
deleteCollectionMode
Delete a collection mode.
function deleteCollectionMode(param: {
atPath: Array<string>;
mode: string;
}): void;
moveCollection
moveCollection
Move a collection.
function moveCollection(param: {
atPath: Array<string>;
toPath: Array<string>;
}): void;
addGroup
addGroup
Add a new group to the token tree.
function addGroup(param: {
parentPath: Array<string>;
name: string;
groupProperties: specifyGroupPropertiesSchema;
}): void;
renameGroup
renameGroup
Rename a group.
function renameGroup(param: { atPath: Array<string>; name: string }): void;
updateGroupDescription
updateGroupDescription
Update the description of a group.
function updateGroupDescription(param: {
atPath: Array<string>;
description: string;
}): void;
updateGroupExtensions
updateGroupExtensions
Update the extensions of a group.
function updateGroupExtensions(param: {
atPath: Array<string>;
extensions: treeNodeExtensionsSchema;
}): void;
truncateGroup
truncateGroup
Truncate a group.
function truncateGroup(param: { atPath: Array<string> }): void;
deleteGroup
deleteGroup
Delete a group.
function deleteGroup(param: { atPath: Array<string> }): void;
moveGroup
moveGroup
Move a group.
function moveGroup(param: {
atPath: Array<string>;
toPath: Array<string>;
}): void;
Last updated
Was this helpful?