animationGroupMask.d.ts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /**
  2. * Enum used to define the mode for an animation group mask
  3. */
  4. export declare enum AnimationGroupMaskMode {
  5. /**
  6. * The mask defines the animatable target names that should be included
  7. */
  8. Include = 0,
  9. /**
  10. * The mask defines the animatable target names in a "exclude" mode: all animatable targets will be animated except the ones defined in the mask
  11. */
  12. Exclude = 1
  13. }
  14. /**
  15. * Defines a mask used to filter animation targets.
  16. * If you apply a mask to an animation group (see the AnimationGroup.mask property), only the animations whose target names match the mask will play.
  17. * Note that a target is defined by its name (string). This means that the same mask can be used for several animation groups, provided that their targets are named in the same way.
  18. */
  19. export declare class AnimationGroupMask {
  20. /**
  21. * Defines the mode for the mask
  22. */
  23. mode: AnimationGroupMaskMode;
  24. /**
  25. * The set of target names included in the mask. If mode is AnimationGroupMaskMode.Exclude, the targets in this set will be excluded from the mask instead.
  26. */
  27. private _targetNames;
  28. /**
  29. * Gets or sets a boolean indicating if the mask is disabled (default is false)
  30. */
  31. disabled: boolean;
  32. /**
  33. * Creates a new mask
  34. * @param names The list of target names to add to the mask (optional)
  35. * @param mode Defines the mode for the mask (default: AnimationGroupMaskMode.Include)
  36. */
  37. constructor(names?: string[],
  38. /**
  39. * Defines the mode for the mask
  40. */
  41. mode?: AnimationGroupMaskMode);
  42. /**
  43. * Adds one or several target names to the mask
  44. * @param name The name(s) to add to the mask
  45. */
  46. addTargetName(name: string | string[]): void;
  47. /**
  48. * Removes one or several target names from the mask
  49. * @param name The name(s) to remove from the mask
  50. */
  51. removeTargetName(name: string | string[]): void;
  52. /**
  53. * Checks if the mask includes a target name.
  54. * This method is intended to know if a given target name is included in the mask, not if the name is actually retained by the mask (see retainsTarget() instead).
  55. * @param name The name to check with the mask
  56. * @returns True if the mask includes the name, false otherwise
  57. */
  58. hasTarget(name: string): boolean;
  59. /**
  60. * Checks if the mask retains a target name.
  61. * Note that in the "Exclude" mode, this will return false if the mask includes the name, and true otherwise!
  62. * This method is intended to know if a given target name is retained by the mask, not if the name is in the list of target names.
  63. * @param name The name to check with the mask
  64. * @returns True if the mask retains the name, false otherwise
  65. */
  66. retainsTarget(name: string): boolean;
  67. }