schlechtenburg/packages/image/lib/util.ts

26 lines
506 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,
2022-03-11 17:23:14 +00:00
IParagraphData,
2020-12-30 01:32:46 +00:00
getDefaultData as getDefaultParagraphData
2020-12-30 13:34:23 +00:00
} from '@schlechtenburg/paragraph';
2020-05-24 20:52:33 +00:00
2022-03-11 17:23:14 +00:00
export interface IImageData {
2020-05-24 20:52:33 +00:00
src: string;
alt: string;
2022-03-11 17:23:14 +00:00
description: IBlockData<IParagraphData>;
2020-05-24 20:52:33 +00:00
}
2022-03-11 17:23:14 +00:00
export const getDefaultData: () => IImageData = () => ({
2020-05-24 20:52:33 +00:00
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
});