Documentation
    Preparing search index...

    Interface PickProvider

    A picking result provider this package does not implement (§71's "gpu" / "pixel" id-buffer tier; RFC 0005, 2026-08-28) — the structural seam that lets §72's event propagation dispatch on a pixel-picked target without @fourjs/input gaining a render dependency.

    The whole contract: two normalized device coordinates in (the same [-1, 1], +Y-up pair pick takes), a Node.id out — or undefined for "nothing there" — asynchronously, because every honest GPU read-back is (RFC 0005 §4; a §9-tier explanation lives on @fourjs/render's PickingService, which is one implementation of this seam via @fourjs/four's createPickProvider). It names no render type, no target, no texture, no scene — the fourth instance of the FetchLike / SurfaceSizedCamera move — so a test satisfies it with a Map lookup and no GPU at all:

    const provider: PickProvider = {
    pick: (x, y) => Promise.resolve(x > 0 ? "node-3" : undefined),
    };

    The synchronous pick below is not changed and not deprecated: the bounds tier stays the cheap default, and a provider is what a pointer handler consults when bounds are not precise enough.

    interface PickProvider {
        pick(ndcX: number, ndcY: number): Promise<string | undefined>;
    }
    Index
    • Resolves the front-most node id under (ndcX, ndcY), or undefined.

      Parameters

      • ndcX: number
      • ndcY: number

      Returns Promise<string | undefined>