kt-forpro-tools 1.0.3 → 1.0.5
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/package.json +1 -1
- package/src/KT_ForproTools.ts +5 -2
- package/src/tests/index.test.ts +11 -10
- package/src/utils.ts +34 -0
package/package.json
CHANGED
package/src/KT_ForproTools.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { KT_SlidesAPI } from "./slides";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { createCleanupStructure } from "./utils";
|
|
3
|
+
class __KT_ForproTools {
|
|
4
4
|
private name = "KtForproTools";
|
|
5
5
|
private version = "1.0.0";
|
|
6
6
|
Slides = KT_SlidesAPI;
|
|
7
|
+
Cleanup = createCleanupStructure;
|
|
7
8
|
constructor() {
|
|
8
9
|
$.writeln("KtForproTools constructor");
|
|
9
10
|
}
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export const KT_ForproTools = new __KT_ForproTools();
|
package/src/tests/index.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, runTests, beforeAll, afterAll, beforeEach, afterEach } from "kt-testing-suite-core";
|
|
2
|
-
import { KT_Slides } from "../index";
|
|
2
|
+
import { KT_Slides, KT_ForproTools } from "../index";
|
|
3
3
|
|
|
4
4
|
describe("KtForproTools Tests", () => {
|
|
5
5
|
it("should import the slides module", () => {
|
|
@@ -8,16 +8,17 @@ describe("KtForproTools Tests", () => {
|
|
|
8
8
|
const width = 3840;
|
|
9
9
|
const height = 2160;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
KT_ForproTools.Cleanup();
|
|
12
|
+
// const slides = new KT_Slides({
|
|
13
|
+
// name: "Test Slides",
|
|
14
|
+
// duration: duration,
|
|
15
|
+
// width: width,
|
|
16
|
+
// height: height,
|
|
17
|
+
// comp: app.project.activeItem as CompItem,
|
|
18
|
+
// slideMultiplier: slideMultiplier,
|
|
19
|
+
// });
|
|
19
20
|
|
|
20
|
-
slides.cleanUp();
|
|
21
|
+
// slides.cleanUp();
|
|
21
22
|
// slides.import();
|
|
22
23
|
// // slides.splitSlides();
|
|
23
24
|
// const startTime = new Date().getTime();
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { KT_AeIs } from "kt-ae-is-checkers";
|
|
2
|
+
import { KT_Project } from "kt-ae-tools-project";
|
|
3
|
+
|
|
4
|
+
function generateProjectStructure(
|
|
5
|
+
template: any = {},
|
|
6
|
+
name: string = "Template Project",
|
|
7
|
+
parentFolder: FolderItem = app.project.rootFolder
|
|
8
|
+
): FolderItem {
|
|
9
|
+
const newFolder = KT_Project.add.folder({ name, parentFolder });
|
|
10
|
+
for (const key in template) {
|
|
11
|
+
if (key === "calback") {
|
|
12
|
+
template[key](newFolder);
|
|
13
|
+
}
|
|
14
|
+
const item = template[key];
|
|
15
|
+
generateProjectStructure(item, key, newFolder);
|
|
16
|
+
}
|
|
17
|
+
return newFolder;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function createCleanupStructure(name: string = "Project"): FolderItem {
|
|
21
|
+
return generateProjectStructure(
|
|
22
|
+
{
|
|
23
|
+
src: {
|
|
24
|
+
esp: {},
|
|
25
|
+
cat: {},
|
|
26
|
+
},
|
|
27
|
+
outputs: {
|
|
28
|
+
esp: {},
|
|
29
|
+
cat: {},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
name + "Cleanup"
|
|
33
|
+
);
|
|
34
|
+
}
|