Skip to content

Commit 6d6b2d4

Browse files
halfnibbleskovy
authored andcommitted
docs(cli): add documentation for exportTypeName/exportTypeInterface
1 parent d67c236 commit 6d6b2d4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,34 @@ export default styles;
194194

195195
This export type is useful when using kebab (param) cased class names since variables with a `-` are not valid variables and will produce invalid types or when a class name is a TypeScript keyword (eg: `while` or `delete`). Additionally, the `Styles` and `ClassNames` types are exported which can be useful for properly typing variables, functions, etc. when working with dynamic class names.
196196

197+
### `--exportTypeName`
198+
199+
- **Type**: `string`
200+
- **Default**: `"ClassNames"`
201+
- **Example**: `tsm src --exportType default --exportTypeName ClassesType`
202+
203+
Customize the type name exported in the generated file when `--exportType` is set to `"default"`.
204+
Only default exports are affected by this command. This example will change the export type line to:
205+
206+
```typescript
207+
export type ClassesType = keyof Styles;
208+
```
209+
210+
### `--exportTypeInterface`
211+
212+
- **Type**: `string`
213+
- **Default**: `"Styles"`
214+
- **Example**: `tsm src --exportType default --exportTypeInterface IStyles`
215+
216+
Customize the interface name exported in the generated file when `--exportType` is set to `"default"`.
217+
Only default exports are affected by this command. This example will change the export interface line to:
218+
219+
```typescript
220+
export interface IStyles {
221+
// ...
222+
}
223+
```
224+
197225
### `--quoteType` (`-q`)
198226

199227
- **Type**: `"single" | "double"`

0 commit comments

Comments
 (0)