Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay bomb.sh/docs/tty
Something went wrong. Try again.
tty pointer-shape.ts
961 B · 50 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051export const POINTER_SHAPES = [ "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out",] as const;
/** * A mouse pointer shape, named with the CSS `cursor` keyword vocabulary used * by the OSC 22 pointer shape protocol. * * @see {@link https://sw.kovidgoyal.net/kitty/pointer-shapes/ | kitty pointer shapes} */export type PointerShape = typeof POINTER_SHAPES[number];
const INDEX: ReadonlyMap<unknown, number> = new Map( POINTER_SHAPES.map((shape, i) => [shape, i]),);
export function pointerShapeIndex(shape: unknown): number | undefined { return INDEX.get(shape);}