mwg API
    Preparing search index...

    Interface FloatSource

    The minimal draw surface for the helpers that draw floats only (float, chance, weighted, weightedKey). A rule whose draws are floats-only implements just this - no dead int member that must never be called.

    import { Random } from '@datamoc/mwg/core';
    import type { FloatSource } from '@datamoc/mwg/core';

    // a scripted float-only stream: every draw is data, no integer path exists
    const scripted: FloatSource = { float: () => 0.25 };
    const hit = Random.chance(0.5, scripted);
    interface FloatSource {
        float(): number;
    }

    Hierarchy (View Summary)

    Index