import { IMethodInfo , IRequestInfo } from "gd-sprest-def/base" ; import { IBase , ITargetInfo , ITargetInfoProps } from "../../@types/utils" ; import { Batch , Helper , Request , XHRRequest } from "." ; /*********************************************************************************************************************************/ /*********************************************************************************************************************************/ export class Base < Type = any , Result = Type , QueryResult = Result > implements IBase { param targetInfo constructor ( targetInfo ) { this . targetInfo = Object . create ( targetInfo || { } ) ; this . responses = [ ] ; this . requestType = 0 ; this . waitFlags = [ ] ; } /**
     * Execution Properties
     */ batchRequests : Array < Array < { callback ? : any ; response ? : IBase ; targetInfo : ITargetInfo ; } > > ; parent : IBase ; responseIndex : number ; responses : Array < IBase > ; waitFlags : Array < boolean > ; /**
     * Request Properties
     */ base : IBase ; getAllItemsFl : boolean ; existsFl ; nextFl : boolean ; requestType : number ; response : string ; status : number ; targetInfo : ITargetInfoProps ; xml : string | XMLDocument ; xhr : XHRRequest ; addMethods ( data , context ? ) { return Request . addMethods ( this , data , context ) ; } batch ( ... args ) { return Batch . execute ( this , args ) ; } done < T = IBase > ( resolve ) { return Helper . done ( this , resolve ) ; } execute ( ... args ) { return Request . execute ( this , args ) ; } executeMethod ( methodName , methodConfig , args ? ) { return Helper . executeMethod ( this , methodName , methodConfig , args ) ; } executeAndWait ( ) { return Request . executeRequest ( this , false ) ; } getCollection ( method , args ? ) { return Helper . getCollection ( this , method , args ) ; } getInfo ( ) { return Helper . getRequestInfo ( this ) ; } getNextSetOfResults ( ) { return Helper . getNextSetOfResults ( this ) ; } getProperty ( propertyName , requestType ? ) { return Helper . getProperty ( this , propertyName , requestType ) ; } stringify ( ) { return Helper . stringify ( this ) ; } updateMetadataUri ( metadata , targetInfo ) { return Helper . updateMetadataUri ( this , metadata , targetInfo ) ; } waitForRequestsToComplete ( callback , requestIdx ? ) { Request . waitForRequestsToComplete ( this , callback , requestIdx ) ; } }