Skip to content

Commit 3ea5105

Browse files
refactor: migrate JavaScript files to TypeScript with type annotations
1 parent ac59f70 commit 3ea5105

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
3+
type SomeComponentProps = {
4+
title: string;
5+
count: number;
6+
};
7+
8+
const SomeComponent: React.FC<SomeComponentProps> = ({ title, count }) => {
9+
return (
10+
<div>
11+
<h1>{title}</h1>
12+
<p>Count: {count}</p>
13+
</div>
14+
);
15+
};
16+
17+
export default SomeComponent;

base-shell/src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import SomeComponent from './components/SomeComponent';
2+
import { add, multiply } from './utils/helpers';
3+
4+
console.log(add(2, 3));
5+
console.log(multiply(4, 5));
6+
7+
export { SomeComponent, add, multiply };

base-shell/src/utils/helpers.js

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

0 commit comments

Comments
 (0)