import { Key , ReactNode , Ref } from 'react' ; import { checkPrimitiveDiff , HasPropsHandlers , PropertyUpdate , PropsHandler , } from '../../PropsHandler' ; export type GridNode = { key ? : Key ; ref ? : Ref < ReactNode > ; } ; export type RowOrColumnDefinitionProps = { value : number ; unit ? : number ; } ; declare global { namespace JSX { interface IntrinsicElements { rowDefinition : RowOrColumnDefinitionProps & GridNode ; columnDefinition : RowOrColumnDefinitionProps & GridNode ; } } } export class RowOrColumnDefinitionPropsHandlers implements PropsHandler < RowOrColumnDefinitionProps > { getPropertyUpdates ( oldProps , newProps ) { const changedProps = [ ] ; checkPrimitiveDiff ( oldProps . value , newProps . value , 'value' , changedProps ) ; checkPrimitiveDiff ( oldProps . unit , newProps . unit , 'unit' , changedProps ) ; return changedProps . length === 0 ? null : changedProps ; } } /**
 * Handles property updates.
 */ export class RowOrColumnDefinitionPropsHandler implements HasPropsHandlers < RowOrColumnDefinitionProps > { private propsHandlers : PropsHandler < RowOrColumnDefinitionProps > [ ] ; constructor ( ) { this . propsHandlers = [ new RowOrColumnDefinitionPropsHandlers ( ) ] ; } getPropsHandlers ( ) { return this . propsHandlers ; } addPropsHandler ( propHandler ) { this . propsHandlers . push ( propHandler ) ; } }