Skip to content

Commit

Permalink
add type problem scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna committed Oct 31, 2024
0 parents commit 68c783d
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions class1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare class MyClass {
private prop;
method(): void;
}
4 changes: 4 additions & 0 deletions class2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare class MyClass {
private prop;
method(): void;
}
5 changes: 5 additions & 0 deletions func.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {MyClass} from './class1';

export function myFunc(c: MyClass) {
return '';
}
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {MyClass} from './class2';
import {myFunc} from './func';

const instance = new MyClass();
const result = myFunc(instance);
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "otel-js-core-5062",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"outDir": "./dist",
"target": "ES2022",
"lib": ["ES2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
},
"include": ["index.ts"],
}

0 comments on commit 68c783d

Please sign in to comment.