schlechtenburg/packages/image/lib/util.ts

23 lines
485 B
TypeScript

import {
ParagraphData,
getDefaultData as getDefaultParagraphData
} from '@schlechtenburg/paragraph';
import { BlockData, BlockProps } from '/@/blocks';
export interface ImageData {
src: string;
alt: string;
description: ParagraphData;
}
export interface ImageProps extends BlockProps {
data: ImageData;
eventUpdate: (b?: BlockData) => void;
}
export const getDefaultData: () => ImageData = () => ({
src: '',
alt: '',
description: getDefaultParagraphData(),
});