@storybook/react 7.3.2 → 7.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -9
- package/src/__test__/README.md +0 -3
- package/src/typings.d.ts +0 -48
- package/template/components/Button.jsx +0 -13
- package/template/components/Form.jsx +0 -36
- package/template/components/Html.jsx +0 -9
- package/template/components/Pre.jsx +0 -20
- package/template/stories/decorators.stories.tsx +0 -48
- package/template/stories/docgen-components/10017-ts-union/argTypes.snapshot +0 -36
- package/template/stories/docgen-components/10017-ts-union/docgen.snapshot +0 -34
- package/template/stories/docgen-components/10017-ts-union/input.tsx +0 -12
- package/template/stories/docgen-components/10017-ts-union/properties.snapshot +0 -32
- package/template/stories/docgen-components/10278-ts-multiple-components/argTypes.snapshot +0 -26
- package/template/stories/docgen-components/10278-ts-multiple-components/docgen.snapshot +0 -49
- package/template/stories/docgen-components/10278-ts-multiple-components/input.tsx +0 -27
- package/template/stories/docgen-components/10278-ts-multiple-components/properties.snapshot +0 -22
- package/template/stories/docgen-components/8140-js-prop-types-oneof/argTypes.snapshot +0 -127
- package/template/stories/docgen-components/8140-js-prop-types-oneof/docgen.snapshot +0 -97
- package/template/stories/docgen-components/8140-js-prop-types-oneof/input.jsx +0 -27
- package/template/stories/docgen-components/8140-js-prop-types-oneof/properties.snapshot +0 -89
- package/template/stories/docgen-components/8143-ts-imported-types/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8143-ts-imported-types/docgen.snapshot +0 -22
- package/template/stories/docgen-components/8143-ts-imported-types/input.tsx +0 -10
- package/template/stories/docgen-components/8143-ts-imported-types/properties.snapshot +0 -23
- package/template/stories/docgen-components/8143-ts-imported-types/types.ts +0 -3
- package/template/stories/docgen-components/8143-ts-react-fc-generics/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8143-ts-react-fc-generics/docgen.snapshot +0 -24
- package/template/stories/docgen-components/8143-ts-react-fc-generics/input.tsx +0 -10
- package/template/stories/docgen-components/8143-ts-react-fc-generics/properties.snapshot +0 -21
- package/template/stories/docgen-components/8428-js-static-prop-types/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/8428-js-static-prop-types/docgen.snapshot +0 -39
- package/template/stories/docgen-components/8428-js-static-prop-types/input.jsx +0 -20
- package/template/stories/docgen-components/8428-js-static-prop-types/properties.snapshot +0 -21
- package/template/stories/docgen-components/8740-ts-multi-props/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/8740-ts-multi-props/docgen.snapshot +0 -49
- package/template/stories/docgen-components/8740-ts-multi-props/input.tsx +0 -23
- package/template/stories/docgen-components/8740-ts-multi-props/properties.snapshot +0 -21
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/argTypes.snapshot +0 -48
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/docgen.snapshot +0 -39
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/input.tsx +0 -31
- package/template/stories/docgen-components/8894-9511-ts-forward-ref/properties.snapshot +0 -34
- package/template/stories/docgen-components/9023-js-hoc/argTypes.snapshot +0 -89
- package/template/stories/docgen-components/9023-js-hoc/docgen.snapshot +0 -84
- package/template/stories/docgen-components/9023-js-hoc/input.jsx +0 -40
- package/template/stories/docgen-components/9023-js-hoc/properties.snapshot +0 -67
- package/template/stories/docgen-components/9399-js-proptypes-shape/argTypes.snapshot +0 -39
- package/template/stories/docgen-components/9399-js-proptypes-shape/docgen.snapshot +0 -48
- package/template/stories/docgen-components/9399-js-proptypes-shape/input.jsx +0 -16
- package/template/stories/docgen-components/9399-js-proptypes-shape/properties.snapshot +0 -35
- package/template/stories/docgen-components/9465-ts-type-props/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9465-ts-type-props/docgen.snapshot +0 -33
- package/template/stories/docgen-components/9465-ts-type-props/input.tsx +0 -12
- package/template/stories/docgen-components/9465-ts-type-props/properties.snapshot +0 -24
- package/template/stories/docgen-components/9493-ts-display-name/argTypes.snapshot +0 -62
- package/template/stories/docgen-components/9493-ts-display-name/docgen.snapshot +0 -50
- package/template/stories/docgen-components/9493-ts-display-name/input.tsx +0 -30
- package/template/stories/docgen-components/9493-ts-display-name/properties.snapshot +0 -52
- package/template/stories/docgen-components/9556-ts-react-default-exports/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9556-ts-react-default-exports/docgen.snapshot +0 -32
- package/template/stories/docgen-components/9556-ts-react-default-exports/input.tsx +0 -12
- package/template/stories/docgen-components/9556-ts-react-default-exports/properties.snapshot +0 -24
- package/template/stories/docgen-components/9575-ts-camel-case/argTypes.snapshot +0 -28
- package/template/stories/docgen-components/9575-ts-camel-case/docgen.snapshot +0 -38
- package/template/stories/docgen-components/9575-ts-camel-case/input.tsx +0 -26
- package/template/stories/docgen-components/9575-ts-camel-case/properties.snapshot +0 -24
- package/template/stories/docgen-components/9586-js-react-memo/argTypes.snapshot +0 -41
- package/template/stories/docgen-components/9586-js-react-memo/docgen.snapshot +0 -42
- package/template/stories/docgen-components/9586-js-react-memo/input.jsx +0 -15
- package/template/stories/docgen-components/9586-js-react-memo/properties.snapshot +0 -34
- package/template/stories/docgen-components/9591-ts-import-types/Bar.tsx +0 -3
- package/template/stories/docgen-components/9591-ts-import-types/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/9591-ts-import-types/docgen.snapshot +0 -21
- package/template/stories/docgen-components/9591-ts-import-types/input.tsx +0 -10
- package/template/stories/docgen-components/9591-ts-import-types/properties.snapshot +0 -21
- package/template/stories/docgen-components/9626-js-default-values/argTypes.snapshot +0 -27
- package/template/stories/docgen-components/9626-js-default-values/docgen.snapshot +0 -25
- package/template/stories/docgen-components/9626-js-default-values/input.jsx +0 -5
- package/template/stories/docgen-components/9626-js-default-values/properties.snapshot +0 -21
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/argTypes.snapshot +0 -42
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/docgen.snapshot +0 -36
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/input.jsx +0 -13
- package/template/stories/docgen-components/9668-js-proptypes-no-jsdoc/properties.snapshot +0 -35
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/argTypes.snapshot +0 -34
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/docgen.snapshot +0 -38
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/input.tsx +0 -12
- package/template/stories/docgen-components/9721-ts-deprecated-jsdoc/properties.snapshot +0 -30
- package/template/stories/docgen-components/9764-ts-extend-props/argTypes.snapshot +0 -72
- package/template/stories/docgen-components/9764-ts-extend-props/docgen.snapshot +0 -41
- package/template/stories/docgen-components/9764-ts-extend-props/input.tsx +0 -17
- package/template/stories/docgen-components/9764-ts-extend-props/properties.snapshot +0 -56
- package/template/stories/docgen-components/9827-ts-default-values/argTypes.snapshot +0 -72
- package/template/stories/docgen-components/9827-ts-default-values/docgen.snapshot +0 -52
- package/template/stories/docgen-components/9827-ts-default-values/input.tsx +0 -17
- package/template/stories/docgen-components/9827-ts-default-values/properties.snapshot +0 -56
- package/template/stories/docgen-components/9832-ts-enum-export/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/9832-ts-enum-export/docgen.snapshot +0 -16
- package/template/stories/docgen-components/9832-ts-enum-export/input.tsx +0 -8
- package/template/stories/docgen-components/9832-ts-enum-export/properties.snapshot +0 -7
- package/template/stories/docgen-components/9922-ts-component-props/argTypes.snapshot +0 -25
- package/template/stories/docgen-components/9922-ts-component-props/docgen.snapshot +0 -35
- package/template/stories/docgen-components/9922-ts-component-props/input.tsx +0 -24
- package/template/stories/docgen-components/9922-ts-component-props/properties.snapshot +0 -21
- package/template/stories/docgen-components/js-class-component/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-class-component/docgen.snapshot +0 -252
- package/template/stories/docgen-components/js-class-component/input.jsx +0 -57
- package/template/stories/docgen-components/js-class-component/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-function-component/docgen.snapshot +0 -236
- package/template/stories/docgen-components/js-function-component/input.jsx +0 -50
- package/template/stories/docgen-components/js-function-component/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component-inline-defaults/argTypes.snapshot +0 -386
- package/template/stories/docgen-components/js-function-component-inline-defaults/docgen.snapshot +0 -247
- package/template/stories/docgen-components/js-function-component-inline-defaults/input.jsx +0 -65
- package/template/stories/docgen-components/js-function-component-inline-defaults/properties.snapshot +0 -286
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/argTypes.snapshot +0 -237
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/docgen.snapshot +0 -124
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/input.jsx +0 -41
- package/template/stories/docgen-components/js-function-component-inline-defaults-no-propTypes/properties.snapshot +0 -151
- package/template/stories/docgen-components/js-proptypes/docgen.snapshot +0 -1770
- package/template/stories/docgen-components/js-proptypes/input.jsx +0 -497
- package/template/stories/docgen-components/jsdoc/argTypes.snapshot +0 -1129
- package/template/stories/docgen-components/jsdoc/docgen.snapshot +0 -548
- package/template/stories/docgen-components/jsdoc/input.jsx +0 -231
- package/template/stories/docgen-components/jsdoc/properties.snapshot +0 -1017
- package/template/stories/docgen-components/ts-function-component/argTypes.snapshot +0 -396
- package/template/stories/docgen-components/ts-function-component/docgen.snapshot +0 -241
- package/template/stories/docgen-components/ts-function-component/input.tsx +0 -52
- package/template/stories/docgen-components/ts-function-component/properties.snapshot +0 -296
- package/template/stories/docgen-components/ts-function-component-inline-defaults/argTypes.snapshot +0 -279
- package/template/stories/docgen-components/ts-function-component-inline-defaults/docgen.snapshot +0 -151
- package/template/stories/docgen-components/ts-function-component-inline-defaults/input.tsx +0 -80
- package/template/stories/docgen-components/ts-function-component-inline-defaults/properties.snapshot +0 -177
- package/template/stories/docgen-components/ts-html/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/ts-html/docgen.snapshot +0 -12
- package/template/stories/docgen-components/ts-html/input.tsx +0 -12
- package/template/stories/docgen-components/ts-html/properties.snapshot +0 -7
- package/template/stories/docgen-components/ts-jsdoc/argTypes.snapshot +0 -3
- package/template/stories/docgen-components/ts-jsdoc/docgen.snapshot +0 -21
- package/template/stories/docgen-components/ts-jsdoc/input.tsx +0 -27
- package/template/stories/docgen-components/ts-jsdoc/properties.snapshot +0 -7
- package/template/stories/docgen-components/ts-types/argTypes.snapshot +0 -656
- package/template/stories/docgen-components/ts-types/docgen.snapshot +0 -317
- package/template/stories/docgen-components/ts-types/input.tsx +0 -130
- package/template/stories/docgen-components/ts-types/properties.snapshot +0 -410
- package/template/stories/errors.stories.tsx +0 -37
- package/template/stories/hooks.stories.tsx +0 -17
- package/template/stories/js-argtypes.stories.jsx +0 -91
- package/template/stories/react-mdx.stories.mdx +0 -26
- package/template/stories/teardown.stories.tsx +0 -23
- package/template/stories/ts-argtypes.stories.tsx +0 -104
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`react component properties ts-types 1`] = `
|
|
4
|
-
"import React from 'react';
|
|
5
|
-
function concat(a, b) {
|
|
6
|
-
return a + b;
|
|
7
|
-
}
|
|
8
|
-
var DefaultEnum = /*#__PURE__*/function (DefaultEnum) {
|
|
9
|
-
DefaultEnum[DefaultEnum[\\"TopLeft\\"] = 0] = \\"TopLeft\\";
|
|
10
|
-
DefaultEnum[DefaultEnum[\\"TopRight\\"] = 1] = \\"TopRight\\";
|
|
11
|
-
DefaultEnum[DefaultEnum[\\"TopCenter\\"] = 2] = \\"TopCenter\\";
|
|
12
|
-
return DefaultEnum;
|
|
13
|
-
}(DefaultEnum || {});
|
|
14
|
-
var NumericEnum = /*#__PURE__*/function (NumericEnum) {
|
|
15
|
-
NumericEnum[NumericEnum[\\"TopLeft\\"] = 0] = \\"TopLeft\\";
|
|
16
|
-
NumericEnum[NumericEnum[\\"TopRight\\"] = 1] = \\"TopRight\\";
|
|
17
|
-
NumericEnum[NumericEnum[\\"TopCenter\\"] = 2] = \\"TopCenter\\";
|
|
18
|
-
return NumericEnum;
|
|
19
|
-
}(NumericEnum || {});
|
|
20
|
-
var StringEnum = /*#__PURE__*/function (StringEnum) {
|
|
21
|
-
StringEnum[\\"TopLeft\\"] = \\"top-left\\";
|
|
22
|
-
StringEnum[\\"TopRight\\"] = \\"top-right\\";
|
|
23
|
-
StringEnum[\\"TopCenter\\"] = \\"top-center\\";
|
|
24
|
-
return StringEnum;
|
|
25
|
-
}(StringEnum || {});
|
|
26
|
-
export const TypeScriptProps = () => /*#__PURE__*/React.createElement(\\"div\\", null, \\"TypeScript!\\");
|
|
27
|
-
TypeScriptProps.defaultProps = {
|
|
28
|
-
any: 'Any value',
|
|
29
|
-
string: 'A string value',
|
|
30
|
-
bool: true,
|
|
31
|
-
number: 5,
|
|
32
|
-
voidFunc: () => {},
|
|
33
|
-
funcWithArgsAndReturns: concat,
|
|
34
|
-
symbol: Symbol('Default symbol'),
|
|
35
|
-
interface: {
|
|
36
|
-
text: 'foo',
|
|
37
|
-
value: 'bar'
|
|
38
|
-
},
|
|
39
|
-
genericInterface: {
|
|
40
|
-
value: 'A string value'
|
|
41
|
-
},
|
|
42
|
-
arrayOfPrimitive: ['foo', 'bar'],
|
|
43
|
-
arrayOfComplexObject: [{
|
|
44
|
-
text: 'foo',
|
|
45
|
-
value: 'bar'
|
|
46
|
-
}],
|
|
47
|
-
tupleOfPrimitive: ['string value', 5],
|
|
48
|
-
tupleWithComplexType: ['string value', {
|
|
49
|
-
text: 'foo',
|
|
50
|
-
value: 'bar'
|
|
51
|
-
}],
|
|
52
|
-
defaultEnum: DefaultEnum.TopRight,
|
|
53
|
-
numericEnum: NumericEnum.TopRight,
|
|
54
|
-
stringEnum: StringEnum.TopRight,
|
|
55
|
-
enumUnion: DefaultEnum.TopLeft,
|
|
56
|
-
recordOfPrimitive: {
|
|
57
|
-
foo: 1,
|
|
58
|
-
bar: 2
|
|
59
|
-
},
|
|
60
|
-
recordOfComplexObject: {
|
|
61
|
-
foo: {
|
|
62
|
-
text: 'bar',
|
|
63
|
-
value: 'bar2'
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
intersectionType: {
|
|
67
|
-
text: 'foo',
|
|
68
|
-
value: 'bar',
|
|
69
|
-
name: 'foo-bar'
|
|
70
|
-
},
|
|
71
|
-
intersectionWithInlineType: {
|
|
72
|
-
text: 'foo',
|
|
73
|
-
value: 'bar',
|
|
74
|
-
inlineValue: 'this is inlined'
|
|
75
|
-
},
|
|
76
|
-
unionOfPrimitive: 'A string value',
|
|
77
|
-
unionOfComplexType: {
|
|
78
|
-
text: 'foo',
|
|
79
|
-
value: 'bar'
|
|
80
|
-
},
|
|
81
|
-
nullableComplexTypeUndefinedDefaultValue: undefined,
|
|
82
|
-
typeAlias: 'foo',
|
|
83
|
-
aliasesUnion: 'foo',
|
|
84
|
-
genericAlias: {
|
|
85
|
-
value: 'foo'
|
|
86
|
-
},
|
|
87
|
-
namedStringLiteralUnion: 'top-right',
|
|
88
|
-
inlinedStringLiteralUnion: 'bottom-right',
|
|
89
|
-
namedNumericLiteralUnion: 0,
|
|
90
|
-
inlinedNumericLiteralUnion: 1
|
|
91
|
-
};
|
|
92
|
-
export const component = TypeScriptProps;
|
|
93
|
-
TypeScriptProps.__docgenInfo = {
|
|
94
|
-
\\"description\\": \\"\\",
|
|
95
|
-
\\"methods\\": [],
|
|
96
|
-
\\"displayName\\": \\"TypeScriptProps\\",
|
|
97
|
-
\\"props\\": {
|
|
98
|
-
\\"any\\": {
|
|
99
|
-
\\"defaultValue\\": {
|
|
100
|
-
\\"value\\": \\"'Any value'\\",
|
|
101
|
-
\\"computed\\": false
|
|
102
|
-
},
|
|
103
|
-
\\"required\\": false
|
|
104
|
-
},
|
|
105
|
-
\\"string\\": {
|
|
106
|
-
\\"defaultValue\\": {
|
|
107
|
-
\\"value\\": \\"'A string value'\\",
|
|
108
|
-
\\"computed\\": false
|
|
109
|
-
},
|
|
110
|
-
\\"required\\": false
|
|
111
|
-
},
|
|
112
|
-
\\"bool\\": {
|
|
113
|
-
\\"defaultValue\\": {
|
|
114
|
-
\\"value\\": \\"true\\",
|
|
115
|
-
\\"computed\\": false
|
|
116
|
-
},
|
|
117
|
-
\\"required\\": false
|
|
118
|
-
},
|
|
119
|
-
\\"number\\": {
|
|
120
|
-
\\"defaultValue\\": {
|
|
121
|
-
\\"value\\": \\"5\\",
|
|
122
|
-
\\"computed\\": false
|
|
123
|
-
},
|
|
124
|
-
\\"required\\": false
|
|
125
|
-
},
|
|
126
|
-
\\"voidFunc\\": {
|
|
127
|
-
\\"defaultValue\\": {
|
|
128
|
-
\\"value\\": \\"() => {}\\",
|
|
129
|
-
\\"computed\\": false
|
|
130
|
-
},
|
|
131
|
-
\\"required\\": false
|
|
132
|
-
},
|
|
133
|
-
\\"funcWithArgsAndReturns\\": {
|
|
134
|
-
\\"defaultValue\\": {
|
|
135
|
-
\\"value\\": \\"function concat(a: string, b: string): string {\\\\n return a + b;\\\\n}\\",
|
|
136
|
-
\\"computed\\": false
|
|
137
|
-
},
|
|
138
|
-
\\"required\\": false
|
|
139
|
-
},
|
|
140
|
-
\\"symbol\\": {
|
|
141
|
-
\\"defaultValue\\": {
|
|
142
|
-
\\"value\\": \\"Symbol('Default symbol')\\",
|
|
143
|
-
\\"computed\\": true
|
|
144
|
-
},
|
|
145
|
-
\\"required\\": false
|
|
146
|
-
},
|
|
147
|
-
\\"interface\\": {
|
|
148
|
-
\\"defaultValue\\": {
|
|
149
|
-
\\"value\\": \\"{ text: 'foo', value: 'bar' }\\",
|
|
150
|
-
\\"computed\\": false
|
|
151
|
-
},
|
|
152
|
-
\\"required\\": false
|
|
153
|
-
},
|
|
154
|
-
\\"genericInterface\\": {
|
|
155
|
-
\\"defaultValue\\": {
|
|
156
|
-
\\"value\\": \\"{ value: 'A string value' }\\",
|
|
157
|
-
\\"computed\\": false
|
|
158
|
-
},
|
|
159
|
-
\\"required\\": false
|
|
160
|
-
},
|
|
161
|
-
\\"arrayOfPrimitive\\": {
|
|
162
|
-
\\"defaultValue\\": {
|
|
163
|
-
\\"value\\": \\"['foo', 'bar']\\",
|
|
164
|
-
\\"computed\\": false
|
|
165
|
-
},
|
|
166
|
-
\\"required\\": false
|
|
167
|
-
},
|
|
168
|
-
\\"arrayOfComplexObject\\": {
|
|
169
|
-
\\"defaultValue\\": {
|
|
170
|
-
\\"value\\": \\"[{ text: 'foo', value: 'bar' }]\\",
|
|
171
|
-
\\"computed\\": false
|
|
172
|
-
},
|
|
173
|
-
\\"required\\": false
|
|
174
|
-
},
|
|
175
|
-
\\"tupleOfPrimitive\\": {
|
|
176
|
-
\\"defaultValue\\": {
|
|
177
|
-
\\"value\\": \\"['string value', 5]\\",
|
|
178
|
-
\\"computed\\": false
|
|
179
|
-
},
|
|
180
|
-
\\"required\\": false
|
|
181
|
-
},
|
|
182
|
-
\\"tupleWithComplexType\\": {
|
|
183
|
-
\\"defaultValue\\": {
|
|
184
|
-
\\"value\\": \\"['string value', { text: 'foo', value: 'bar' }]\\",
|
|
185
|
-
\\"computed\\": false
|
|
186
|
-
},
|
|
187
|
-
\\"required\\": false
|
|
188
|
-
},
|
|
189
|
-
\\"defaultEnum\\": {
|
|
190
|
-
\\"defaultValue\\": {
|
|
191
|
-
\\"value\\": \\"DefaultEnum.TopRight\\",
|
|
192
|
-
\\"computed\\": true
|
|
193
|
-
},
|
|
194
|
-
\\"required\\": false
|
|
195
|
-
},
|
|
196
|
-
\\"numericEnum\\": {
|
|
197
|
-
\\"defaultValue\\": {
|
|
198
|
-
\\"value\\": \\"NumericEnum.TopRight\\",
|
|
199
|
-
\\"computed\\": true
|
|
200
|
-
},
|
|
201
|
-
\\"required\\": false
|
|
202
|
-
},
|
|
203
|
-
\\"stringEnum\\": {
|
|
204
|
-
\\"defaultValue\\": {
|
|
205
|
-
\\"value\\": \\"StringEnum.TopRight\\",
|
|
206
|
-
\\"computed\\": true
|
|
207
|
-
},
|
|
208
|
-
\\"required\\": false
|
|
209
|
-
},
|
|
210
|
-
\\"enumUnion\\": {
|
|
211
|
-
\\"defaultValue\\": {
|
|
212
|
-
\\"value\\": \\"DefaultEnum.TopLeft\\",
|
|
213
|
-
\\"computed\\": true
|
|
214
|
-
},
|
|
215
|
-
\\"required\\": false
|
|
216
|
-
},
|
|
217
|
-
\\"recordOfPrimitive\\": {
|
|
218
|
-
\\"defaultValue\\": {
|
|
219
|
-
\\"value\\": \\"{ foo: 1, bar: 2 }\\",
|
|
220
|
-
\\"computed\\": false
|
|
221
|
-
},
|
|
222
|
-
\\"required\\": false
|
|
223
|
-
},
|
|
224
|
-
\\"recordOfComplexObject\\": {
|
|
225
|
-
\\"defaultValue\\": {
|
|
226
|
-
\\"value\\": \\"{ foo: { text: 'bar', value: 'bar2' } }\\",
|
|
227
|
-
\\"computed\\": false
|
|
228
|
-
},
|
|
229
|
-
\\"required\\": false
|
|
230
|
-
},
|
|
231
|
-
\\"intersectionType\\": {
|
|
232
|
-
\\"defaultValue\\": {
|
|
233
|
-
\\"value\\": \\"{ text: 'foo', value: 'bar', name: 'foo-bar' }\\",
|
|
234
|
-
\\"computed\\": false
|
|
235
|
-
},
|
|
236
|
-
\\"required\\": false
|
|
237
|
-
},
|
|
238
|
-
\\"intersectionWithInlineType\\": {
|
|
239
|
-
\\"defaultValue\\": {
|
|
240
|
-
\\"value\\": \\"{ text: 'foo', value: 'bar', inlineValue: 'this is inlined' }\\",
|
|
241
|
-
\\"computed\\": false
|
|
242
|
-
},
|
|
243
|
-
\\"required\\": false
|
|
244
|
-
},
|
|
245
|
-
\\"unionOfPrimitive\\": {
|
|
246
|
-
\\"defaultValue\\": {
|
|
247
|
-
\\"value\\": \\"'A string value'\\",
|
|
248
|
-
\\"computed\\": false
|
|
249
|
-
},
|
|
250
|
-
\\"required\\": false
|
|
251
|
-
},
|
|
252
|
-
\\"unionOfComplexType\\": {
|
|
253
|
-
\\"defaultValue\\": {
|
|
254
|
-
\\"value\\": \\"{ text: 'foo', value: 'bar' }\\",
|
|
255
|
-
\\"computed\\": false
|
|
256
|
-
},
|
|
257
|
-
\\"required\\": false
|
|
258
|
-
},
|
|
259
|
-
\\"nullableComplexTypeUndefinedDefaultValue\\": {
|
|
260
|
-
\\"defaultValue\\": {
|
|
261
|
-
\\"value\\": \\"undefined\\",
|
|
262
|
-
\\"computed\\": true
|
|
263
|
-
},
|
|
264
|
-
\\"required\\": false
|
|
265
|
-
},
|
|
266
|
-
\\"typeAlias\\": {
|
|
267
|
-
\\"defaultValue\\": {
|
|
268
|
-
\\"value\\": \\"'foo'\\",
|
|
269
|
-
\\"computed\\": false
|
|
270
|
-
},
|
|
271
|
-
\\"required\\": false
|
|
272
|
-
},
|
|
273
|
-
\\"aliasesUnion\\": {
|
|
274
|
-
\\"defaultValue\\": {
|
|
275
|
-
\\"value\\": \\"'foo'\\",
|
|
276
|
-
\\"computed\\": false
|
|
277
|
-
},
|
|
278
|
-
\\"required\\": false
|
|
279
|
-
},
|
|
280
|
-
\\"genericAlias\\": {
|
|
281
|
-
\\"defaultValue\\": {
|
|
282
|
-
\\"value\\": \\"{ value: 'foo' }\\",
|
|
283
|
-
\\"computed\\": false
|
|
284
|
-
},
|
|
285
|
-
\\"required\\": false
|
|
286
|
-
},
|
|
287
|
-
\\"namedStringLiteralUnion\\": {
|
|
288
|
-
\\"defaultValue\\": {
|
|
289
|
-
\\"value\\": \\"'top-right'\\",
|
|
290
|
-
\\"computed\\": false
|
|
291
|
-
},
|
|
292
|
-
\\"required\\": false
|
|
293
|
-
},
|
|
294
|
-
\\"inlinedStringLiteralUnion\\": {
|
|
295
|
-
\\"defaultValue\\": {
|
|
296
|
-
\\"value\\": \\"'bottom-right'\\",
|
|
297
|
-
\\"computed\\": false
|
|
298
|
-
},
|
|
299
|
-
\\"required\\": false
|
|
300
|
-
},
|
|
301
|
-
\\"namedNumericLiteralUnion\\": {
|
|
302
|
-
\\"defaultValue\\": {
|
|
303
|
-
\\"value\\": \\"0\\",
|
|
304
|
-
\\"computed\\": false
|
|
305
|
-
},
|
|
306
|
-
\\"required\\": false
|
|
307
|
-
},
|
|
308
|
-
\\"inlinedNumericLiteralUnion\\": {
|
|
309
|
-
\\"defaultValue\\": {
|
|
310
|
-
\\"value\\": \\"1\\",
|
|
311
|
-
\\"computed\\": false
|
|
312
|
-
},
|
|
313
|
-
\\"required\\": false
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
};"
|
|
317
|
-
`;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
function concat(a: string, b: string): string {
|
|
5
|
-
return a + b;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ItemInterface {
|
|
9
|
-
text: string;
|
|
10
|
-
value: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface PersonInterface {
|
|
14
|
-
name: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
type InterfaceIntersection = ItemInterface & PersonInterface;
|
|
18
|
-
|
|
19
|
-
interface GenericInterface<T> {
|
|
20
|
-
value: T;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
enum DefaultEnum {
|
|
24
|
-
TopLeft,
|
|
25
|
-
TopRight,
|
|
26
|
-
TopCenter,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
enum NumericEnum {
|
|
30
|
-
TopLeft = 0,
|
|
31
|
-
TopRight,
|
|
32
|
-
TopCenter,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
enum StringEnum {
|
|
36
|
-
TopLeft = 'top-left',
|
|
37
|
-
TopRight = 'top-right',
|
|
38
|
-
TopCenter = 'top-center',
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type EnumUnion = DefaultEnum | NumericEnum;
|
|
42
|
-
|
|
43
|
-
type StringLiteralUnion = 'top-left' | 'top-right' | 'top-center';
|
|
44
|
-
type NumericLiteralUnion = 0 | 1 | 2;
|
|
45
|
-
|
|
46
|
-
type StringAlias = string;
|
|
47
|
-
type NumberAlias = number;
|
|
48
|
-
type AliasesIntersection = StringAlias & NumberAlias;
|
|
49
|
-
type AliasesUnion = StringAlias | NumberAlias;
|
|
50
|
-
interface GenericAlias<T> {
|
|
51
|
-
value: T;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface TypeScriptPropsProps {
|
|
55
|
-
any: any;
|
|
56
|
-
string: string;
|
|
57
|
-
bool: boolean;
|
|
58
|
-
number: number;
|
|
59
|
-
voidFunc: () => void;
|
|
60
|
-
funcWithArgsAndReturns: (a: string, b: string) => string;
|
|
61
|
-
funcWithunionArg: (a: string | number) => string;
|
|
62
|
-
funcWithMultipleUnionReturns: () => string | ItemInterface;
|
|
63
|
-
funcWithIndexTypes: <T, K extends keyof T>(o: T, propertyNames: K[]) => T[K][];
|
|
64
|
-
symbol: symbol;
|
|
65
|
-
interface: ItemInterface;
|
|
66
|
-
genericInterface: GenericInterface<string>;
|
|
67
|
-
arrayOfPrimitive: string[];
|
|
68
|
-
arrayOfComplexObject: ItemInterface[];
|
|
69
|
-
tupleOfPrimitive: [string, number];
|
|
70
|
-
tupleWithComplexType: [string, ItemInterface];
|
|
71
|
-
defaultEnum: DefaultEnum;
|
|
72
|
-
numericEnum: NumericEnum;
|
|
73
|
-
stringEnum: StringEnum;
|
|
74
|
-
enumUnion: EnumUnion;
|
|
75
|
-
recordOfPrimitive: Record<string, number>;
|
|
76
|
-
recordOfComplexObject: Record<string, ItemInterface>;
|
|
77
|
-
intersectionType: InterfaceIntersection;
|
|
78
|
-
intersectionWithInlineType: ItemInterface & { inlineValue: string };
|
|
79
|
-
unionOfPrimitive: string | number;
|
|
80
|
-
unionOfComplexType: ItemInterface | InterfaceIntersection;
|
|
81
|
-
nullablePrimitive?: string;
|
|
82
|
-
nullableComplexType?: ItemInterface;
|
|
83
|
-
nullableComplexTypeUndefinedDefaultValue?: ItemInterface;
|
|
84
|
-
readonly readonlyPrimitive: string;
|
|
85
|
-
typeAlias: StringAlias;
|
|
86
|
-
aliasesIntersection: AliasesIntersection;
|
|
87
|
-
aliasesUnion: AliasesUnion;
|
|
88
|
-
genericAlias: GenericAlias<string>;
|
|
89
|
-
namedStringLiteralUnion: StringLiteralUnion;
|
|
90
|
-
inlinedStringLiteralUnion: 'bottom-left' | 'bottom-right' | 'bottom-center';
|
|
91
|
-
namedNumericLiteralUnion: NumericLiteralUnion;
|
|
92
|
-
inlinedNumericLiteralUnion: 0 | 1 | 2;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export const TypeScriptProps: FC<TypeScriptPropsProps> = () => <div>TypeScript!</div>;
|
|
96
|
-
TypeScriptProps.defaultProps = {
|
|
97
|
-
any: 'Any value',
|
|
98
|
-
string: 'A string value',
|
|
99
|
-
bool: true,
|
|
100
|
-
number: 5,
|
|
101
|
-
voidFunc: () => {},
|
|
102
|
-
funcWithArgsAndReturns: concat,
|
|
103
|
-
symbol: Symbol('Default symbol'),
|
|
104
|
-
interface: { text: 'foo', value: 'bar' },
|
|
105
|
-
genericInterface: { value: 'A string value' },
|
|
106
|
-
arrayOfPrimitive: ['foo', 'bar'],
|
|
107
|
-
arrayOfComplexObject: [{ text: 'foo', value: 'bar' }],
|
|
108
|
-
tupleOfPrimitive: ['string value', 5],
|
|
109
|
-
tupleWithComplexType: ['string value', { text: 'foo', value: 'bar' }],
|
|
110
|
-
defaultEnum: DefaultEnum.TopRight,
|
|
111
|
-
numericEnum: NumericEnum.TopRight,
|
|
112
|
-
stringEnum: StringEnum.TopRight,
|
|
113
|
-
enumUnion: DefaultEnum.TopLeft,
|
|
114
|
-
recordOfPrimitive: { foo: 1, bar: 2 },
|
|
115
|
-
recordOfComplexObject: { foo: { text: 'bar', value: 'bar2' } },
|
|
116
|
-
intersectionType: { text: 'foo', value: 'bar', name: 'foo-bar' },
|
|
117
|
-
intersectionWithInlineType: { text: 'foo', value: 'bar', inlineValue: 'this is inlined' },
|
|
118
|
-
unionOfPrimitive: 'A string value',
|
|
119
|
-
unionOfComplexType: { text: 'foo', value: 'bar' },
|
|
120
|
-
nullableComplexTypeUndefinedDefaultValue: undefined,
|
|
121
|
-
typeAlias: 'foo',
|
|
122
|
-
aliasesUnion: 'foo',
|
|
123
|
-
genericAlias: { value: 'foo' },
|
|
124
|
-
namedStringLiteralUnion: 'top-right',
|
|
125
|
-
inlinedStringLiteralUnion: 'bottom-right',
|
|
126
|
-
namedNumericLiteralUnion: 0,
|
|
127
|
-
inlinedNumericLiteralUnion: 1,
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const component = TypeScriptProps;
|