-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
38 lines (33 loc) · 1.11 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { Adapter } from "./adapters/adapter";
import { CONVENTIONS } from "./constants";
type Obj = { name: string; adapter: Adapter };
export type ConvConvThis = ConvConv & Obj;
export type Convention = (typeof CONVENTIONS)[number];
export interface ConvConv {
toConvention(convention: Convention): string;
toKebab(): string;
toCamel(): string;
toSnake(): string;
toPascal(): string;
toScreamingKebab(): string;
toScreamingSnake(): string;
}
export interface From {
autoFrom(name: string): ConvConv;
fromConvention(convention: Convention, name: string): ConvConv;
fromKebab(name: string): ConvConv;
fromCamel(name: string): ConvConv;
fromSnake(name: string): ConvConv;
fromPascal(name: string): ConvConv;
fromScreamingKebab(name: string): ConvConv;
fromScreamingSnake(name: string): ConvConv;
}
export interface Is {
isConvention(convention: Convention, name: string): boolean;
isKebab(name: string): boolean;
isCamel(name: string): boolean;
isSnake(name: string): boolean;
isPascal(name: string): boolean;
isScreamingKebab(name: string): boolean;
isScreamingSnake(name: string): boolean;
}