schlechtenburg/packages/image/lib/util.ts
2022-03-11 18:23:14 +01:00

26 lines
506 B
TypeScript

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