import ListContext from './ListContext' ; import { ISharePointDataProvider } from '../data/ISharePointDataProvider' ; import { ISharePointItem } from '../data/ISharePointItem' ; import { ISPUser } from '../data/ISPUser' ; export default class ItemContext extends ListContext { private _itemId : number ; private _hasChanged : boolean ; private _dataProvider : ISharePointDataProvider ; private _itemObject ? : any ; public get itemObject ( ) : any { return this . _itemObject ; } public set itemObject ( newValue ) { this . _itemObject = newValue ; } public get dataProvider ( ) : ISharePointDataProvider { return this . _dataProvider ; } public set dataProvider ( newDataProvider ) { this . _dataProvider = newDataProvider ; } public get hasChanged ( ) : boolean { return this . _hasChanged ; } public set hasChanged ( newValue ) { this . _hasChanged = newValue ; } public get itemId ( ) : number { return this . _itemId ; } public set itemId ( newItemId ) { this . _itemId = newItemId ; } public readListItems ( listName ) { return this . _dataProvider . readListItems ( listName ) ; } public readListItemsBySearch ( listName , searchTerm ) { return this . _dataProvider . readListItemsBySearch ( listName , searchTerm ) ; } public readListItemsByIds ( listName , id ) { return this . _dataProvider . readListItemsByIds ( listName , id ) ; } public readUsersBySearch ( searchTerm ) { return this . _dataProvider . readUsersBySearch ( searchTerm ) ; } public readUsersByIds ( id ) { if ( this . _dataProvider == null ) { return Promise . reject ( null ) ; } return this . _dataProvider . readUsersByIds ( id ) ; } }