data-structure-typed
Version:
Standard data structure
15 lines (12 loc) • 323 B
text/typescript
export type Direction = 'up' | 'right' | 'down' | 'left';
export type Turning = { [key in Direction]: Direction };
export type NavigatorParams<T = any> = {
matrix: T[][];
turning: Turning;
onMove: (cur: [number, number]) => void;
init: {
cur: [number, number];
charDir: Direction;
VISITED: T;
};
};