Skip to content

Commit 1524a5f

Browse files
authored
Merge pull request #9 from duckRabbitPy/stage-4
Add tsx and classes
2 parents b42a6bf + 00131eb commit 1524a5f

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

public/app.js

+17
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ const snippets = {
5757
`function firstElem<Type>(arr: Type[]): Type | undefined {return arr[0];}`,
5858
`topic complete return to menu!`,
5959
],
60+
Tsx: [
61+
`type: tsx`,
62+
`import type { menuBtn } from '@components/ReactHooks/menu';`,
63+
`<Select selectProps={{ items: cards }} {...props} />`,
64+
`useEffect(() => { findOptions(searchText);}, [searchText]);`,
65+
`<div onClick={() => addLinkedRecord(recordId)} key={recordId}>`,
66+
`export const useTransition = <T extends HTMLElement = HTMLElement>():`,
67+
`topic complete return to menu!`,
68+
],
69+
Classes: [
70+
`type: classes`,
71+
`class magician {powers: element[]; constructor(powers: element[]){}`,
72+
`class Greeter {name: string; constructor() { this.name = "hello";}}`,
73+
`class Place {readonly name: string = "world";}`,
74+
`class Derived extends Base {constructor() {super();}}`,
75+
`topic complete return to menu!`,
76+
],
6077
};
6178
// key event listener
6279
document.addEventListener("keydown", (event) => {

public/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ <h1>Touch-Typed!</h1>
3333
<input type="button" value="Generics" class="grid-item"></input>
3434
<input type="button" value="Interfaces" class="grid-item"></input>
3535
<input type="button" value="Casting" class="grid-item"></input>
36+
<input type="button" value="Tsx" class="grid-item"></input>
37+
<input type="button" value="Classes" class="grid-item"></input>
3638
</form>
3739

3840

src/app.ts

+19
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,32 @@ const snippets = {
5959
`function firstElem<Type>(arr: Type[]): Type | undefined {return arr[0];}`,
6060
`topic complete return to menu!`,
6161
],
62+
Tsx: [
63+
`type: tsx`,
64+
`import type { menuBtn } from '@components/ReactHooks/menu';`,
65+
`<Select selectProps={{ items: cards }} {...props} />`,
66+
`useEffect(() => { findOptions(searchText);}, [searchText]);`,
67+
`<div onClick={() => addLinkedRecord(recordId)} key={recordId}>`,
68+
`export const useTransition = <T extends HTMLElement = HTMLElement>():`,
69+
`topic complete return to menu!`,
70+
],
71+
Classes: [
72+
`type: classes`,
73+
`class magician {powers: element[]; constructor(powers: element[]){}`,
74+
`class Greeter {name: string; constructor() { this.name = "hello";}}`,
75+
`class Place {readonly name: string = "world";}`,
76+
`class Derived extends Base {constructor() {super();}}`,
77+
`topic complete return to menu!`,
78+
],
6279
};
6380

6481
type selectOptions = {
6582
Functions: string[];
6683
Casting: string[];
6784
Interfaces: string[];
6885
Generics: string[];
86+
Tsx: string[];
87+
Classes: string[];
6988
};
7089
type options = keyof selectOptions;
7190

0 commit comments

Comments
 (0)