schlechtenburg/packages/image/lib/util.ts
2021-03-08 16:29:35 +01:00

26 lines
500 B
TypeScript

import {
BlockData,
generateBlockId,
} from '@schlechtenburg/core';
import {
name as paragraphName,
ParagraphData,
getDefaultData as getDefaultParagraphData
} from '@schlechtenburg/paragraph';
export interface ImageData {
src: string;
alt: string;
description: BlockData<ParagraphData>;
}
export const getDefaultData: () => ImageData = () => ({
src: '',
alt: '',
description: {
id: generateBlockId(),
name: paragraphName,
data: getDefaultParagraphData(),
},
});