当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Option.getOrDie方法代码示例

本文整理汇总了TypeScript中@ephox/katamari.Option.getOrDie方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Option.getOrDie方法的具体用法?TypeScript Option.getOrDie怎么用?TypeScript Option.getOrDie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/katamari.Option的用法示例。


在下文中一共展示了Option.getOrDie方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

    return Chain.op(function (posOption: Option<any>) {
      const container = Hierarchy.follow(Element.fromDom(viewBlock.get()), path).getOrDie();
      const pos = posOption.getOrDie('Needs to return a caret');

      Assertions.assertDomEq('Should be the expected container', container, Element.fromDom(pos.container()));
      Assertions.assertEq('Should be the expected offset', offset, pos.offset());
    });
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:LineReaderTest.ts

示例2: actionName

 return Chain.op(function (actionOption: Option<any>) {
   const container = Hierarchy.follow(Element.fromDom(viewBlock.get()), elementPath).getOrDie();
   const action = actionOption.getOrDie();
   Assertions.assertEq('Should be expected action type', 'moveToPosition', actionName(action));
   Assertions.assertDomEq('Should be expected container', container, Element.fromDom(actionValue(action).container()));
   Assertions.assertEq('Should be expected offset', offset, actionValue(action).offset());
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:CefDeleteActionTest.ts

示例3:

    return Chain.op(function (blockBoundaryOption: Option<any>) {
      const expectedFromBlock = Hierarchy.follow(Element.fromDom(viewBlock.get()), fromBlockPath).getOrDie();
      const expectedToBlock = Hierarchy.follow(Element.fromDom(viewBlock.get()), toBlockPath).getOrDie();
      const blockBoundary = blockBoundaryOption.getOrDie();

      Assertions.assertDomEq('Should be expected from block', expectedFromBlock, blockBoundary.from().block());
      Assertions.assertDomEq('Should be expected to block', expectedToBlock, blockBoundary.to().block());
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:BlockMergeBoundaryTest.ts

示例4:

    return Chain.op(function (input: Option<any>) {
      const sc = Hierarchy.follow(Element.fromDom(viewBlock.get()), startPath).getOrDie();
      const fc = Hierarchy.follow(Element.fromDom(viewBlock.get()), finishPath).getOrDie();

      const bookmarkRng = input.getOrDie('no bookmark!');

      Assertions.assertDomEq('sc', sc, bookmarkRng.start());
      Assertions.assertEq('soffset', startOffset, bookmarkRng.soffset());
      Assertions.assertDomEq('fc', fc, bookmarkRng.finish());
      Assertions.assertEq('foffset', finishOffset, bookmarkRng.foffset());
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:11,代码来源:SelectionBookmarkTest.ts

示例5:

    return Chain.op(function (position: Option<any>) {
      const container = Hierarchy.follow(Element.fromDom(viewBlock.get()), expectedPath).getOrDie();

      Assertions.assertDomEq('Should be expected container', container, Element.fromDom(position.getOrDie().container()));
      Assertions.assertEq('Should be expected offset', expectedOffset, position.getOrDie().offset());
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:6,代码来源:MergeBlocksTest.ts

示例6:

 return Chain.op(function (actualBlock: Option<any>) {
   const expectedBlock = Hierarchy.follow(Element.fromDom(viewBlock.get()), elementPath).getOrDie();
   Assertions.assertDomEq('Should be the expected block element', expectedBlock, actualBlock.getOrDie());
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:4,代码来源:DeleteUtilsTest.ts

示例7:

 return Chain.op(function (cellOption: Option<any>) {
   const cell = cellOption.getOrDie('x');
   const expectedContainer = Hierarchy.follow(Element.fromDom(viewBlock.get()), path).getOrDie();
   Assertions.assertDomEq('Should be the expected element', expectedContainer, Element.fromDom(cell));
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:5,代码来源:TableCellsTest.ts


注:本文中的@ephox/katamari.Option.getOrDie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。