-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
71 lines (60 loc) · 1.2 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { PortableTextBlock } from "@portabletext/types";
interface SanityDefaults {
_id: string;
}
export interface SanitySlug {
_type: "slug";
current: string;
}
export interface SanityImage {
_type: "image";
asset: {
_ref: string;
_type: "reference";
metadata: {
lqip: string;
};
};
caption: string;
}
export type Project = SanityDefaults & {
name: string;
description: string;
link: string;
banner: SanityImage;
featured: boolean;
};
export type Post = SanityDefaults & {
slug: SanitySlug;
title: string;
description: string;
date: {
published: string;
updated: string;
} | null;
body: PortableTextBlock[];
};
export type PostPreview = Exclude<Post, "body">;
export interface Sections {
[year: number]: Post[];
}
export type Experience = SanityDefaults & {
company: string;
jobTitle: string;
employmentType: string;
date: {
start: string;
end: string;
};
link?: string;
body: PortableTextBlock[];
};
export type Social = SanityDefaults & {
networkName: string;
link: string;
icon: SanityImage;
};
export interface Children {
children: React.ReactNode | string;
}
export type WithChildren<Type> = Type & Children;