import { IDataSource , IServiceKeysConfiguration } from "./IDataSource" ; import { IDataSourceData } from "./IDataSourceData" ; import { IPropertyPaneGroup } from "@microsoft/sp-property-pane" ; import { ServiceScope , ServiceKey } from '@microsoft/sp-core-library' ; import { PagingBehavior } from './PagingBehavior' ; import { IDataContext } from './IDataContext' ; import { FilterBehavior } from '../filters/FilterBehavior' ; import { ITemplateSlot } from './ITemplateSlot' ; import { WebPartContext } from "@microsoft/sp-webpart-base" ; import { IDataFilter } from '../..' ; export abstract class BaseDataSource < T > implements IDataSource { protected serviceScope : ServiceScope ; protected _properties : T ; private _serviceKeys : IServiceKeysConfiguration ; private _context : WebPartContext ; private _editMode : boolean ; private _render : ( ) => void | Promise < void > ; get properties ( ) : T { return this . _properties ; } set properties ( properties ) { this . _properties = properties ; } get render ( ) : ( ) => void | Promise < void > { return this . _render ; } set render ( renderFunc ) { this . _render = renderFunc ; } get context ( ) : WebPartContext { return this . _context ; } set context ( context ) { this . _context = context ; } get serviceKeys ( ) : IServiceKeysConfiguration { return this . _serviceKeys ; } set serviceKeys ( keys ) { this . _serviceKeys = keys ; } public constructor ( serviceScope ) { this . serviceScope = serviceScope ; } get editMode ( ) { return this . _editMode ; } set editMode ( editMode ) { this . _editMode = editMode ; } public onInit ( ) { } public abstract getData ( dataContext ? ) ; public getPropertyPaneGroupsConfiguration ( ) { return [ ] ; } public getPagingBehavior ( ) { return PagingBehavior . Dynamic ; } public getFilterBehavior ( ) { return FilterBehavior . Static ; } public getAppliedFilters ( ) { return [ ] ; } public abstract getItemCount ( ) ; public getTemplateSlots ( ) { return [ ] ; } public onPropertyUpdate ( propertyPath , oldValue , newValue ) { } }