2023-02-26 01:30
This commit is contained in:
1
getting-typescript/.gitignore
vendored
Normal file
1
getting-typescript/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
14
getting-typescript/package.json
Normal file
14
getting-typescript/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "getting-typescript",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"watch": "tsc --watch",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Elex",
|
||||
"license": "ISC",
|
||||
"private": true
|
||||
}
|
||||
9
getting-typescript/src/01_hello.js
Normal file
9
getting-typescript/src/01_hello.js
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
class Person {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
;
|
||||
const person = new Person("Charlie");
|
||||
console.log(`Hello, ${person.name}.`);
|
||||
10
getting-typescript/src/01_hello.ts
Normal file
10
getting-typescript/src/01_hello.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
class Person {
|
||||
name: string;
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
};
|
||||
|
||||
const person: Person = new Person("Charlie");
|
||||
console.log(`Hello, ${person.name}.`);
|
||||
|
||||
18
getting-typescript/tsconfig.json
Normal file
18
getting-typescript/tsconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"target": "ES6",
|
||||
"lib": [
|
||||
"ES2015",
|
||||
"DOM"
|
||||
],
|
||||
"module": "CommonJS"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"outDir": "./out"
|
||||
}
|
||||
Reference in New Issue
Block a user