本文整理汇总了TypeScript中tinymce/plugins/image/core/ImageData.defaultData函数的典型用法代码示例。如果您正苦于以下问题:TypeScript defaultData函数的具体用法?TypeScript defaultData怎么用?TypeScript defaultData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了defaultData函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getStyleValue
Logger.t('getStyleValue from image data', Step.sync(() => {
RawAssertions.assertEq('Should not produce any styles', '', getStyleValue(normalizeCss, defaultData()));
RawAssertions.assertEq('Should produce border width', 'border-width: 1px;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { border: '1' })));
RawAssertions.assertEq('Should produce style', 'border-style: solid;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { borderStyle: 'solid' })));
RawAssertions.assertEq('Should produce style & border', 'border-style: solid; border-width: 1px;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { border: '1', borderStyle: 'solid' })));
RawAssertions.assertEq('Should produce compact border', 'border: 2px dotted red;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { style: 'border: 1px solid red', border: '2', borderStyle: 'dotted' })));
})),
示例2: getSelectedImage
const readImageDataFromSelection = (editor: Editor): ImageData => {
const image = getSelectedImage(editor);
return image ? read((css) => normalizeCss(editor, css), image) : defaultData();
};
示例3: getStyleValue
win.find('#style').each((ctrl) => {
const value = getStyleValue((css) => normalizeCss(editor, css), Merger.merge(defaultData(), win.toJSON()));
ctrl.value(value);
});