You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/gentype/latest/getting-started.mdx
+5-6
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,7 @@ For running `genType` with ReScript via `npm` workflow, no special setup is requ
42
42
## Configuration
43
43
44
44
Every `genType` powered project requires a configuration item `"gentypeconfig"`
45
-
at top level in the project's `bsconfig.json`. (The use of a separate file
46
-
`gentypeconfig.json` is being deprecated). The configuration has following
45
+
at top level in the project's `bsconfig.json`. The configuration has following
47
46
structure:
48
47
49
48
```js
@@ -63,12 +62,12 @@ structure:
63
62
-`"untyped"`: Generate `*.gen.js` files in vanilla JavaScript.
64
63
65
64
-**shims**
66
-
- e.g. `Array<string>` with format: `"RescriptModule=JavaScriptModule"`
67
-
-Required to export certain basic ReScript data types to JS when one cannot modify the sources to add annotations (e.g. exporting ReScript lists)
65
+
-Required only if one needs to export certain basic ReScript data types to JS when one cannot modify the sources to add annotations (e.g. exporting ReScript lists), and if the types are not first-classed in genType.
66
+
-Example: `Array<string>` with format: `"RescriptModule=JavaScriptModule"`
68
67
69
68
## Adding Shims (TS & Flow)
70
69
71
-
A shim is a TS / Flow file that provides user-defined definitions for library types.
70
+
A shim is a TS / Flow file that provides user-provided definitions for library types.
72
71
73
72
Configure your shim files within `"gentypeconfig"` in your [`bsconfig.json`](https://github.com/reason-association/genType/blob/master/examples/typescript-react-example/bsconfig.json), and add relevant `.shims.js` files in a directory which is visible by ReScript e.g. [`src/shims/`](https://github.com/reason-association/genType/blob/master/examples/typescript-react-example/src/shims). An example shim to export ReactEvent can be found [here](https://github.com/reason-association/genType/blob/master/examples/typescript-react-example/src/shims/ReactEvent.shim.ts).
74
73
@@ -90,8 +89,8 @@ We prepared some examples to give you an idea on how to integrate `genType` in y
90
89
91
90
**Please make sure to build genType before trying to build the examples.**
0 commit comments