.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / type-fest / ts41 / pascal-case.d.ts
1 import {CamelCase} from './camel-case';
2
3 /**
4 Converts a string literal to pascal-case.
5
6 @example
7 ```
8 import {PascalCase} from 'type-fest';
9
10 // Simple
11
12 const someVariable: PascalCase<'foo-bar'> = 'FooBar';
13
14 // Advanced
15
16 type PascalCaseProps<T> = {
17         [K in keyof T as PascalCase<K>]: T[K]
18 };
19
20 interface RawOptions {
21         'dry-run': boolean;
22         'full_family_name': string;
23         foo: number;
24 }
25
26 const dbResult: CamelCasedProps<ModelProps> = {
27         DryRun: true,
28         FullFamilyName: 'bar.js',
29         Foo: 123
30 };
31 ```
32 */
33
34 export type PascalCase<Value> = CamelCase<Value> extends string
35         ? Capitalize<CamelCase<Value>>
36         : CamelCase<Value>;