import { createDuration , Duration } from '../datelib/duration' ; import { refineProps , RawOptionsFromRefiners , Dictionary } from '../options' ; const DRAG_META_REFINERS = { startTime : createDuration , duration : createDuration , create : Boolean , sourceId : String , } ; export type DragMetaInput = RawOptionsFromRefiners < typeof DRAG_META_REFINERS > & { [ otherProp ] : any ; } ; export interface DragMeta { startTime : Duration | null ; duration : Duration | null ; create : boolean ; sourceId : string ; leftoverProps : Dictionary ; } export function parseDragMeta ( raw ) { let { refined , extra } = refineProps ( raw , DRAG_META_REFINERS ) ; return { startTime : refined . startTime || null , duration : refined . duration || null , create : refined . create != null ? refined . create : true , sourceId : refined . sourceId , leftoverProps : extra , } ; }