updateEffectProps()v4.0.528
Updates explicit properties in an inline effect configuration.
Draft API: This API is experimental and may change.
update-effect-props.tsimport {updateEffectProps , typeCodemodProject , typeEffectReference } from '@remotion/codemods'; declare constproject :CodemodProject ; declare consteffect :EffectReference ; constresult = awaitupdateEffectProps ({project ,effect ,props : {radius : 12}, });console .log (result );
Other effect properties are preserved. Use updateEffectKeyframes() to edit an animation. The effects array and configuration must be inline.
Options
project
An in-memory CodemodProject. The input project is not mutated.
effect
An EffectReference: filePath, nodePath, and a zero-based effectIndex in the node's inline effects array.
props?
A non-empty record of serializable values. Keys must be JavaScript identifiers. Computed values are rejected; recognized keyframed values are replaced with static values. Provide exactly one of props or updates.
updates?
A non-empty array of explicit effect prop edits. Use this form to reset a prop to its default or paste a structured animation. Unlike props, this form permits replacing computed prop values. The effect call and its configuration must still be editable.
key
The effect prop name. Must be a JavaScript identifier.
value
The replacement value. Provide exactly one of value or effectParam for each update.
effectParam
A structured static or keyframed parameter to paste instead of value. Required animation imports are added.
defaultValue
The effect prop's default value, or null when no default is known. An explicit prop is removed when value equals a non-null default.
schema?
A Remotion InteractivitySchema for schema-specific defaults and enum variants. By default, no schema-specific behavior is applied.
Return value
A promise resolving to an object with the following properties.
changes
An array of {filePath, previousContents, nextContents} file changes. A null content value indicates a created or deleted file.
nodePathRemappings
An array of {filePath, oldNodePath, newNodePath} mappings. A null old path indicates an insertion; a null new path indicates removal. Apply these mappings to references from the input project. See node references.
updatedEffect
The effect reference in the updated project.
results
One entry per prop update, in input order.
oldValueString
The previous source value, or the supplied default when the prop was absent.
newValueString
The replacement expression, or the supplied default when an explicit prop was removed.
removedProps
An array of {key, valueString} entries for additional props removed when a schema enum changes variants.
effectCallee
The effect call's name in the source.
logLine
The one-based line of the effect call in the source before this update.
output
The file contents after this prop update. The final project contains the result after all updates.
formatted
Whether the generated edit was formatted.
Errors
Throws or rejects when the target cannot be resolved, the requested edit is unsupported, or an option is invalid. Failed edits leave the input project unchanged.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||