-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.d.ts
102 lines (93 loc) · 1.98 KB
/
types.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
interface ApiError {
error: string;
}
type Topic = TopicsQuery['allTopics'][number];
interface TopicVote {
id: string;
votesCount: number;
isVoted: boolean | null;
}
type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
...args: any
) => Promise<infer R>
? R
: any;
type QueryOptions<
T extends (...args: any) => any,
U extends unknown[] | string = unknown[],
> = import('react-query').UseQueryOptions<
AsyncReturnType<T>,
import('axios').AxiosError<ApiError>,
AsyncReturnType<T>,
U
>;
type MutationOptions<T extends (...args: any) => any> = T extends (
args: infer Args,
...any: unknown[]
) => unknown
? import('react-query').UseMutationOptions<
AsyncReturnType<T>,
import('axios').AxiosError<ApiError>,
Args,
unknown
>
: never;
interface DatoFile {
alt?: string;
author?: string;
basename: string;
filename: string;
format: string;
height?: number;
id: string;
md5: string;
mimeType: string;
notes?: string;
responsiveImage?: any;
size: number;
smartTags: string;
tags: string;
title?: string;
url: string;
width?: number;
}
interface DatoLecturer {
avatar: DatoFile[];
createdAt: string;
id: string;
name: string;
slug: string;
updatedAt: string;
}
interface DatoTopic {
title: string;
description: string;
slug: string;
lecturers: DatoLecturer[];
icon: DatoFile[];
updated_at: string;
created_at: string;
}
interface PublishEventBody {
environment: 'main';
entity_type: 'item';
event_type: 'publish';
entity: {
id: string;
type: 'item';
attributes: DatoTopic;
relationships: { item_type: any; creator: any };
meta: {
created_at: string;
updated_at: string;
published_at: string;
publication_scheduled_at: string | null;
unpublishing_scheduled_at: string | null;
first_published_at: string;
is_valid: true;
status: 'published';
current_version: string;
stage: any | null;
};
};
}