-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocks.d.ts
36 lines (34 loc) 路 909 Bytes
/
blocks.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
export interface KirbyDefaultBlocks {
code: { code: string; language: string };
gallery: { images: string[] };
heading: { level: string; text: string };
image: {
location: string;
image: string[];
src: string;
alt: string;
caption: string;
link: string;
ratio: string;
crop: boolean;
};
list: { text: string };
markdown: { text: string };
quote: { text: string; citation: string };
text: { text: string };
video: { url: string; caption: string };
}
export interface KirbyBlock<
T extends string = keyof KirbyDefaultBlocks,
U extends Record<string, unknown> | undefined = undefined,
> {
content: U extends Record<string, unknown>
? U
: T extends keyof KirbyDefaultBlocks
? KirbyDefaultBlocks[T]
: Record<string, never>;
id: string;
isHidden: boolean;
type: T;
}
export type KirbyDefaultBlockType = keyof KirbyDefaultBlocks;