feat: graphql client with fetches for initial pages
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { ExternalLink } from "../utils/externalLink"
|
||||
import type { PageLink } from "../utils/pagelink"
|
||||
|
||||
enum ListItemStyleEnum {
|
||||
checkmark = "checkmark",
|
||||
default = "default",
|
||||
}
|
||||
|
||||
type ListItemStyle = keyof typeof ListItemStyleEnum
|
||||
|
||||
type ExternalLinkListItem = {
|
||||
list_item_external_link: {
|
||||
link: {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
}
|
||||
}
|
||||
|
||||
type InternalLinkListItem = {
|
||||
list_item_internal_link: {
|
||||
link_text?: string
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
pageConnection: Edges<ExternalLink | PageLink>
|
||||
}
|
||||
}
|
||||
|
||||
type RegularListItem = {
|
||||
list_item: {
|
||||
list_item_style: ListItemStyle
|
||||
subtitle?: string
|
||||
title: string
|
||||
}
|
||||
}
|
||||
|
||||
type ListItem = ExternalLinkListItem | InternalLinkListItem | RegularListItem
|
||||
|
||||
export type List = {
|
||||
list: {
|
||||
list_items: ListItem
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { SysAsset } from "../utils/asset"
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { ExternalLink } from "../utils/externalLink"
|
||||
import type { PageLink } from "../utils/pagelink"
|
||||
|
||||
export type Preamble = {
|
||||
preamble: {
|
||||
text: {
|
||||
json: JSON
|
||||
embedded_itemsConnection: Edges<
|
||||
| ExternalLink
|
||||
| PageLink
|
||||
| SysAsset
|
||||
>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { Puff } from "../puff"
|
||||
|
||||
export type PuffBlock = {
|
||||
puffs: {
|
||||
puffsConnection: Edges<Puff>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { RTERootObject } from "@/types/rte"
|
||||
import type { SysAsset } from "../utils/asset"
|
||||
import type { Edges } from "../utils/edges"
|
||||
import type { ExternalLink } from "../utils/externalLink"
|
||||
import type { PageLink } from "../utils/pagelink"
|
||||
|
||||
export type Text = {
|
||||
text: {
|
||||
content: {
|
||||
json: RTERootObject
|
||||
embedded_itemsConnection: Edges<
|
||||
| ExternalLink
|
||||
| PageLink
|
||||
| SysAsset
|
||||
>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user