Interfaces

IBlockType

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

IRepeaterItem

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

IContentBlock

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

IOption

interface IOption {
value: any
label: string
}

ISideEditProp

interface ISideEditProp {
name: string
label: string
type: SideEditPropType
shouldRefreshText?: boolean
validate?: (value: any, props?: Props) => boolean
show?: (props: Props) => boolean
imageOptions?: {
maxWidth: 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[]
}

IFocused

interface IFocused {
blockId: string
itemId: string
repeaterPropName: string
}

IImageSource

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

IColor

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

IPageType

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

ICleanBlocks

interface ICleanBlocks {
blocks: IContentBlock[]
invalidBlocksTypes: string[]
}

ILoginCredentials

interface ILoginCredentials {
email: string
password: string
appId: string
}

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
}

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
}

IAdminContext

interface IAdminContext {
isAdmin: boolean
currentPage: string
setCurrentPage: (page: string) => void
previewMode: boolean
setPreviewMode: (previewMode: boolean) => void
sidebarCollapsed: boolean
setSidebarCollapsed: (sidebarCollapsed: boolean) => void
getStyles: () => NodeListOf<HTMLStyleElement> | []
getStylesheets: () => NodeListOf<HTMLLinkElement> | []
}

IBlockContext

interface IBlockContext {
values: Props
onChange: (field: string, value: any) => void
blockId: string
parentId: string
parentType: string
handleChange: (
blockId: string,
parentBlockId?: string,
repeaterPropName?: string
) => (field: string, value: any) => void
handleAddItem?: (
blockId: string,
itemBlockPropName: string,
itemBlockTypeName: string
) => () => void
}

IContentEditorContext

interface IContentEditorContext {
focused: IFocused
setFocused: (focused: IFocused) => void
triggerTextRefreshBlockId: string
setTriggerTextRefreshBlockId: (value: string) => void
setAddAfterBlockId: (addAfterBlockId: string) => void
}

INewPage

interface INewPage {
id?: string
type: string
name: string
slug?: string
meta?: IMeta
content?: IContentBlock[]
status?: PageStatus
isLocked?: boolean
}

IPlaygroundSelectedItem

interface IPlaygroundSelectedItem {
type: PlaygroundSelectedItemType
name: string
label: string
}

IPlaygroundContext

interface IPlaygroundContext {
selectedItem: IPlaygroundSelectedItem | null
setSelectedItem: (selectedItem: any) => void
}

IMeta

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

IQueryResult

interface IQueryResult<TResult, TError = undefined> {
canFetchMore: boolean | undefined
clear: () => void
data: TResult | undefined | null
error: TError | null
failureCount: number
fetchMore: (fetchMoreVariable?: unknown, options?: any) => Promise<TResult | undefined>
isError: boolean
isFetched: boolean
isFetchedAfterMount: boolean
isFetching: boolean
isFetchingMore?: any
isIdle: boolean
isInitialData: boolean
isLoading: boolean
isPreviousData: boolean
isPlaceholderData: boolean
isStale: boolean
isSuccess: boolean
refetch: (options?: any) => Promise<TResult | undefined>
remove: () => void
status: any
updatedAt: number
}