Skip to content

Commit ea36a19

Browse files
committed
Animation options added to JS API TS declaration file.
1 parent 2bcd4e7 commit ea36a19

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/apps/weblib/js-api/vizzu.d.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,37 @@ interface Styles extends Padding, Box, Font {
174174
data: Data;
175175
}
176176

177-
interface AnimationTarget {
177+
interface AnimTarget {
178178
data: DataSet;
179179
descriptor: Descriptor;
180180
style: Styles;
181181
}
182182

183+
type Duration = `${number}s`|`${number}ms`|number;
184+
185+
type Easing = 'none' | 'linear' | 'step-start' | 'step-end' | 'ease'
186+
| 'ease-in' | 'ease-out'
187+
| `cubic-bezier(${number},${number},${number},${number})`;
188+
189+
interface AnimOption {
190+
easing: Easing;
191+
duration: Duration;
192+
delay: Duration;
193+
}
194+
195+
interface AnimOptions {
196+
style: AnimOption;
197+
title: AnimOption;
198+
enable: AnimOption;
199+
color: AnimOption;
200+
coordSystem: AnimOption;
201+
shape: AnimOption;
202+
y: AnimOption;
203+
x: AnimOption;
204+
}
205+
183206
interface AnimControl {
184-
seek(value: `${number}%`|`${number}s`|`${number}ms`): void;
207+
seek(value: `${number}%`|Duration): void;
185208
pause(): void;
186209
play(): void;
187210
stop(): void;
@@ -218,7 +241,7 @@ export default class Vizzu {
218241
initializing: Promise<Vizzu>;
219242
on(eventName: EventName, handler: (event: Event) => void): void;
220243
off(eventName: EventName, handler: (event: Event) => void): void;
221-
animate(obj: AnimationTarget): Promise<Vizzu>;
244+
animate(obj: AnimTarget, opt: AnimOptions): Promise<Vizzu>;
222245
get animation(): AnimControl;
223246
version(): string;
224247
}

0 commit comments

Comments
 (0)