import { CanBeState } from "../PubTypes"; import { KeyType, ValueType } from "../Types"; type MapInputValue = [In, OutKey] extends [Array, number] ? Array : In extends Map ? Map : [In, OutValue] extends [Set, true] ? Set : OutKey extends string | number | symbol ? Record : Map; export declare interface ForPairs { type: "State"; kind: "ForPairs"; /** * Returns the current value of this ForPairs object. * The object will be registered as a dependency unless `asDependency` is false. */ get(asDependency?: boolean): T; } /** * **TS note**: The types for ForPairs may be unsafe. Prefer using ForKeys or ForValues. * * Constructs a new ForPairs object which maps pairs of a table using * a `processor` function. * * Optionally, a `destructor` function can be specified for cleaning up values. * If omitted, the default cleanup function will be used instead. * * Additionally, a `meta` table/value can optionally be returned to pass data created * when running the processor to the destructor when the created object is cleaned up. */ export declare function ForPairs( input: CanBeState, processor: (key: KeyType, value: ValueType) => LuaTuple<[OutKey, OutValue, Meta?]>, destructor?: (key: OutKey, value: OutValue, meta: Meta) => void, ): ForPairs>;