Skip to 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<T> }

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
}

EditingUser

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

Icon

type Icon = {
name: string
svg: string
url: string
set: string
}

Language

type Language = {
code: string
name: string
}

LastEditedBy

type LastEditedBy = {
date: string
user: EditingUser
}

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[]
workingContent?: IContentBlock[]
committedContent?: IContentBlock[]
authorId?: string
author: Author
invalidBlocksTypes?: string[]
status: PageStatus
editStatus: EditStatus
isLocked: boolean
tags: string[]
category?: string
createdAt: string
publishedAt?: string
scheduledForPublishingOn?: string
language: string
translations: Translation[]
lastEditedBy: LastEditedBy
}

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 = Partial<Page>

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
name: string
status: PageStatus
editStatus: EditStatus
isLocked: boolean
scheduledForPublishingOn: string
}

Theme

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

TemplateSlot

type TemplateSlot = {
slotName: string
label: string
min?: number
max?: number
allowedBlockTypes?: string[]
excludedBlockTypes?: string[]
editable?: boolean
getDefaultContent?: () => (string | IBrickStory | IContentBlock)[]
}

User

type User = {
id: string
email: string
firstName: string
lastName: string
company: string
avatarUrl?: string
isAdmin: boolean
token: string
appName: string
appId: string
appEnv: string
deployHookUrl?: string
deployHookMethod?: string
deployHookTriggerOnScheduledPublishing: boolean
deployHookStagingUrl?: string
deployHookStagingMethod?: string
deployHookStagingTriggerOnScheduledPublishing: boolean
deployHookDevUrl?: string
deployHookDevMethod?: string
deployHookDevTriggerOnScheduledPublishing: boolean
eventsHookUrl?: string
eventsHookAuthToken?: string
canCreatePage: boolean
canDeletePage: boolean
canDeploy: boolean
canDeployStaging: boolean
canDeployDev: boolean
canEditPageAttributes: boolean // add to dashboard
canEditSeo: boolean // add to dashboard
canApprove: boolean // add to dashboard
role: string
customRole?: CustomRole
plan: string
isVerified: boolean
languages: Language[]
defaultLanguage: string
hostname: string
useWorkingCopy: boolean
useApprovalWorkflow: boolean
} | null