@venuecms/sdk-next
Version:
This is a work in progress and is heavily in flux until we launch 1.0 in February.
49 lines (46 loc) • 1.34 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { LocalizedContent } from '@venuecms/sdk';
import React, { JSX } from 'react';
type ElementClasses = {
text?: string;
p?: string;
ul?: string;
ol?: string;
li?: string;
code?: string;
heading?: string;
hardBreak?: string;
img?: string;
image?: string;
iframe?: string;
h1?: string;
h2?: string;
h3?: string;
a?: string;
};
declare const getDefaultHandlers: (classes?: ElementClasses) => NodeHandlers;
type ContentStyles = Partial<Record<keyof ReturnType<typeof getDefaultHandlers>, string>>;
interface Attrs {
readonly [attr: string]: any;
}
interface RenderNode {
type: string;
attrs?: Attrs;
marks?: Attrs[];
content?: RenderNode[];
readonly [attr: string]: any;
}
interface NodeProps {
children?: React.ReactNode;
node: RenderNode;
}
type NodeHandler = (props: NodeProps) => JSX.Element;
interface NodeHandlers {
readonly [attr: string]: NodeHandler;
}
declare const VenueContent: ({ content, contentStyles, className, }: {
content: LocalizedContent;
contentStyles?: ContentStyles;
className?: string;
}) => react_jsx_runtime.JSX.Element | null;
export { type ContentStyles, type NodeHandler, type NodeHandlers, type NodeProps, type RenderNode, VenueContent };