UNPKG

@rbxts/react-hooks

Version:

Generated by [Rojo](https://github.com/rojo-rbx/rojo) 7.4.0.

30 lines (29 loc) 1.36 kB
/// <reference types="@rbxts/compiler-types" /> /// <reference types="@rbxts/compiler-types" /> /// <reference types="react" /> /// <reference types="@rbxts/compiler-types" /> /** * Lets you manipulate an array data structure without ever needing extra utilities. * @param initialValue The initial array to use. * @returns */ export declare function useArray<T extends defined>(initialValue: Array<T>): Readonly<{ append: (...elements: ReadonlyArray<T>) => void; array: T[]; clear: () => void; createNewArray: (callback: (array: Array<T>) => Array<T>) => void; filter: (callback: (value: T, index: number, array: ReadonlyArray<T>) => boolean) => void; filterUndefined: () => void; insert: (index: number, value: T) => void; map: (callback: (value: T, index: number, array: ReadonlyArray<T>) => T) => void; mapFiltered: (callback: (value: T, index: number, array: ReadonlyArray<T>) => T | undefined) => void; pop: () => void; remove: (index: number) => void; reverse: () => void; set: (index: number, value: T) => void; setArray: import("@rbxts/react").Dispatch<import("@rbxts/react").SetStateAction<T[]>>; shift: () => void; sort: (compare?: ((a: T, b: T) => boolean) | undefined) => void; unorderedRemove: (index: number) => void; unshift: (...elements: ReadonlyArray<T>) => void; }>;