@@ -10,38 +10,77 @@ export default {
10
10
title : 'Examples/All' ,
11
11
} ;
12
12
13
- export const SimpleParagraph = ( args ) => < SimpleParagraphExample { ...args } /> ;
13
+ interface SimpleParagraphArgs {
14
+ original : string ;
15
+ modified : string ;
16
+ title : string ;
17
+ description ?: string ;
18
+ }
19
+
20
+ export const SimpleParagraph = ( args : SimpleParagraphArgs ) => < SimpleParagraphExample { ...args } /> ;
14
21
SimpleParagraph . args = {
15
22
original : "I am Captain Kirk, Captain of the USS Enterprise." ,
16
23
modified : "I am Captain Picard, Captain of the USS Enterprise." ,
17
24
title : "Example 1: Kirk vs Picard" ,
18
25
description : 'Only "Kirk" and "Picard" should be highlighted' ,
19
26
} ;
20
27
21
- export const ComplexParagraph = ( args ) => < ComplexParagraphExample { ...args } /> ;
28
+ interface ComplexParagraphArgs {
29
+ original : string ;
30
+ modified : string ;
31
+ title : string ;
32
+ description ?: string ;
33
+ }
34
+
35
+ export const ComplexParagraph = ( args : ComplexParagraphArgs ) => < ComplexParagraphExample { ...args } /> ;
22
36
ComplexParagraph . args = {
23
37
original : "I am Captain Kirk, Captain of the USS Enterprise." ,
24
38
modified : "I am Commander Benjamin Sisko, Commander of Deep Space 9." ,
25
39
title : "Example 2: Kirk vs Sisko" ,
26
40
description : "Multiple changes highlighted" ,
27
41
} ;
28
42
29
- export const Array = ( args ) => < ArrayExample { ...args } /> ;
43
+ interface ExampleArgs {
44
+ original : string ;
45
+ modified : string ;
46
+ title : string ;
47
+ description ?: string ;
48
+ }
49
+
50
+ interface ArrayExampleArgs {
51
+ original : string [ ] ;
52
+ modified : string [ ] ;
53
+ title : string ;
54
+ description ?: string ;
55
+ }
56
+
57
+ interface CaseInsensitiveArgs extends ArrayExampleArgs {
58
+ caseSensitive : boolean ;
59
+ }
60
+
61
+ export const Array = ( args : ArrayExampleArgs ) => < ArrayExample { ...args } /> ;
30
62
Array . args = {
31
63
original : [ 'USS Enterprise' , 'USS Voyager' , 'USS Defiant' ] ,
32
64
modified : [ 'USS Discovery' , 'USS Voyager' , 'USS Cerritos' ] ,
33
65
title : "Example 3: Starship Array Comparison" ,
34
66
} ;
35
67
36
- export const Disordered = ( args ) => < DisorderedArray { ...args } /> ;
68
+ interface DisorderedArrayArgs {
69
+ original : string [ ] ;
70
+ modified : string [ ] ;
71
+ title : string ;
72
+ description ?: string ;
73
+ }
74
+
75
+ export const Disordered = ( args : DisorderedArrayArgs ) => < DisorderedArray { ...args } /> ;
37
76
Disordered . args = {
38
77
original : [ 'Vulcan' , 'Earth' , 'Romulus' ] ,
39
78
modified : [ 'Earth' , 'Romulus' , 'Vulcan' ] ,
40
79
title : "Example 4: Disordered Array" ,
41
80
description : "Order matters in this comparison" ,
42
81
} ;
43
82
44
- export const CaseInsensitive = ( args ) => < CaseInsensitiveExample { ...args } /> ;
83
+ export const CaseInsensitive = ( args : CaseInsensitiveArgs ) => < CaseInsensitiveExample { ...args } /> ;
45
84
CaseInsensitive . args = {
46
85
original : [ 'Vulcan' , 'Earth' , 'Romulus' ] ,
47
86
modified : [ 'romulus' , 'vulcan' , 'earth' ] ,
@@ -50,7 +89,9 @@ CaseInsensitive.args = {
50
89
caseSensitive : false ,
51
90
} ;
52
91
53
- export const OrderInsensitive = ( args ) => < OrderInsensitiveExample { ...args } /> ;
92
+ interface OrderInsensitiveArgs extends CaseInsensitiveArgs { }
93
+
94
+ export const OrderInsensitive = ( args : OrderInsensitiveArgs ) => < OrderInsensitiveExample { ...args } /> ;
54
95
OrderInsensitive . args = {
55
96
original : [ 'Vulcan' , 'Earth' , 'Romulus' ] ,
56
97
modified : [ 'romulus' , 'vulcan' , 'earth' ] ,
0 commit comments