feat: json rich text editor, blocks, asides, general structure
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Image } from "@/types/image"
|
||||
import type { Typename } from "./typename"
|
||||
|
||||
export type Asset = {
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type SysAsset = Typename<Asset, "SysAsset">
|
||||
export type SysAsset = Typename<Image, EmbedEnum.SysAsset>
|
||||
|
||||
7
types/requests/utils/embeds.ts
Normal file
7
types/requests/utils/embeds.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export enum EmbedEnum {
|
||||
CurrentBlocksPage = "CurrentBlocksPage",
|
||||
SysAsset = "SysAsset",
|
||||
TempPage = "TempPage",
|
||||
}
|
||||
|
||||
export type Embed = keyof typeof EmbedEnum
|
||||
@@ -1,5 +1,12 @@
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
|
||||
export type ExternalLink = {
|
||||
__typename: "TempPage"
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export type ExternalLinkType = Typename<ExternalLink, EmbedEnum.TempPage>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
|
||||
export type PageLink = {
|
||||
__typename: "CurrentBlocksPage"
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
|
||||
export type PageLinkType = Typename<PageLink, EmbedEnum.CurrentBlocksPage>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
export const AsideTypenames = {
|
||||
CurrentBlocksPageAsideContact: "CurrentBlocksPageAsideContact",
|
||||
CurrentBlocksPageAsidePuff: "CurrentBlocksPageAsidePuff",
|
||||
}
|
||||
|
||||
export enum AsideTypenameEnum {
|
||||
CurrentBlocksPageAsideContact = "CurrentBlocksPageAsideContact",
|
||||
CurrentBlocksPageAsidePuff = "CurrentBlocksPageAsidePuff",
|
||||
@@ -10,15 +5,6 @@ export enum AsideTypenameEnum {
|
||||
|
||||
export type AsideTypename = keyof typeof AsideTypenameEnum
|
||||
|
||||
export const blocksTypenameEnum = {
|
||||
CurrentBlocksPageBlocksList: "CurrentBlocksPageBlocksList",
|
||||
CurrentBlocksPageBlocksPreamble: "CurrentBlocksPageBlocksPreamble",
|
||||
CurrentBlocksPageBlocksPuffs: "CurrentBlocksPageBlocksPuffs",
|
||||
CurrentBlocksPageBlocksText: "CurrentBlocksPageBlocksText",
|
||||
}
|
||||
|
||||
export type BlocksTypename = keyof typeof blocksTypenameEnum
|
||||
|
||||
export enum BlocksTypenameEnum {
|
||||
CurrentBlocksPageBlocksList = "CurrentBlocksPageBlocksList",
|
||||
CurrentBlocksPageBlocksPreamble = "CurrentBlocksPageBlocksPreamble",
|
||||
@@ -26,6 +12,8 @@ export enum BlocksTypenameEnum {
|
||||
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
||||
}
|
||||
|
||||
export type BlocksTypename = keyof typeof BlocksTypenameEnum
|
||||
|
||||
export type Typename<T, K> = T & {
|
||||
__typename: K
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user