本文整理汇总了TypeScript中@ephox/katamari.Arr.range方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Arr.range方法的具体用法?TypeScript Arr.range怎么用?TypeScript Arr.range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/katamari.Arr
的用法示例。
在下文中一共展示了Arr.range方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: from
const cResizeToPos = (sx: number, sy: number, dx: number, dy: number, delta: number = 10) => {
// Simulate moving the mouse, by making a number of movements
const numMoves = sy === dy ? Math.abs(dx - sx) / delta : Math.abs(dy - sy) / delta;
// Determine the deltas based on the number of moves to make
const deltaX = (dx - sx) / numMoves;
const deltaY = (dy - sy) / numMoves;
// Move and release the mouse
return Chain.control(
Chain.fromChains([
UiFinder.cFindIn('.tox-blocker'),
Mouse.cMouseMoveTo(sx, sy)
].concat(
Arr.range(numMoves, (count) => {
const nx = sx + count * deltaX;
const ny = sy + count * deltaY;
return Mouse.cMouseMoveTo(nx, ny);
})
).concat([
Mouse.cMouseMoveTo(dx, dy),
Mouse.cMouseUp
])
),
Guard.addLogging(`Resizing from (${sx}, ${sy}) to (${dx}, ${dy})`)
);
};
示例2:
const sRepeatDownArrowKey = (index) => {
return GeneralSteps.sequence(Arr.range(index, () => sPressDownArrowKey));
};
示例3: insert
Chain.op((elm) => {
Arr.each(Arr.range(count, Fun.identity), () => {
insert(elm, Element.fromDom(document.createTextNode('')));
});
})