/** * Returns an array of elements selected randomly from `collection`. * The array has `length` elements unless the `collection` doesn't have enough unique elements, * then it returns an array of unique elements of `collection`. * * @since 1.0.0 * * @template T * @param {T} collection - The collection to sample from. * @param {number} [length = 1] The number of elements to randomly select from the `collection`. * @returns {T} - Returns the array of random elements. * * @example * const result = sampleSize([1, 2, 3, 4], 2); * console.log(result); // => [2, 4] * * const result = sampleSize({ a: 1, b: 2, c: 3, d: 4 }, 3); * console.log(result); // => [2, 4, 1] */ declare const sampleSize: (collection: T, length?: number) => T; export default sampleSize;