-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathtypes.ts
116 lines (112 loc) · 3.08 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
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
108
109
110
111
112
113
114
115
116
export type PageKind = 'post' | 'page' | 'index' | 'series' | 'category';
export type PromiseValue<T> = T extends PromiseLike<infer R> ? R : T;
export type InferGetStaticPropsType<T extends (...args: any) => any> = PromiseValue<ReturnType<T>> extends infer Temp
? Temp extends {
readonly props: infer P;
}
? P
: never
: never;
export interface Series {
readonly name: string;
readonly slug: string;
readonly currentIndex: number;
readonly count: number;
}
export interface SeriesWithToC extends Series {
readonly links: readonly {
readonly permalink: string;
readonly title: string;
}[];
}
// Algolia
export interface TypeOfWebHit {
readonly title: string;
readonly date: string;
readonly permalink: string;
readonly type: 'post' | 'page';
readonly excerpt: string;
readonly series?: {
readonly slug: string;
readonly name: string;
} | null;
readonly category?: {
readonly slug: string;
readonly name: string;
} | null;
readonly authors: readonly string[];
readonly seo: {
readonly focusKeywords?: readonly string[];
readonly focusKeywordSynonyms?: readonly string[];
readonly metadesc?: string;
};
readonly content: string;
readonly objectID: string;
readonly img?: { readonly height: number; readonly width: number; readonly url: string } | null;
readonly _highlightResult: {
readonly title: {
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
};
readonly series: {
readonly name: {
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
};
};
readonly category: {
readonly name: {
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
};
};
readonly authors: readonly [
{
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
},
];
readonly seo: {
readonly focusKeywords: readonly [
{
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
},
{
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
},
{
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
},
];
readonly focusKeywordSynonyms: readonly [
{
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
},
];
readonly metadesc: {
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
};
};
readonly content: {
readonly value: string;
readonly matchLevel: string;
readonly matchedWords: readonly string[];
};
};
readonly __position: number;
readonly __queryID: string;
}