-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathtypings.ts
108 lines (98 loc) · 2.52 KB
/
typings.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
import {Options} from "json-schema-to-typescript";
import {JSONSchema4} from "json-schema";
export type GenericType =
'text'
| 'bloks'
| 'array'
| 'option'
| 'options'
| 'number'
| 'image'
| 'boolean'
| 'textarea'
| 'markdown'
| 'richtext'
| 'datetime'
| 'asset' | 'multiasset' | 'multilink' | 'table'
export type BasicType = 'asset' | 'multiasset' | 'multilink' | 'table' | 'richtext'
export type CompilerOptions = Partial<Options>;
export type ResolveLinkOption = "url" | "link" | "story"
export interface StoryblokResolveOptions {
resolveLinks: ResolveLinkOption[]
}
export interface StoryblokTsOptions {
componentsJson: {
components: JSONSchema4[]
},
customTypeParser?: (key: string, options: JSONSchema4) => void
compilerOptions?: CompilerOptions
path?: string
resolveLinks?: ResolveLinkOption[]
titleSuffix?: string
titlePrefix?: string
}
export interface CliOptions {
source: string
target?: string
resolveLinks?: string | string[]
titleSuffix?: string
titlePrefix?: string
customTypeParser?: string
compilerOptions?: CompilerOptions
}
export interface StoryblokSchemaElementOption {
_uid: string
name: string
value: string
}
export interface StoryblokSchemaElement {
type: GenericType
pos: number
key: string
use_uuid?: boolean
source?: "internal" | "external" | "internal_stories" | "internal_languages"
options?: StoryblokSchemaElementOption[],
filter_content_type?: string[]
restrict_components?: boolean
component_whitelist?: string[]
component_group_whitelist?: string[]
restrict_type?: "groups" | ""
exclude_empty_option?: boolean
}
export interface StoryblokStory<TContent> {
name: string
created_at: string
published_at: string
id: number
uuid: string
content: TContent;
slug: string
full_slug: string
sort_by_date: string | null;
position: number
tag_list: string[]
is_startpage: boolean;
parent_id: number;
meta_data: any;
group_id: string
first_published_at: string | null;
release_id?: number | null;
lang: string;
path?: string;
alternates: {
id: number;
name: string;
slug: string;
published: boolean;
full_slug: string;
is_folder: boolean;
parent_id: number;
}[]
default_full_slug: string
translated_slugs: {
path: string;
name: string | null;
lang: string
}[]
_stopResolving?: boolean;
}