Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//#region src/compat/array/sampleSize.d.ts
/**
* Returns a sample element array of a specified size from a collection.
*
* @template T
* @param {Record<string, T> | Record<number, T> | null | undefined} collection - The collection to sample from.
* @param {number} [n] - The size of sample.
* @returns {T[]} A new array with sample size applied.
*
* @example
* sampleSize([1, 2, 3], 2);
* // => [2, 3] (example, actual result will vary)
*/
declare function sampleSize<T>(collection: Record<string, T> | Record<number, T> | null | undefined, n?: number): T[];
/**
* Returns a sample element array of a specified size from an object.
*
* @template T
* @param {T | null | undefined} collection - The object to sample from.
* @param {number} [n] - The size of sample.
* @returns {Array<T[keyof T]>} A new array with sample size applied.
*
* @example
* sampleSize({ a: 1, b: 2, c: 3 }, 2);
* // => [2, 3] (example, actual result will vary)
*/
declare function sampleSize<T extends object>(collection: T | null | undefined, n?: number): Array<T[keyof T]>;
//#endregion
export { sampleSize };