schlechtenburg/packages/image/lib/util.ts

26 lines
500 B
TypeScript
Raw Permalink Normal View History

2020-12-30 01:32:46 +00:00
import {
2021-03-08 15:29:35 +00:00
BlockData,
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;
2021-03-08 15:29:35 +00:00
description: BlockData<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
});