import {
Pose,
PoseMap,
PoserConfig,
ValueMap,
SelectValueToRead
} from '../types';
export const getPoseValues = ({
transition,
// `flip` is DOM-specific so technically it shouldn't be filtered out here in a DOM-agnostic layer.
// However because of the simplicity of this it's handled here at the moment.
flip,
delay,
delayChildren,
staggerChildren,
staggerDirection,
afterChildren,
beforeChildren,
preTransition,
applyAtStart,
applyAtEnd,
...props
}: Pose): Pose => props;
export const selectPoses = ({
label,
props,
values,
parentValues,
ancestorValues,
onChange,
passive,
initialPose,
...poses
}: PoserConfig): PoseMap => poses;
export const selectAllValues = (
values: ValueMap,
selectValue: SelectValueToRead
) => {
const allValues: { [key: string]: any } = {};
values.forEach(
(value: V, key: string) => (allValues[key] = selectValue(value))
);
return allValues;
};