.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / type-fest / ts41 / kebab-case.d.ts
1 import {DelimiterCase} from './delimiter-case';
2
3 /**
4 Convert a string literal to kebab-case.
5
6 This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag.
7
8 @example
9 ```
10 import {KebabCase} from 'type-fest';
11
12 // Simple
13
14 const someVariable: KebabCase<'fooBar'> = 'foo-bar';
15
16 // Advanced
17
18 type KebabCasedProps<T> = {
19         [K in keyof T as KebabCase<K>]: T[K]
20 };
21
22 interface CliOptions {
23         dryRun: boolean;
24         includeFile: string;
25         foo: number;
26 }
27
28 const rawCliOptions: KebabCasedProps<CliOptions> = {
29         'dry-run': true,
30         'include-file': 'bar.js',
31         foo: 123
32 };
33 ```
34 */
35
36 export type KebabCase<Value> = DelimiterCase<Value, '-'>;