import * as React from 'react' ; import { IViewModel , IViewModelResolver } from './interfaces/index' ; export interface IViewModelLocatorProps { resolver : IViewModelResolver ; } export interface IViewModelLocatorContext { resolver : IViewModelResolver ; } /**
 * This class is used to resolve ViewModels.
 */ export class ViewModelLocator extends React . Component < IViewModelLocatorProps , any > { getChildContext ( ) { return { resolver : this . props . resolver } ; } render ( ) { return React . Children . only ( this . props . children ) ; } } const ViewModelLocatorClass = ViewModelLocator as React . ComponentClass < IViewModelLocatorProps > ; ViewModelLocatorClass . childContextTypes = { resolver : React . PropTypes . func } ;