schlechtenburg/packages/image/lib/util.ts

26 lines
502 B
TypeScript
Raw Normal View History

2020-12-30 01:32:46 +00:00
import {
IBlockData,
2021-03-08 15:29:35 +00:00
generateBlockId,
} from '@schlechtenburg/core';
import {
name as paragraphName,
2020-12-30 01:32:46 +00:00
ParagraphData,
getDefaultData as getDefaultParagraphData
2020-12-30 13:34:23 +00:00
} from '@schlechtenburg/paragraph';
2020-05-24 20:52:33 +00:00
export interface ImageData {
src: string;
alt: string;
description: IBlockData<ParagraphData>;
2020-05-24 20:52:33 +00:00
}
export const getDefaultData: () => ImageData = () => ({
src: '',
alt: '',
2021-03-08 15:29:35 +00:00
description: {
id: generateBlockId(),
name: paragraphName,
data: getDefaultParagraphData(),
},
2020-05-24 20:52:33 +00:00
});