本文整理匯總了TypeScript中@ephox/boulder.FieldSchema.strictObjOf方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FieldSchema.strictObjOf方法的具體用法?TypeScript FieldSchema.strictObjOf怎麽用?TypeScript FieldSchema.strictObjOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ephox/boulder.FieldSchema
的用法示例。
在下文中一共展示了FieldSchema.strictObjOf方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
const sTestScenario = function (rawScenario) {
const scenario = ValueSchema.asRawOrDie('Checking scenario', ValueSchema.objOf([
FieldSchema.strict('label'),
FieldSchema.defaulted('content', ''),
FieldSchema.defaulted('node', Element.fromText('')),
FieldSchema.strictObjOf('fields', [
FieldSchema.option('url'),
FieldSchema.option('text'),
FieldSchema.option('title'),
FieldSchema.option('target')
]),
FieldSchema.strict('expected'),
FieldSchema.defaulted('beforeExecute', Step.pass),
FieldSchema.defaulted('mutations', Fun.constant(Step.pass))
]), rawScenario);
return Logger.t(
scenario.label,
GeneralSteps.sequence([
tEditor.sPrepareState(scenario.node.dom(), scenario.content),
sClickLink,
TestUi.sSetFieldOptValue(scenario.fields.url),
sClickNext,
sAssertTextFocused,
TestUi.sSetFieldOptValue(scenario.fields.text),
sClickNext,
sAssertTitleFocused,
TestUi.sSetFieldOptValue(scenario.fields.title),
sClickNext,
sAssertTargetFocused,
TestUi.sSetFieldOptValue(scenario.fields.target),
sClickPrev,
sAssertTitleFocused,
sClickPrev,
sAssertTextFocused,
sClickPrev,
sAssertUrlFocused,
scenario.beforeExecute,
Keyboard.sKeydown(doc, Keys.enter(), { }),
tEditor.sAssertEq('Checking insert content', scenario.expected),
scenario.mutations(scenario.node),
tEditor.sClear
])
);
};
示例2: function
const checkApply = function (rawScenario) {
const schema = ValueSchema.objOfOnly([
FieldSchema.strict('label'),
FieldSchema.strictObjOf('info', [
FieldSchema.option('url'),
FieldSchema.option('text'),
FieldSchema.option('title'),
FieldSchema.option('target'),
FieldSchema.option('link')
]),
FieldSchema.defaulted('mutations', Fun.noop),
FieldSchema.defaulted('expected', [ ])
]);
const scenario = ValueSchema.asRawOrDie(rawScenario.label, schema, rawScenario);
Logger.sync('setInfo ... ' + scenario.label, function () {
store.clear();
LinkBridge.applyInfo(editor, scenario.info);
store.assertEq('Checking store', scenario.expected);
const link = scenario.info.link.bind(Fun.identity);
link.each(scenario.mutations);
});
};
示例3:
export default ValueSchema.objOf([
FieldSchema.strictObjOf('editor', [
// Maybe have frame as a method, but I doubt it ... I think we pretty much need a frame
FieldSchema.strict('getFrame'),
FieldSchema.option('getBody'),
FieldSchema.option('getDoc'),
FieldSchema.option('getWin'),
FieldSchema.option('getSelection'),
FieldSchema.option('setSelection'),
FieldSchema.option('clearSelection'),
FieldSchema.option('cursorSaver'),
FieldSchema.option('onKeyup'),
FieldSchema.option('onNodeChanged'),
FieldSchema.option('getCursorBox'),
FieldSchema.strict('onDomChanged'),
FieldSchema.defaulted('onTouchContent', Fun.noop),
FieldSchema.defaulted('onTapContent', Fun.noop),
FieldSchema.defaulted('onTouchToolstrip', Fun.noop),
FieldSchema.defaulted('onScrollToCursor', Fun.constant({ unbind: Fun.noop })),
FieldSchema.defaulted('onScrollToElement', Fun.constant({ unbind: Fun.noop })),
FieldSchema.defaulted('onToEditing', Fun.constant({ unbind: Fun.noop })),
FieldSchema.defaulted('onToReading', Fun.constant({ unbind: Fun.noop })),
FieldSchema.defaulted('onToolbarScrollStart', Fun.identity)
]),
FieldSchema.strict('socket'),