|
| 1 | +type BuildTuple<T, N extends number, R extends T[] = []> = R["length"] extends N |
| 2 | + ? R |
| 3 | + : BuildTuple<T, N, [...R, T]>; |
| 4 | + |
| 5 | +type TuplePrefixes<T extends any[]> = T extends [any, ...infer Rest] |
| 6 | + ? T | TuplePrefixes<Rest extends any[] ? Rest : []> |
| 7 | + : []; |
| 8 | + |
| 9 | +type MaxTuple<T, N extends number> = TuplePrefixes<BuildTuple<T, N>>; |
| 10 | + |
| 11 | +export interface PublishDetails { |
| 12 | + environment: string; |
| 13 | + locale: string; |
| 14 | + time: string; |
| 15 | + user: string; |
| 16 | +} |
| 17 | + |
| 18 | +export interface File { |
| 19 | + uid: string; |
| 20 | + created_at: string; |
| 21 | + updated_at: string; |
| 22 | + created_by: string; |
| 23 | + updated_by: string; |
| 24 | + content_type: string; |
| 25 | + file_size: string; |
| 26 | + tags: string[]; |
| 27 | + filename: string; |
| 28 | + url: string; |
| 29 | + ACL: any[] | object; |
| 30 | + is_dir: boolean; |
| 31 | + parent_uid: string; |
| 32 | + _version: number; |
| 33 | + title: string; |
| 34 | + _metadata?: object; |
| 35 | + publish_details: PublishDetails; |
| 36 | +} |
| 37 | + |
| 38 | +export interface Link { |
| 39 | + title: string; |
| 40 | + href: string; |
| 41 | +} |
| 42 | + |
| 43 | +export interface Taxonomy { |
| 44 | + taxonomy_uid: string; |
| 45 | + max_terms?: number; |
| 46 | + mandatory: boolean; |
| 47 | + non_localizable: boolean; |
| 48 | +} |
| 49 | + |
| 50 | +export interface JSONRTENode { |
| 51 | + type: string; |
| 52 | + uid: string; |
| 53 | + _version: number; |
| 54 | + attrs: Record<string, any>; |
| 55 | + children?: JSONRTENode[]; |
| 56 | + text?: string; |
| 57 | + bold?: boolean; |
| 58 | + italic?: boolean; |
| 59 | + underline?: boolean; |
| 60 | + src?: string; |
| 61 | + alt?: string; |
| 62 | + href?: string; |
| 63 | + target?: string; |
| 64 | + embed?: { |
| 65 | + type: string; |
| 66 | + uid: string; |
| 67 | + _version: number; |
| 68 | + attrs: Record<string, any>; |
| 69 | + }; |
| 70 | +} |
| 71 | + |
| 72 | +export interface GfV1 { |
| 73 | + /** Version */ |
| 74 | + _version: number; |
| 75 | + /** Single Line Textbox v1 */ |
| 76 | + single_line_textbox_v1?: string; |
| 77 | + /** Reference */ |
| 78 | + reference?: Page[]; |
| 79 | + /** new multiline v2 */ |
| 80 | + new_multiline_v2?: string; |
| 81 | +} |
| 82 | + |
| 83 | +/** It contains SEO related information. */ |
| 84 | +export interface Seo { |
| 85 | + /** Version */ |
| 86 | + _version: number; |
| 87 | + /** Meta Title */ |
| 88 | + meta_title?: string; |
| 89 | + /** Meta Description */ |
| 90 | + meta_description?: string; |
| 91 | + /** Meta Keywords */ |
| 92 | + keywords?: string; |
| 93 | + /** Enable Search Indexing */ |
| 94 | + enable_search_indexing?: boolean; |
| 95 | +} |
| 96 | + |
| 97 | +export interface PageComponents { |
| 98 | + hero_banner: { |
| 99 | + /** Banner Image */ |
| 100 | + banner_image?: File | null; |
| 101 | + /** Bg color */ |
| 102 | + bg_color?: string; |
| 103 | + /** Banner Title */ |
| 104 | + banner_title?: string; |
| 105 | + /** Banner Description */ |
| 106 | + banner_description?: string; |
| 107 | + /** Call to Action */ |
| 108 | + call_to_action?: Link; |
| 109 | + }; |
| 110 | + contact_details: { |
| 111 | + /** Address */ |
| 112 | + address?: string; |
| 113 | + /** Phone */ |
| 114 | + phone?: string; |
| 115 | + /** Email */ |
| 116 | + email?: string; |
| 117 | + }; |
| 118 | + section_with_buckets: { |
| 119 | + /** Title H2 */ |
| 120 | + title_h2?: string; |
| 121 | + /** Description */ |
| 122 | + description?: string; |
| 123 | + /** Buckets */ |
| 124 | + buckets?: { |
| 125 | + /** Title H3 */ |
| 126 | + title_h3?: string; |
| 127 | + /** Description */ |
| 128 | + description?: { |
| 129 | + type: string; |
| 130 | + uid: string; |
| 131 | + _version: number; |
| 132 | + attrs: Record<string, any>; |
| 133 | + children: JSONRTENode[]; |
| 134 | + }; |
| 135 | + /** Icon */ |
| 136 | + icon?: File | null; |
| 137 | + /** Call to Action */ |
| 138 | + call_to_action?: Link; |
| 139 | + }[]; |
| 140 | + }; |
| 141 | + section: { |
| 142 | + /** Title H2 */ |
| 143 | + title_h2?: string; |
| 144 | + /** Description */ |
| 145 | + description?: string; |
| 146 | + /** Call to Action */ |
| 147 | + call_to_action?: Link; |
| 148 | + /** Image */ |
| 149 | + image?: File | null; |
| 150 | + /** Image Alignment */ |
| 151 | + image_alignment?: ("Left" | "Right") | null; |
| 152 | + }; |
| 153 | + section_with_cards: { |
| 154 | + /** Cards */ |
| 155 | + cards?: MaxTuple< |
| 156 | + { |
| 157 | + /** Title H3 */ |
| 158 | + title_h3?: string; |
| 159 | + /** Description */ |
| 160 | + description?: string; |
| 161 | + /** Call to Action */ |
| 162 | + call_to_action?: Link; |
| 163 | + }, |
| 164 | + 3 |
| 165 | + >; |
| 166 | + }; |
| 167 | + section_with_html_code: { |
| 168 | + /** Title */ |
| 169 | + title?: string; |
| 170 | + /** Description */ |
| 171 | + description?: { |
| 172 | + type: string; |
| 173 | + uid: string; |
| 174 | + _version: number; |
| 175 | + attrs: Record<string, any>; |
| 176 | + children: JSONRTENode[]; |
| 177 | + }; |
| 178 | + /** HTML Code */ |
| 179 | + html_code?: string; |
| 180 | + /** HTML Code Alignment */ |
| 181 | + html_code_alignment?: ("Left" | "Right") | null; |
| 182 | + }; |
| 183 | + from_blog: { |
| 184 | + /** Title H2 */ |
| 185 | + title_h2?: string; |
| 186 | + /** Featured Blogs */ |
| 187 | + featured_blogs?: BlogPost[]; |
| 188 | + /** View Articles */ |
| 189 | + view_articles?: Link; |
| 190 | + }; |
| 191 | + our_team: { |
| 192 | + /** Title H2 */ |
| 193 | + title_h2?: string; |
| 194 | + /** Description */ |
| 195 | + description?: string; |
| 196 | + /** Employees */ |
| 197 | + employees?: { |
| 198 | + /** Name */ |
| 199 | + name?: string; |
| 200 | + /** Designation */ |
| 201 | + designation?: string; |
| 202 | + /** Image */ |
| 203 | + image?: File | null; |
| 204 | + }[]; |
| 205 | + }; |
| 206 | + widget: { |
| 207 | + /** Title H2 */ |
| 208 | + title_h2?: string; |
| 209 | + /** Type */ |
| 210 | + type?: ("Blog Archive" | "Related Posts") | null; |
| 211 | + }; |
| 212 | +} |
| 213 | + |
| 214 | +/** Re-usable content template that can be extended to fit many use cases. Example: Landing page, Contact page, About page, etc. */ |
| 215 | +export interface Page { |
| 216 | + /** Version */ |
| 217 | + _version: number; |
| 218 | + /** Title */ |
| 219 | + title: string; |
| 220 | + /** URL */ |
| 221 | + url?: string; |
| 222 | + /** Page Components */ |
| 223 | + page_components?: PageComponents[]; |
| 224 | + /** SEO */ |
| 225 | + seo?: Seo; |
| 226 | + /** Rich Text Editor */ |
| 227 | + rich_text_editor1?: string; |
| 228 | + /** JSON Rich Text Editor */ |
| 229 | + json_rte1?: { |
| 230 | + type: string; |
| 231 | + uid: string; |
| 232 | + _version: number; |
| 233 | + attrs: Record<string, any>; |
| 234 | + children: JSONRTENode[]; |
| 235 | + }; |
| 236 | +} |
| 237 | + |
| 238 | +/** It contains the company logo, main navigation and notification bar. */ |
| 239 | +export interface Header { |
| 240 | + /** Version */ |
| 241 | + _version: number; |
| 242 | + /** Title */ |
| 243 | + title: string; |
| 244 | + /** Logo */ |
| 245 | + logo?: File | null; |
| 246 | + /** Navigation Menu */ |
| 247 | + navigation_menu?: MaxTuple< |
| 248 | + { |
| 249 | + /** Label */ |
| 250 | + label?: string; |
| 251 | + /** Page Reference */ |
| 252 | + page_reference?: Page[]; |
| 253 | + }, |
| 254 | + 10 |
| 255 | + >; |
| 256 | + /** Notification Bar */ |
| 257 | + notification_bar?: { |
| 258 | + /** Announcement Text */ |
| 259 | + announcement_text?: { |
| 260 | + type: string; |
| 261 | + uid: string; |
| 262 | + _version: number; |
| 263 | + attrs: Record<string, any>; |
| 264 | + children: JSONRTENode[]; |
| 265 | + }; |
| 266 | + /** Show Announcement? */ |
| 267 | + show_announcement?: boolean; |
| 268 | + }; |
| 269 | +} |
| 270 | + |
| 271 | +/** It contains blog authors */ |
| 272 | +export interface Author { |
| 273 | + /** Version */ |
| 274 | + _version: number; |
| 275 | + /** Full Name */ |
| 276 | + title: string; |
| 277 | + /** Picture */ |
| 278 | + picture?: File | null; |
| 279 | + /** Bio */ |
| 280 | + bio?: string; |
| 281 | + /** New multiline v1 */ |
| 282 | + new_multiline_v1?: string; |
| 283 | + /** new multiline v2 */ |
| 284 | + new_multiline_v2?: string; |
| 285 | + /** Multi Line Textbox v3 */ |
| 286 | + multi_line_textbox_v3?: string; |
| 287 | + /** JSON Rich Text Editor */ |
| 288 | + json_rte?: { |
| 289 | + type: string; |
| 290 | + uid: string; |
| 291 | + _version: number; |
| 292 | + attrs: Record<string, any>; |
| 293 | + children: JSONRTENode[]; |
| 294 | + }; |
| 295 | +} |
| 296 | + |
| 297 | +/** It contains navigation, social media links and copyright text. */ |
| 298 | +export interface Footer { |
| 299 | + /** Version */ |
| 300 | + _version: number; |
| 301 | + /** Title */ |
| 302 | + title: string; |
| 303 | + /** Logo */ |
| 304 | + logo?: File | null; |
| 305 | + /** Navigation */ |
| 306 | + navigation?: { |
| 307 | + /** Link */ |
| 308 | + link?: Link[]; |
| 309 | + }; |
| 310 | + /** Social */ |
| 311 | + social?: { |
| 312 | + /** Social Share */ |
| 313 | + social_share?: { |
| 314 | + /** Link */ |
| 315 | + link?: Link; |
| 316 | + /** Icon */ |
| 317 | + icon?: File | null; |
| 318 | + }[]; |
| 319 | + }; |
| 320 | + /** Copyright */ |
| 321 | + copyright?: { |
| 322 | + type: string; |
| 323 | + uid: string; |
| 324 | + _version: number; |
| 325 | + attrs: Record<string, any>; |
| 326 | + children: JSONRTENode[]; |
| 327 | + }; |
| 328 | +} |
| 329 | + |
| 330 | +/** It contains blog posts */ |
| 331 | +export interface BlogPost { |
| 332 | + /** Version */ |
| 333 | + _version: number; |
| 334 | + /** Title */ |
| 335 | + title: string; |
| 336 | + /** URL */ |
| 337 | + url?: string; |
| 338 | + /** Author */ |
| 339 | + author?: Author[]; |
| 340 | + /** Date */ |
| 341 | + date?: string | null; |
| 342 | + /** Featured Image */ |
| 343 | + featured_image?: File | null; |
| 344 | + /** Body */ |
| 345 | + body?: { |
| 346 | + type: string; |
| 347 | + uid: string; |
| 348 | + _version: number; |
| 349 | + attrs: Record<string, any>; |
| 350 | + children: JSONRTENode[]; |
| 351 | + }; |
| 352 | + /** Related Post */ |
| 353 | + related_post?: BlogPost[]; |
| 354 | + /** Is Archived? */ |
| 355 | + is_archived?: boolean; |
| 356 | + /** SEO */ |
| 357 | + seo?: Seo; |
| 358 | +} |
0 commit comments