///
import type { ASTAttrs, ASTNode } from './ast/types';
export interface CupType {
/**
* Uniq name
*/
name: string;
/**
* DisplayName
*/
displayName?: string;
/**
* Cup type
*/
type: 'container' | 'leaf';
/**
* Hover and preview component
* Display in a popover
*/
preview?: React.ComponentType<{}>;
/**
* A Function which create nodeId
*
* @default shortid()
*/
generateNodeId?: () => string;
/**
* Default Component Attrs
*/
defaultAttrs?: ASTAttrs | ((info: {
nodeId: string;
}) => ASTAttrs);
/**
* Define how to render
*/
render: React.ComponentType<{
nodeId: string;
/**
* Origin AST Node
*/
node: ASTNode;
/**
* Current Node Path
*/
path: string;
attrs: ASTAttrs;
children?: React.ReactNode;
}>;
/**
* Whether render can interactive in viewport
* Default is false
*/
renderInteractive?: boolean;
/**
* Describe
*/
desc?: React.ReactNode;
/**
* Which attrs can be editor
*/
editor?: React.ComponentType<{}>;
/**
* Disable Drop Event
* @default false
*/
disableDropEvent?: boolean;
}
declare type CupMapType = Map;
/**
* Register Cup into cupMap
* @param cup A Cup
*/
export declare function regCup(cup: CupType): void;
export declare function getAllCup(): CupMapType;
export declare function findCup(cupName: string): CupType | null;
export {};