Interfaces

IAdminContext

interface IReadAdminContext {
isAdmin: boolean
previewMode: boolean
}

IBlockType

interface IBlockType {
name: string
label: string
getDefaultProps: () => object
hideFromAddMenu?: boolean
sideEditProps?: Array<ISideEditProp | ISideGroup>
repeaterItems?: IRepeaterItem[]
playgroundLinkUrl?: string
playgroundLinkLabel?: string
}

IColor

interface IColor {
color: string
[propName: string]: any
}

IContentBlock

interface IContentBlock {
id: string
type: string
props: Props
}

ICustomKnobProps

interface ICustomKnobProps {
id: string
value: any
onChange: any
isValid: boolean
}

IImageSource

interface IImageSource {
src: string
placeholderSrc?: string
srcSet?: string
alt?: string
seoName?: string
}

IMeta

interface IMeta {
title?: string
description?: string
language?: string
featuredImage?: string
}

IOption

interface IOption {
value: any
label: string
}

IPageType

interface IPageType {
name: string
pluralName: string
allowedBlockTypes?: string[]
excludedBlockTypes?: string[]
defaultLocked?: boolean
defaultStatus?: PageStatus
defaultLanguage?: string
defaultFeaturedImage?: string
getDefaultContent?: () => string[]
customFields?: Array<ISideEditPropPage | ISideGroup>
}

IReactBricksContext

interface IReactBricksContext {
appId: string
apiKey: string
bricks: Bricks
pageTypes: IPageType[]
logo: string
contentClassName: string
renderLocalLink: RenderLocalLink
navigate: (path: string) => void
loginPath: string
editorPath: string
playgroundPath: string
appSettingsPath: string
isDarkColorMode?: boolean
toggleColorMode?: () => void
useCssInJs?: boolean
clickToEditSide?: ClickToEditSide
customFields?: Array<ISideEditPropPage | ISideGroup>
responsiveBreakpoints: ResponsiveBreakpoint[]
enableAutoSave: boolean
disableSaveIfInvalidProps: boolean
}

IRepeaterItem

interface IRepeaterItem {
name: string
itemType: string
itemLabel?: string
min?: number
max?: number
}

ISideEditProp

interface ISideEditProp {
name: string
label: string
type: SideEditPropType
component?: React.FC<ICustomKnobProps>
shouldRefreshText?: boolean
validate?: (value: any, props?: Props) => boolean | string
show?: (props: Props) => boolean
imageOptions?: {
maxWidth: number
}
textareaOptions?: {
height?: number
}
rangeOptions?: {
min: number
max: number
step: number
}
selectOptions?: {
options?: IOption[]
getOptions?: () => IOption[] | Promise<IOption[]>
display: OptionsDisplay
}
}

ISideGroup

interface ISideGroup {
groupName: string
defaultOpen?: boolean
show?: (props: Props) => boolean
props: ISideEditProp[]
}

ReactBricksConfig

interface ReactBricksConfig {
appId: string
apiKey: string
bricks?: types.Brick<any>[]
pageTypes?: types.IPageType[]
logo?: string
contentClassName?: string
renderLocalLink: types.RenderLocalLink
navigate: (path: string) => void
loginPath?: string
editorPath?: string
playgroundPath?: string
appSettingsPath?: string
isDarkColorMode?: boolean
toggleColorMode?: () => void
useCssInJs?: boolean
appRootElement: string | HTMLElement
clickToEditSide?: ClickToEditSide
customFields?: Array<ISideEditPropPage | ISideGroup>
responsiveBreakpoints?: ResponsiveBreakpoint[]
enableAutoSave?: boolean
disableSaveIfInvalidProps?: boolean
}

ResponsiveBreakpoint

interface ResponsiveBreakpoint {
type: DeviceType
width: number | string
label: string
}