/// import type { CreateEditorOptions, Editor, LayerNode, Node } from "@opendesign/universal"; import type { MountOptions } from "@opendesign/universal/dom"; export { EditorProvider, useEditorContext } from "./src/context.js"; /** * Creates Editor object to be used. This is the main entrypoint for react apps. * Use {@link @opendesign/react!EditorCanvas} component to display the content. * * @param options * @returns */ export declare function useEditor(options?: CreateEditorOptions | string): Editor; export interface EditorCanvasProps extends MountOptions { editor: Editor; children?: React.ReactNode; onNodeHover?: (event: { target: Node | null; }) => void; onViewportChange?: (event: { viewport: unknown; }) => void; onZoom?: (event: { zoom: number; }) => void; onPan?: (event: {}) => void; onClick?: (event: { target: Node | null; }) => void; onPointerMove?: (event: { position: readonly [number, number]; }) => void; } /** * React component which displays the design on canvas ``. May suspend. * Use in conjunction with {@link @opendesign/react!useEditor} * * ## Example * * ```typescript * function App() { * const editor = useEditor("/public/design.octopus"); * * return ( * * * * ); * } * ``` * * @param props * @returns */ export declare function EditorCanvas(props: EditorCanvasProps): JSX.Element; /** * Renders absolutely positioned element at position of given node or at given * coordinates. Must be a child of {@link @opendesign/react!EditorCanvas} * component. * * If node is specified, then also width/height is applied and the element is * also hidden if it goes out of the viewport. * * @param props */ export declare function RelativeMarker(props: { children: React.ReactNode; node: LayerNode; /** * The element's size will be reduced by this many CSS pixels. * Can be negative. */ inset?: number; /** * this is a workaround since RelativeMarker does not react on changes in node (transformations) * TODO: fix this */ stale?: unknown; }): JSX.Element; /** * Returns a node under the cursor. * * See {@link @opendesign/react!useEditorContext} for rules on where to use this. */ export declare function useHoveredNode(editorOverride?: Editor): Node | null; export declare function useReplaceStaticAnimation_unstable(animation: string): void; /** * Use this function to wait until the editor is fully loaded. */ export declare function useWaitForEditorLoaded(editorOverride?: Editor): Editor; export { LayerFrame as LayerMask } from "./src/layer-frame/layer-frame.js"; export { LayerFrameWrapper as LayerMaskWrapper } from "./src/layer-frame/layer-frame-wrapper.js"; export { useResizable } from "./src/layer-frame/use-resize.js"; export { type PasteEvent, usePaste } from "./src/paste.js"; export { useLayerList } from "./src/use-layer-list.js";