File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -89,3 +89,50 @@ node_modules/.bin/typedoc --declarationFile docs/v1.0/index.d.ts --maxVersion 1.
8989# write declaration file for types with a max version of 2.0
9090node_modules/.bin/typedoc --declarationFile docs/v2.0/index.d.ts --maxVersion 2.0
9191```
92+
93+ ## Inlining ` keyof ` types
94+
95+ You can use this plugin to * @inline * ` keyof ` types directly into a union to produce a more concise document and ` .d.ts ` file.
96+
97+ In addition to comments for each of the keys will also be documented as part of the ` @inline ` type.
98+
99+ ### Example
100+
101+ Sample file:
102+
103+ ``` ts
104+ /**
105+ * @inline
106+ */
107+ type SwitchState = keyof {
108+ /**
109+ * Switch is on
110+ */
111+ on: string ,
112+ /**
113+ * Switch is off
114+ */
115+ off: string ,
116+ /**
117+ * State of the switch is uknown
118+ *
119+ * @since 2.0
120+ */
121+ unknown: string ,
122+ };
123+ ```
124+
125+ Produces the following (with ` --maxVersion 1.0 ` ):
126+
127+ ``` ts
128+ /**
129+ * Options:
130+ *
131+ * - `on`:
132+ * Switch is on
133+ *
134+ * - `off`:
135+ * Switch is off
136+ */
137+ type SwitchState = " on" | " off" ;
138+ ```
You can’t perform that action at this time.
0 commit comments