-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtype.ts
More file actions
36 lines (28 loc) · 795 Bytes
/
type.ts
File metadata and controls
36 lines (28 loc) · 795 Bytes
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
import {Prop, PropType} from 'vue';
const aligns = ['baseline', 'center', 'end', 'start', 'stretch'] as const;
type Align = typeof aligns[number];
const alignProp: Prop<Align> = {
type: String as PropType<Align>,
default: undefined,
validator: (a: Align) => aligns.includes(a),
};
const gutterProp: Prop<number | string> = {
type: [Number, String],
default: undefined,
};
const justifies = ['around', 'between', 'center', 'end', 'evenly', 'start'] as const;
type Justify = typeof justifies[number];
const justifyProp: Prop<Justify> = {
type: String as PropType<Justify>,
default: undefined,
validator: (j: Justify) => justifies.includes(j),
};
export {
Align,
alignProp,
aligns,
gutterProp,
Justify,
justifies,
justifyProp,
};