Interfaces
FetchPagesType
Section titled “FetchPagesType”interface FetchPagesType { <T extends boolean>( apiKey: string, { type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: { type?: string types?: string[] tag?: string language?: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } usePagination: T } ): Promise<T extends true ? PagesFromListWithPagination : PageFromList[]> ( apiKey: string, { type, types, tag, language, page, pageSize, sort, filterBy, }: { type?: string types?: string[] tag?: string language?: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } } ): Promise<PageFromList[]> (apiKey: string): Promise<PageFromList[]>}IBlockType
Section titled “IBlockType”interface IBlockType<T = Props> { name: string label: string description?: string getDefaultProps?: () => Partial<T> hideFromAddMenu?: boolean disabled?: boolean disabledIcon?: 'purchase' | 'maintenance' disabledLink?: string disabledTooltip?: string sideEditProps?: Array<ISideEditProp<T> | ISideGroup<T>> repeaterItems?: IRepeaterItem<T>[] newItemMenuOpen?: boolean groupByRepeater?: boolean mapExternalDataToProps?: (externalData: Props, brickProps?: T) => Partial<T> getExternalData?: ( page: Page, brickProps?: T, args?: any ) => Promise<Partial<T>> playgroundLinkUrl?: string playgroundLinkLabel?: string theme?: string category?: string tags?: string[] previewImageUrl?: string previewIcon?: React.ReactElement stories?: BrickStory<Partial<T>>[] astroInteractivity?: | 'load' | { load: true } | 'idle' | { idle: true } | { idle: { timeout: number } } | 'visible' | { visible: true } | { visible: { rootMargin: string } } | { media: string } | { only: string }}IBrickStory
Section titled “IBrickStory”interface IBrickStory { brickName: string storyName: string locked?: boolean canAddAfter?: boolean canAddBefore?: boolean}ICategory
Section titled “ICategory”interface ICategory { category?: string}ICleanBlocks
Section titled “ICleanBlocks”interface ICleanBlocks { blocks: IContentBlock[] invalidBlocksTypes: string[]}IColor
Section titled “IColor”interface IColor { color: string [propName: string]: any}IContentBlock
Section titled “IContentBlock”interface IContentBlock { id: string type: string props: Props locked?: boolean canAddAfter?: boolean canAddBefore?: boolean canEditContent?: boolean}ICustomKnobProps
Section titled “ICustomKnobProps”interface ICustomKnobProps { id: string value: any onChange: any isValid: boolean errorMessage?: string}IFileSource
Section titled “IFileSource”interface IFileSource { name: string url: string size: number extension: string pagesNum: number title?: string | undefined alt?: string | undefined copyright?: string | undefined source?: string | undefined}IImageSource
Section titled “IImageSource”interface IImageSource { src: string srcSet?: string type?: string fallbackSrc?: string fallbackSrcSet?: string fallbackType?: string placeholderSrc?: string alt?: string seoName?: string width?: number height?: number highPriority?: boolean hashId?: string crop?: ICrop transform?: ITransform}ITransform
Section titled “ITransform”interface ITransform { rotate?: number flip?: { horizontal: boolean vertical: boolean }}interface ICrop { x: number y: number width: number height: number}IMenuItem
Section titled “IMenuItem”interface IMenuItem { label: string path?: string}interface IMeta extends MetaData { language?: string openGraph?: OpenGraphData twitterCard?: TwitterCardData schemaOrg?: SchemaOrgData}IOption
Section titled “IOption”interface IOption<T = any> { value: T label: string disabled?: boolean disabledTooltip?: string [otherProps: string]: unknown}IPageType
Section titled “IPageType”interface IPageType { name: string pluralName: string isEntity?: boolean isEmailMarketing?: boolean headlessView?: boolean allowedBlockTypes?: string[] excludedBlockTypes?: string[] defaultLocked?: boolean defaultStatus?: PageStatus defaultFeaturedImage?: string getDefaultContent?: () => (string | IBrickStory | IContentBlock)[] customFields?: Array<ISideEditPropPage | ISideGroup> getExternalData?: (page: Page, args?: any) => Promise<Props> getDefaultMeta?: (page: PageFromList, externalData: Props) => Partial<IMeta> metaImageAspectRatio?: number categories?: ICategory[] slugPrefix?: ISlugPrefix template?: Array<TemplateSlot> renderWrapper?: (args: IRenderWrapperArgs) => React.ReactElement renderEmailHtml?: (args: { children: React.ReactElement page: PageValues }) => string | Promise<string>}IRenderWrapperArgs
Section titled “IRenderWrapperArgs”interface IRenderWrapperArgs { children: React.ReactElement page: PageValues renderEnvironment: RenderEnvironment}IReactBricksContext
Section titled “IReactBricksContext”interface IReactBricksContext { version: string appId: string apiKey: string apiPrefix?: string environment?: string bricks: Bricks themes: types.Theme[] pageTypes: IPageType[] logo: string loginUI: LoginUI contentClassName: string defaultTheme: string renderLocalLink: RenderLocalLink navigate: (path: string) => void loginPath: string editorPath: string mediaLibraryPath: string playgroundPath: string appSettingsPath: string previewPath: string getAdminMenu?: (args: { isAdmin: boolean }) => IMenuItem[] isDarkColorMode?: boolean toggleColorMode?: () => void useCssInJs?: boolean appRootElement: string | HTMLElement clickToEditSide?: ClickToEditSide customFields?: Array<ISideEditPropPage | ISideGroup> responsiveBreakpoints: ResponsiveBreakpoint[] enableAutoSave: boolean disableSaveIfInvalidProps: boolean enablePreview: boolean browserSupport: { webP: boolean; lazyLoading: boolean } blockIconsPosition: BlockIconsPosition enablePreviewImage: boolean enablePreviewIcon: boolean enableUnsplash: boolean unsplashApiKey?: string enableDefaultEmbedBrick: boolean checkUnsavedChanges: boolean permissions?: Permissions allowAccentsInSlugs: boolean warningIfLowBattery: boolean isRtlLanguage: ({ language }: { language: string }) => boolean rtlLanguages: string[]}IReadAdminContext
Section titled “IReadAdminContext”interface IReadAdminContext { isAdmin: boolean previewMode: boolean currentPage: ICurrentPage showRichTextModal: ShowRichTextModal}IRepeaterItem
Section titled “IRepeaterItem”interface IRepeaterItem<T = any> { name: string label?: string itemType?: string itemLabel?: string defaultOpen?: boolean min?: number max?: number getDefaultProps?: () => Props show?: (props: T, page?: Page, user?: User) => boolean items?: { type: string label?: string min?: number max?: number getDefaultProps?: () => Props show?: (props: T, page?: Page, user?: User) => boolean }[]}ISideEditProp
Section titled “ISideEditProp”interface ISideEditPropPage<T = Props> { name: string label: string type: SideEditPropType component?: React.FC<ICustomKnobProps> validate?: (value: any, props?: T) => boolean | string show?: (props: T, page?: Page, user?: User) => boolean helperText?: string
textareaOptions?: { height?: number } imageOptions?: { maxWidth?: number quality?: number aspectRatio?: number } rangeOptions?: { min?: number max?: number step?: number } selectOptions?: { options?: IOption[] getOptions?: (props: Props) => IOption[] | Promise<IOption[]> display: OptionsDisplay } autocompleteOptions?: { placeholder?: string getOptions: (input: string, props: Props) => any[] | Promise<any[]> getKey: (option: any) => string | number getLabel: (option: any) => string renderOption?: ({ option, selected, focus, }: { option: any selected: boolean focus: boolean }) => React.ReactElement debounceTime?: number getNoOptionsMessage?: (input?: string) => string } iconSelectorOptions?: { iconSets?: IconSets[] } relationshipOptions?: { label?: string references: string multiple: boolean embedValues?: boolean } onChange?: (props: T) => Partial<T>}
interface ISideEditProp<T = Props> extends ISideEditPropPage<T> { shouldRefreshText?: boolean shouldRefreshStyles?: boolean}ISideGroup
Section titled “ISideGroup”interface ISideGroup<T = Props> { groupName: string defaultOpen?: boolean show?: (props: T, page?: Page, user?: User) => boolean props: ISideEditProp<T>[] | ISideEditPropPage<T>[]}LoginUI
Section titled “LoginUI”interface LoginUI { sideImage?: string logo?: string logoWidth?: number logoHeight?: number welcomeText?: string welcomeTextStyle?: React.CSSProperties}ReactBricksConfig
Section titled “ReactBricksConfig”interface ReactBricksConfig { appId: string apiKey: string apiPrefix?: string environment?: string bricks?: types.Brick<any>[] | types.Theme[] pageTypes?: types.IPageType[] logo?: string loginUI?: LoginUI contentClassName?: string defaultTheme?: string renderLocalLink: types.RenderLocalLink navigate: (path: string) => void loginPath?: string editorPath?: string mediaLibraryPath?: string playgroundPath?: string appSettingsPath?: string previewPath?: string getAdminMenu?: (args: { isAdmin: boolean }) => IMenuItem[] isDarkColorMode?: boolean toggleColorMode?: () => void useCssInJs?: boolean appRootElement: string | HTMLElement clickToEditSide?: ClickToEditSide customFields?: Array<ISideEditPropPage | ISideGroup> responsiveBreakpoints?: ResponsiveBreakpoint[] enableAutoSave?: boolean disableSaveIfInvalidProps?: boolean enablePreview?: boolean blockIconsPosition?: BlockIconsPosition enablePreviewImage?: boolean enablePreviewIcon?: boolean enableUnsplash?: boolean unsplashApiKey?: string enableDefaultEmbedBrick?: boolean checkUnsavedChanges?: boolean permissions?: Permissions allowAccentsInSlugs?: boolean warningIfLowBattery?: boolean rtlLanguages?: Array<string>}ResponsiveBreakpoint
Section titled “ResponsiveBreakpoint”interface ResponsiveBreakpoint { type: DeviceType width: number | string label: string}UsePagesType
Section titled “UsePagesType”interface UsePagesType { <T extends boolean>({ type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: { type?: string types?: string[] tag?: string language: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } usePagination: T }): UseQueryResult< T extends true ? types.PagesFromListWithPagination : types.PageFromList[], unknown > ({ type, types, tag, language, page, pageSize, sort, filterBy, }: { type?: string types?: string[] language: string tag?: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } }): UseQueryResult<types.PageFromList[], unknown> (): UseQueryResult<types.PageFromList[], unknown>}UsePagesPublicType
Section titled “UsePagesPublicType”interface UsePagesPublicType { <T extends boolean>({ type, types, tag, language, page, pageSize, sort, filterBy, usePagination, }: { type?: string types?: string[] tag?: string language?: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } usePagination: T }): UseQueryResult< T extends true ? types.PagesFromListWithPagination : types.PageFromList[], unknown > ({ type, types, tag, language, page, pageSize, sort, filterBy, }: { type?: string types?: string[] tag?: string language?: string page?: number pageSize?: number sort?: string filterBy?: { [key: string]: any } }): UseQueryResult<types.PageFromList[], unknown> (): UseQueryResult<types.PageFromList[], unknown>}