diff --git a/stuff/ts/index.html b/stuff/ts/index.html
new file mode 100644
index 0000000..d1e69bc
--- /dev/null
+++ b/stuff/ts/index.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ Modules
+
+
+
+
+
+
+
diff --git a/stuff/ts/package.json b/stuff/ts/package.json
index 946fa5a..fea4257 100644
--- a/stuff/ts/package.json
+++ b/stuff/ts/package.json
@@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "![Typescript logo](https://miro.medium.com/v2/resize:fit:1358/0*OJAUWZoGbVq--rNd.png)",
"main": "index.js",
+
"scripts": {
"build": "tsc",
"build:dev": "tsc -w"
diff --git a/stuff/ts/src/classesExample1.ts b/stuff/ts/src/classesExample1.ts
index 279aac5..8dd1158 100644
--- a/stuff/ts/src/classesExample1.ts
+++ b/stuff/ts/src/classesExample1.ts
@@ -1,4 +1,4 @@
-import validateHealthAmount from "./validate";
+import { validateHealthAmount } from "./validate";
type PlayerKind = "fighter" | "swordman" | "gunman";
diff --git a/stuff/ts/src/index.ts b/stuff/ts/src/index.ts
index 285054d..b319105 100644
--- a/stuff/ts/src/index.ts
+++ b/stuff/ts/src/index.ts
@@ -1,3 +1,5 @@
+import { sayHello } from "./validate.js";
+
const sum = (a: number, b: number) => a + b;
const result1 = sum(4, 2);
@@ -454,3 +456,5 @@ sendNotificationMessage({
phoneNumber: 4322345221,
text: "Helppp",
});
+
+sayHello("Jane");
diff --git a/stuff/ts/src/validate.ts b/stuff/ts/src/validate.ts
index 90ba3c4..b6d83fd 100644
--- a/stuff/ts/src/validate.ts
+++ b/stuff/ts/src/validate.ts
@@ -8,4 +8,8 @@ const validateHealthAmount = (amount: number) => {
}
};
-export default validateHealthAmount;
+function sayHello(name: string): void {
+ console.log(name);
+}
+
+export { validateHealthAmount, sayHello };
diff --git a/stuff/ts/tsconfig.json b/stuff/ts/tsconfig.json
index 3ede0f8..b7e4754 100644
--- a/stuff/ts/tsconfig.json
+++ b/stuff/ts/tsconfig.json
@@ -25,7 +25,7 @@
"moduleDetection": "force" /* Control what method is used to detect module-format JS files. */,
/* Modules */
- "module": "commonjs" /* Specify what module code is generated. */,
+ "module": "ES6" /* Specify what module code is generated. */,
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node10" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
@@ -105,6 +105,6 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
- "incstuff/ts/srce": ["src"] /* Files that we want to ts check */,
- "exclude": ["**.test.ts"] /* TS will ignore this files*/
+ "include": ["src/**/*.ts"] /* Files that we want to ts check */,
+ "exclude": ["**/*.test.ts"] /* TS will ignore this files*/
}