11import { LeveledEffectAction } from "../EffectActions/LeveledEffectAction.js" ;
22import { ExpressionQualifier } from "../../../qualifiers/expression/ExpressionQualifier.js" ;
33import { IDeshakeEffectModel } from "../../../internal/models/IEffectActionModel.js" ;
4+ import { IActionModel } from "../../../internal/models/IActionModel.js" ;
45
6+ type pixels = 16 | 32 | 48 | 64 ;
57/**
68 * @description Removes small motion shifts from the video. with a maximum extent of movement in the horizontal and vertical direction of 32 pixels
79 * @extends LeveledEffectAction
@@ -14,12 +16,22 @@ class DeshakeEffectAction extends LeveledEffectAction {
1416 * The maximum number of pixels in the horizontal and vertical direction that will be addressed. (Possible values: 16, 32, 48, 64. Server default: 16)
1517 * @param value Possible values: 16, 32, 48, 64. Server default: 16.
1618 */
17- shakeStrength ( value : 16 | 32 | 48 | 64 | string | ExpressionQualifier ) : this {
18- this . _actionModel . pixels = value as number ;
19+ shakeStrength ( value : pixels | string | ExpressionQualifier ) : this {
20+ this . _actionModel . pixels = value as pixels ;
1921 const qualifierEffect = this . createEffectQualifier ( this . effectType , value ) ;
2022 this . addQualifier ( qualifierEffect ) ;
2123 return this ;
2224 }
25+
26+ static fromJson ( actionModel : IActionModel ) : DeshakeEffectAction {
27+ const { actionType, pixels} = ( actionModel as IDeshakeEffectModel ) ;
28+
29+ // We are using this() to allow inheriting classes to use super.fromJson.apply(this, [actionModel])
30+ // This allows the inheriting classes to determine the class to be created
31+ const result = new this ( actionType , pixels ) ;
32+
33+ return result ;
34+ }
2335}
2436
2537
0 commit comments