@aarsteinmedia/dotlottie-player 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import * as Lottie from 'lottie-web/build/player/lottie.js';
2
- import { AnimationDirection, RendererType, AnimationSegment } from 'lottie-web';
1
+ import { AnimationSettings, AnimationDirection, Vector2, LottieManifest, AnimationItem, AnimationData } from '@aarsteinmedia/lottie-web';
3
2
 
4
3
  declare function renderPlayer(this: DotLottiePlayer): void;
5
4
 
@@ -41,87 +40,18 @@ declare enum PreserveAspectRatio {
41
40
  None = "xMinYMin slice",
42
41
  Initial = "none"
43
42
  }
44
-
45
- type BoolInt = 0 | 1;
46
- interface Shape {
47
- a: ShapeData;
48
- o: ShapeData;
49
- p: ShapeData;
50
- r: ShapeData;
51
- s: ShapeData;
52
- }
53
- interface ShapeData {
54
- a: BoolInt;
55
- k: number | number[];
56
- ix: number;
57
- }
58
- interface Layer {
59
- ao: BoolInt;
60
- bm: number;
61
- completed: boolean;
62
- ddd: BoolInt;
63
- ip: number;
64
- ks: object;
65
- nm: string;
66
- op: number;
67
- shapes: Shape[];
68
- sr: number;
69
- st: number;
70
- td: number;
71
- ty: number;
72
- }
73
- interface LottieAsset {
74
- e?: BoolInt;
75
- layers?: Layer[];
76
- h?: number;
77
- id?: string;
78
- nm?: string;
79
- p?: string;
80
- u?: string;
81
- xt?: number;
82
- w?: number;
83
- }
84
- interface LottieJSON {
85
- assets?: LottieAsset[];
86
- ddd: BoolInt;
87
- fr: number;
88
- h: number;
89
- ip: number;
90
- layers: Layer[];
91
- markers: unknown[];
92
- meta: {
93
- a: string;
94
- d: string;
95
- g: string;
96
- k: string;
97
- tc: string;
98
- };
99
- nm: string;
100
- op: number;
101
- v: string;
102
- w: number;
103
- }
104
- interface AnimationSettings {
105
- autoplay?: Autoplay;
106
- loop?: Loop;
107
- direction?: AnimationDirection;
108
- mode?: PlayMode;
109
- speed?: number;
43
+ declare enum RendererType {
44
+ SVG = "svg",
45
+ HTML = "html",
46
+ Canvas = "canvas"
110
47
  }
48
+
111
49
  interface Animation extends AnimationSettings {
112
50
  id: string;
113
51
  }
114
52
  interface AnimationAttributes extends Animation {
115
53
  url: string;
116
54
  }
117
- interface LottieManifest {
118
- animations: Animation[];
119
- author?: string;
120
- description?: string;
121
- generator?: string;
122
- keywords?: string;
123
- version?: string;
124
- }
125
55
  type AnimateOnScroll = boolean | '' | null;
126
56
  type Autoplay = boolean | '' | 'autoplay' | null;
127
57
  type Controls = boolean | '' | 'controls' | null;
@@ -161,12 +91,12 @@ declare module 'react/jsx-dev-runtime' {
161
91
  }
162
92
  }
163
93
 
164
- declare class EnhancedElement extends HTMLElement {
94
+ declare class PropertyCallbackElement extends HTMLElement {
165
95
  constructor();
166
96
  connectedCallback(): void;
167
97
  }
168
98
 
169
- declare class DotLottiePlayer extends EnhancedElement {
99
+ declare class DotLottiePlayer extends PropertyCallbackElement {
170
100
  constructor();
171
101
  connectedCallback(): Promise<void>;
172
102
  disconnectedCallback(): void;
@@ -218,10 +148,10 @@ declare class DotLottiePlayer extends EnhancedElement {
218
148
  getMultiAnimationSettings(): AnimationSettings[];
219
149
  setMultiAnimationSettings(settings: AnimationSettings[]): void;
220
150
  private _segment?;
221
- setSegment(segment: AnimationSegment): void;
222
- getSegment(): Lottie.AnimationSegment | undefined;
223
- protected _container: Element | null;
224
- playerState?: PlayerState;
151
+ setSegment(segment: Vector2): void;
152
+ getSegment(): Vector2 | undefined;
153
+ protected _container: HTMLElement | null;
154
+ playerState: PlayerState;
225
155
  protected _isSettingsOpen: boolean;
226
156
  protected _seeker: number;
227
157
  private _currentAnimation;
@@ -232,7 +162,7 @@ declare class DotLottiePlayer extends EnhancedElement {
232
162
  protected _errorMessage: string;
233
163
  private _isBounce;
234
164
  private _isDotLottie;
235
- private _manifest;
165
+ private _manifest?;
236
166
  protected _playerState: {
237
167
  prev: PlayerState;
238
168
  count: number;
@@ -244,7 +174,7 @@ declare class DotLottiePlayer extends EnhancedElement {
244
174
  private _getOptions;
245
175
  private _addIntersectionObserver;
246
176
  load(src: string | null): Promise<void>;
247
- getManifest(): LottieManifest;
177
+ getManifest(): LottieManifest | undefined;
248
178
  private _toggleEventListeners;
249
179
  private _addEventListeners;
250
180
  private _removeEventListeners;
@@ -266,7 +196,7 @@ declare class DotLottiePlayer extends EnhancedElement {
266
196
  success: boolean;
267
197
  error?: string;
268
198
  }>;
269
- getLottie(): Lottie.AnimationItem | null;
199
+ getLottie(): AnimationItem | null;
270
200
  play(): Promise<void>;
271
201
  pause(): void;
272
202
  stop(): void;
@@ -292,7 +222,7 @@ declare class DotLottiePlayer extends EnhancedElement {
292
222
  convert({ animations, fileName, manifest, shouldDownload, src, typeCheck, }: {
293
223
  typeCheck?: boolean;
294
224
  manifest?: LottieManifest;
295
- animations?: LottieJSON[];
225
+ animations?: AnimationData[];
296
226
  src?: string;
297
227
  fileName?: string;
298
228
  shouldDownload?: boolean;