import { Collection , IModelConstructor } from 'mobx-collection-store' ; import IDictionary from './interfaces/IDictionary' ; import IHeaders from './interfaces/IHeaders' ; import IRequestOptions from './interfaces/IRequestOptions' ; import * as JsonApi from './interfaces/JsonApi' ; import { buildUrl } from './NetworkUtils' ; export class NetworkStore extends Collection { protected param { string } type param { ( number | string ) } id param { JsonApi . IRequest } data param { IRequestOptions } options returns { { url : string , data ? : object , headers : IHeaders , * } } memberOf protected __prepareQuery ( type , id ? , data ? , options ? ) { const model = this . static . types . filter ( ( item ) => item . type === type ) [ 0 ] ; const headers = ( options ? options . headers : { } ) || { } ; const url = buildUrl ( type , id , model , options ) ; return { data , headers , url } ; } }