/** * Returns a deterministic pseudo-random number between 0 and 1. The value * is derived from the current execution counter, so it produces the * **same result** on every replay of the workflow at this execution point. * * Use this instead of `Math.random()` inside workflow functions. * `Math.random()` is non-deterministic and would break replay correctness. * * ## Examples * * ```typescript * import { Durable } from '@hotmeshio/hotmesh'; * * // Generate a deterministic unique suffix * export async function uniqueWorkflow(): Promise { * const suffix = Math.floor(Durable.workflow.random() * 10000); * return `item-${suffix}`; * } * ``` * * ```typescript * // A/B test routing (deterministic per workflow execution) * export async function experimentWorkflow(userId: string): Promise { * const { variantA, variantB } = Durable.workflow.proxyActivities(); * * if (Durable.workflow.random() < 0.5) { * return await variantA(userId); * } else { * return await variantB(userId); * } * } * ``` * * @returns {number} A deterministic pseudo-random number in [0, 1). */ export declare function random(): number;