Skip to main content

flipDirection

function

Flip a direction ('next' -> 'previous'; 'previous' -> 'next'). Note that TypeScript can't prove that FlipDirection is its own inverse (but if you have a concrete 'next' or 'previous' it will simplify accordingly).

function flipDirection<D extends CaretDirection>(direction: D): FlipDirection<D>

Import

import { flipDirection } from '@modular/sdk/editor';

Notes

returns
The opposite direction