forked from nuotsu/sanitypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSanity.d.ts
107 lines (90 loc) · 1.74 KB
/
Sanity.d.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import type { SanityImageObject } from '@sanity/image-url/lib/types/types'
import type { SanityDocument } from 'next-sanity'
declare global {
namespace Sanity {
// documents
type Site = SanityDocument & {
title: string
ctas?: CTA[]
headerMenu?: Navigation
footerMenu?: Navigation
social?: Navigation
ogimage?: string
}
type Navigation = SanityDocument & {
title: string
items?: (Link | LinkList)[]
}
type PageBase = SanityDocument & {
title: string
metadata: Metadata
}
type Page = PageBase & {
readonly _type: 'page'
modules?: Module[]
}
type BlogPost = PageBase & {
readonly _type: 'blog.post'
body: any
readTime: number
headings?: { style: string; text: string }[]
categories: BlogCategory[]
publishDate: string
}
type BlogCategory = SanityDocument & {
title: string
}
type Logo = SanityDocument & {
name: string
image: {
default?: Image
light?: Image
dark?: Image
}
}
type Testimonial = SanityDocument & {
content: any
author?: {
name: string
title?: string
image?: Image
}
}
// objects
type CTA = {
link?: Link
style?: string
}
type Image = SanityImageObject &
Partial<{
alt: string
loading: 'lazy' | 'eager'
}>
type Link = {
readonly _type: 'link'
label: string
type: 'internal' | 'external'
internal?: Page | BlogPost
external?: string
params?: string
}
type LinkList = {
readonly _type: 'link.list'
label: string
links?: Link[]
}
type Metadata = {
title: string
description: string
slug: { current: string }
image?: Image
ogimage?: string
noIndex: boolean
}
type Module<T = any> = {
_type: T
_key: string
} & T
}
}
export {}