Skip to content

Commit bae639c

Browse files
committed
Add example
1 parent 65aaeec commit bae639c

File tree

7 files changed

+81
-0
lines changed

7 files changed

+81
-0
lines changed

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules

example/package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {},
7+
"author": "Yuku Kotani ([email protected])",
8+
"license": "MIT",
9+
"devDependencies": {
10+
"typescript": "^4.4.2",
11+
"typescript-plugin-namespace-import": "^0.3.0"
12+
}
13+
}

example/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as SomeLogics from './logics/SomeLogics';
2+
3+
SomeLogics.divide(4, 2);
4+
5+
// You can auto-complete `AnotherLogics` here!

example/src/logics/AnotherLogics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function print(msg: any) {
2+
console.log(msg);
3+
}
4+
5+
export function printError(error: any) {
6+
console.error(error);
7+
}

example/src/logics/SomeLogics.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function multiply(a: number, b: number): number {
2+
return a * b;
3+
}
4+
5+
export function divide(a: number, b: number): number {
6+
return a / b;
7+
}

example/tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"module": "ESNext",
5+
"moduleResolution": "Node",
6+
"noEmit": true,
7+
"plugins": [
8+
{
9+
"name": "typescript-plugin-namespace-import",
10+
"options": {
11+
"paths": ["src/logics"],
12+
"ignoreNamedExport": true
13+
}
14+
}
15+
]
16+
},
17+
"include": ["src"]
18+
}

0 commit comments

Comments
 (0)