Jelajahi Sumber

added build-typescript-definitions

Ievgen Naida 5 tahun lalu
induk
melakukan
4f46a0b3cc

+ 4 - 3
package.json

@@ -3,7 +3,7 @@
   "version": "2.0.5",
   "description": "animation timeline control based on the canvas.",
   "main": "lib/animation-timeline.min.js",
-  "types": "src/index.ts",
+  "types": "lib/animation-timeline.d.ts",
   "dependencies": {},
   "devDependencies": {
     "@babel/cli": "^7.8.3",
@@ -27,7 +27,8 @@
   },
   "scripts": {
     "test": "echo \"Run tests/unittest.html explicitly to execute tests\" && exit 1",
-    "build": "webpack && tsc -emitDeclarationOnly",
+    "build-typescript-definitions": "tsc -emitDeclarationOnly",
+    "build": "webpack && npm run build-typescript-definitions",
     "webpack": "npm run build",
     "build-tests": "tsc -p tsconfig.tests.json"
   },
@@ -52,4 +53,4 @@
     "url": "https://github.com/ievgennaida/js-animation-timeline-control/issues"
   },
   "homepage": "https://github.com/ievgennaida/js-animation-timeline-control#readme"
-}
+}

+ 0 - 27
tests/tests/timelineTests.js

@@ -1,27 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-var animation_timeline_js_1 = require("../lib/animation-timeline.js");
-describe('Timeline ', function () {
-    it('closest keyframe should be returned', function () {
-        var timeline = new animation_timeline_js_1.Timeline();
-        var elements = [
-            {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
-                val: 0,
-            },
-            {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
-                val: 4,
-            },
-            {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
-                val: 9,
-            },
-        ];
-        var element = timeline._findDraggable(elements, 5);
-        if (element.val !== elements[2].val) {
-            throw new Error('Wrong keyframe selected');
-        }
-    });
-});
-//# sourceMappingURL=timelineTests.js.map

+ 0 - 1
tests/tests/timelineTests.js.map

@@ -1 +0,0 @@
-{"version":3,"file":"timelineTests.js","sourceRoot":"","sources":["../timelineTests.ts"],"names":[],"mappings":";;AAAA,sEAAuG;AAEvG,QAAQ,CAAC,WAAW,EAAE;IACpB,EAAE,CAAC,qCAAqC,EAAE;QACxC,IAAM,QAAQ,GAAG,IAAI,gCAAQ,EAAE,CAAC;QAChC,IAAM,QAAQ,GAAG;YACf;gBACE,IAAI,EAAE,2CAAmB,CAAC,QAAQ;gBAClC,GAAG,EAAE,CAAC;aACqB;YAC7B;gBACE,IAAI,EAAE,2CAAmB,CAAC,QAAQ;gBAClC,GAAG,EAAE,CAAC;aACqB;YAC7B;gBACE,IAAI,EAAE,2CAAmB,CAAC,QAAQ;gBAClC,GAAG,EAAE,CAAC;aACqB;SAC9B,CAAC;QACF,IAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACrD,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

+ 5 - 5
tests/timelineTests.js

@@ -1,20 +1,20 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
-var animation_timeline_js_1 = require("../lib/animation-timeline.js");
+var animation_timeline_1 = require("../lib/animation-timeline");
 describe('Timeline ', function () {
     it('closest keyframe should be returned', function () {
-        var timeline = new animation_timeline_js_1.Timeline();
+        var timeline = new animation_timeline_1.Timeline();
         var elements = [
             {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
+                type: animation_timeline_1.TimelineElementType.Keyframe,
                 val: 0,
             },
             {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
+                type: animation_timeline_1.TimelineElementType.Keyframe,
                 val: 4,
             },
             {
-                type: animation_timeline_js_1.TimelineElementType.Keyframe,
+                type: animation_timeline_1.TimelineElementType.Keyframe,
                 val: 9,
             },
         ];

+ 1 - 1
tests/timelineTests.js.map

@@ -1 +1 @@
-{"version":3,"file":"timelineTests.js","sourceRoot":"","sources":["timelineTests.ts"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