Skip to main content

Types

Author

type Author = {
id: string
email: string
firstName: string
lastName: string
avatarUrl?: string
company?: string
}

BlockPluginConstructor

type BlockPluginConstructor = (blockPlugin: BlockPlugin) => RichTextPlugin

Brick

type Brick<T = {}> = React.FC<T> & { schema: IBlockType }

Bricks

type Bricks = { [key: string]: Brick<any> }

BrickStory

type BrickStory<T = Props> = {
id: string
name: string
showAsBrick?: boolean
previewImageUrl?: string
props: T
}

Category

type type Category = {
categoryName: string
bricks: Brick<any>[]
}

CustomRole

type CustomRole = {
id: string
name: string
}

Language

type Language = {
code: string
name: string
}

MarkPluginConstructor

type MarkPluginConstructor = (markPlugin: MarkPlugin) => RichTextPlugin

Page

type Page = {
id: string
type: string
name: string
slug: string
meta: IMeta
customValues?: Props
externalData?: Props
content: IContentBlock[]
authorId?: string
author: Author
invalidBlocksTypes?: string[]
status: PageStatus
isLocked: boolean
tags: string[]
createdAt: string
publishedAt?: string
language: string
translations: Translation[]
}

PageFromList

type PageFromList = Omit<Page, 'content'>

PageFromListWithPagination

export type PagesFromListWithPagination = {
items: PageFromList[]
pagination: {
page: number
pageSize: number
totalItems: number
totalPages: number
}
}

PageValues

type PageValues = Omit<Page, 'content'>

PartialPage

type PartialPage = {
id?: string
type?: string
name?: string
slug?: string
meta?: IMeta
content?: IContentBlock[]
authorId?: string
author?: Author
invalidBlocksTypes?: string[]
status?: PageStatus
isLocked?: boolean
tags?: string[]
createdAt?: string
publishedAt?: string
language?: string
translations?: string[]
}

Permission

type Permission = {
canAddPage?: (user: PermissionUser, pageType: string) => boolean
canAddTranslation?: (
user: PermissionUser,
pageType: string,
language: string
) => boolean
canSeePageType?: (user: PermissionUser, pageType: string) => boolean
canSeePage?: (
user: PermissionUser,
page: Omit<PermissionPage, 'language'>
) => boolean
canEditPage?: (user: PermissionUser, page: PermissionPage) => boolean
canDeletePage?: (
user: PermissionUser,
page: Omit<PermissionPage, 'language'>
) => boolean
canDeleteTranslation?: (user: PermissionUser, page: PermissionPage) => boolean
canUseBrick?: (user: PermissionUser, brick: PermissionBrick) => boolean
}

PermissionBrick

type PermissionBrick = {
name: string
category: string
theme: string
tags: string[]
}

PermissionPage

type PermissionPage = {
slug: string
pageType: string
language: string
}

PermissionUser

type PermissionUser = {
firstName: string
lastName: string
email: string
isAdmin: boolean
role: string
customRole?: CustomRole
}

Props

type Props = { [key: string]: any }
type RenderLocalLink = ({
href,
target,
className,
activeClassName,
isAdmin,
children,
}: {
href: string
target?: string
className?: string
activeClassName?: string
isAdmin?: boolean
children: React.ReactNode
}) => React.ReactElement

RepeaterItems

type RepeaterItemDefault = IContentBlock | Omit<IContentBlock, 'id'> | Props
type RepeaterItems<T = RepeaterItemDefault> = Array<T>

Translation

type Translation = {
language: string
slug: string
}

Theme

type Theme = {
themeName: string
categories: Category[]
}

User

type User = {
id: string
email: string
firstName: string
lastName: string
company: string
avatarUrl?: string
isAdmin: boolean
token: string
appName: string
deployHookUrl?: string
deployHookMethod?: string
deployHookTriggerOnScheduledPublishing: boolean
deployHookStagingUrl?: string
deployHookStagingMethod?: string
deployHookStagingTriggerOnScheduledPublishing: boolean
eventsHookUrl?: string
canCreatePage: boolean
canDeletePage: boolean
canDeploy: boolean
canDeployStaging: boolean
role: string
plan: string
languages: Language[]
defaultLanguage: string
} | null