Merge pull request #1596 from fmalita/gaussian-blur
Add SVG support for Gaussian Blur effects
diff --git a/build/player/lottie.d.ts b/build/player/lottie.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/build/player/lottie_html.d.ts b/build/player/lottie_html.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie_html.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/build/player/lottie_light.d.ts b/build/player/lottie_light.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie_light.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/build/player/lottie_light_canvas.d.ts b/build/player/lottie_light_canvas.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie_light_canvas.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/build/player/lottie_light_html.d.ts b/build/player/lottie_light_html.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie_light_html.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/build/player/lottie_svg.d.ts b/build/player/lottie_svg.d.ts
new file mode 100644
index 0000000..763ef6f
--- /dev/null
+++ b/build/player/lottie_svg.d.ts
@@ -0,0 +1,5 @@
+import { default as Lottie } from '../../index';
+
+export * from '../../index';
+
+export default Lottie;
diff --git a/index.d.ts b/index.d.ts
new file mode 100644
index 0000000..52a16e0
--- /dev/null
+++ b/index.d.ts
@@ -0,0 +1,81 @@
+export type AnimationDirection = 1 | -1;
+export type AnimationSegment = [number, number];
+export type AnimationEventName = 'enterFrame' | 'loopComplete' | 'complete' | 'segmentStart' | 'destroy';
+export type AnimationEventCallback<T = any> = (args: T) => void;
+
+export type AnimationItem = {
+ play();
+ stop();
+ pause();
+ setLocationHref(href: string);
+ setSpeed(speed: number);
+ goToAndPlay(value: number, isFrame?: boolean);
+ goToAndStop(value: number, isFrame?: boolean);
+ setDirection(direction: AnimationDirection);
+ playSegments(segments: AnimationSegment | AnimationSegment[], forceFlag?: boolean);
+ setSubframe(useSubFrames: boolean);
+ destroy();
+ getDuration(inFrames?: boolean): number;
+ triggerEvent<T = any>(name: AnimationEventName, args: T);
+ addEventListener<T = any>(name: AnimationEventName, callback: AnimationEventCallback<T>);
+ removeEventListener<T = any>(name: AnimationEventName, callback: AnimationEventCallback<T>);
+}
+
+export type BaseRendererConfig = {
+ imagePreserveAspectRatio?: string;
+ className?: string;
+};
+
+export type SVGRendererConfig = BaseRendererConfig & {
+ title?: string;
+ description?: string;
+ preserveAspectRatio?: string;
+ progressiveLoad?: boolean;
+ hideOnTransparent?: boolean;
+ viewBoxOnly?: boolean;
+ viewBoxSize?: string;
+};
+
+export type CanavasRendererConfig = BaseRendererConfig & {
+ clearCanvas?: boolean;
+ context?: CanvasRenderingContext2D;
+ progressiveLoad?: boolean;
+ preserveAspectRatio?: string;
+};
+
+export type HTMLRendererConfig = BaseRendererConfig & {
+ hideOnTransparent?: boolean;
+};
+
+export type AnimationConfig = {
+ container: Element;
+ renderer?: 'svg' | 'canvas' | 'html';
+ loop?: boolean | number;
+ autoplay?: boolean;
+ name?: string;
+ rendererSettings?: SVGRendererConfig | CanavasRendererConfig | HTMLRendererConfig;
+}
+
+export type AnimationConfigWithPath = AnimationConfig & {
+ path?: string;
+}
+
+export type AnimationConfigWithData = AnimationConfig & {
+ animationData?: any;
+}
+
+type LottiePlayer = {
+ play(name?: string);
+ stop(name?: string);
+ setSpeed(speed: number, name?: string);
+ setDirection(direction: AnimationDirection, name?: string);
+ searchAnimations(animationData?: any, standalone?: boolean, renderer?: string);
+ loadAnimation(params: AnimationConfigWithPath | AnimationConfigWithData): AnimationItem;
+ destroy(name?: string);
+ registerAnimation(element: Element, animationData?: any);
+ setQuality(quality: string | number);
+}
+
+const Lottie: LottiePlayer;
+
+export default Lottie;
diff --git a/package.json b/package.json
index 74ea5be..8318040 100644
--- a/package.json
+++ b/package.json
@@ -22,5 +22,6 @@
"cheerio": "^1.0.0-rc.2",
"uglify-js": "^3.4.9"
},
+ "types": "./index.d.ts",
"license": "MIT"
}