/** * Generates a random permutation of an array or a range of integers. * The input array is not modified (a copy is shuffled), as numpy. * * @example * permutation(5) // e.g. [3, 0, 4, 1, 2] * permutation(['a', 'b']) // ['b', 'a'] or ['a', 'b'] * * @param {Array|number} x - If an array, a shuffled copy is returned (nested arrays are * permuted along the first axis). If a number `n`, a random permutation of `[0, 1, ..., n-1]`. * @param {number} [axis=0] - Axis along which to permute nested arrays. * @returns {Array} A randomly permuted array. */ export function permutation(x: any[] | number, axis?: number): any[]; /** * Randomly permutes a nested array along `axis`, shuffling every slice independently * (numpy's `Generator.permuted`). With `axis = null` the array is flattened, shuffled * and reshaped. Returns a new array unless `inPlace` is true. * * @example * permuted([[1, 2, 3], [4, 5, 6]], 1) // each row shuffled independently * * @param {Array} x - A (possibly nested, rectangular) array. * @param {number|null} [axis=null] - Axis along which to shuffle independently, or null. * @param {boolean} [inPlace=false] - Modify `x` instead of returning a copy. * @returns {Array} */ export function permuted(x: any[], axis?: number | null, inPlace?: boolean): any[]; /** * Returns uniformly distributed floats in the half-open interval [0, 1) * (numpy's `random` / `random_sample`). * * @param {number|number[]|null} [size=null] - Output shape. * @returns {number|Array} */ export function random(size?: number | number[] | null): number | any[]; /** * Returns `length` random bytes. * * @param {number} length - Number of bytes (non-negative integer). * @returns {Uint8Array} */ export function bytes(length: number): Uint8Array;