@arc-fusion/cli
Version:
CLI for running Arc Fusion on your local machine
56 lines (52 loc) • 1.69 kB
TypeScript
declare module "fusion:edge" {
import type { DetailedHTMLProps, HTMLAttributes, ReactElement } from "react";
type BaseProps = DetailedHTMLProps<
HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>;
/**
* "Static Content" configuration for the `EdgeBlock` component.
*
* Indicates that the block uses static content from the edge, and where
* to find that content. If the content is retrieved successfully, then
* the block's children will be replaced with the content from the edge.
* Otherwise, the block's children will be rendered as normal.
*/
export interface StaticEdgeBlockProps extends BaseProps {
/**
* Indicates that this block is a static edge block.
*/
source: "static";
/**
* The path to the static edge content which replaces the block's contents.
* Must start with a slash.
* Example: `/path/to/content`
*/
path: `/${string}`;
}
/**
* Renders a block of content which has its children replaced by content retrieved from the edge.
* If the edge content cannot be retrieved, the block's children will be rendered as normal.
*
* ### Static Edge Block
*
* Renders a static edge block at the edge with the specified properties.
*
* Requires PageBuilder Engine v5.2.0+ or v6.1.0+.
*
* ```tsx
* import EdgeBlock from "fusion:edge";
*
* function MyComponent() {
* return (
* <EdgeBlock source="static" path="/my-content">
* This is my edge block content.
* </EdgeBlock>
* );
* }
*
* export default MyComponent;
* ```
*/
export default function EdgeBlock(props: StaticEdgeBlockProps): ReactElement;
}