@tamb/gamegrid
    Preparing search index...

    Interface IOptions

    Runtime behaviour toggles, collision rules, middleware, callbacks, styling, and event routing.

    interface IOptions {
        activeClasses?: string[];
        arrowControls?: boolean;
        blockOnType?: string[];
        callbacks?: {
            onBlock?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onBoundary?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onBoundaryX?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onBoundaryY?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onCollide?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onDettach?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onLand?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onMove?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onWrap?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onWrapX?: (gamegridInstance: IGameGrid, newState: IState) => void;
            onWrapY?: (gamegridInstance: IGameGrid, newState: IState) => void;
        };
        cellClasses?: string[];
        clickable?: boolean;
        collideOnType?: string[];
        containerClasses?: string[];
        eventTarget?: EventTarget;
        id?: string;
        infiniteX?: boolean;
        infiniteY?: boolean;
        middlewares?: { post?: MiddlewareFn[]; pre?: MiddlewareFn[] };
        moveOnType?: string[];
        rewindLimit?: number;
        rowClasses?: string[];
        wasdControls?: boolean;
    }
    Index

    Properties

    activeClasses?: string[]
    arrowControls?: boolean
    blockOnType?: string[]

    Cell type values that cannot be entered; movement snaps back to the previous cell.

    callbacks?: {
        onBlock?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onBoundary?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onBoundaryX?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onBoundaryY?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onCollide?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onDettach?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onLand?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onMove?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onWrap?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onWrapX?: (gamegridInstance: IGameGrid, newState: IState) => void;
        onWrapY?: (gamegridInstance: IGameGrid, newState: IState) => void;
    }
    cellClasses?: string[]
    clickable?: boolean
    collideOnType?: string[]

    Cell types that emit collision events upon entry (movement still succeeds unless blocked).

    containerClasses?: string[]
    eventTarget?: EventTarget

    Target for dispatched CustomEvents carrying grid detail; defaults to window when available.

    Use a standalone EventTarget (or HTMLElement) when hosting multiple grids.

    id?: string
    infiniteX?: boolean
    infiniteY?: boolean
    middlewares?: { post?: MiddlewareFn[]; pre?: MiddlewareFn[] }

    Type Declaration

    moveOnType?: string[]

    Allow-list of enterable ICell.type values when non-empty.

    Omit or supply [] to allow any cell that passes blockOnType.

    rewindLimit?: number
    rowClasses?: string[]
    wasdControls?: boolean