ratio-lock
Version:
A TypeScript library for managing n numbers with locked ratios. When the ratio is locked, changing one value automatically adjusts all other values to maintain their proportional relationships.
22 lines • 601 B
TypeScript
/**
* Return type for the useRatioLock hook
*/
export interface UseRatioLockReturn {
/** Current values */
values: number[];
/** Update a single value */
setValue: (index: number, value: number) => void;
/** Update all values */
setValues: (values: number[]) => void;
/** Current lock state */
isLocked: boolean;
/** Lock the ratio */
lock: () => void;
/** Unlock the ratio */
unlock: () => void;
/** Toggle lock state */
toggle: () => void;
/** Current ratios */
ratios: number[];
}
//# sourceMappingURL=use-ratio-lock-return.d.ts.map