schlechtenburg/packages/image/lib/util.ts

23 lines
485 B
TypeScript
Raw Normal View History

2020-12-30 01:32:46 +00:00
import {
ParagraphData,
getDefaultData as getDefaultParagraphData
2020-12-30 13:34:23 +00:00
} from '@schlechtenburg/paragraph';
2020-12-30 01:32:46 +00:00
import { BlockData, BlockProps } from '/@/blocks';
2020-05-24 20:52:33 +00:00
export interface ImageData {
src: string;
alt: string;
2020-12-30 01:32:46 +00:00
description: ParagraphData;
2020-05-24 20:52:33 +00:00
}
export interface ImageProps extends BlockProps {
data: ImageData;
2020-05-27 15:32:35 +00:00
eventUpdate: (b?: BlockData) => void;
2020-05-24 20:52:33 +00:00
}
export const getDefaultData: () => ImageData = () => ({
src: '',
alt: '',
2020-12-30 01:32:46 +00:00
description: getDefaultParagraphData(),
2020-05-24 20:52:33 +00:00
});