@@ -560,7 +560,7 @@ declare module 'pryv' {
560560
561561 export type APICallProgressHandler = ( percentage : number ) => void ;
562562
563- export class AccessInfo extends Access {
563+ export type AccessInfo = Access & {
564564 calls : KeyValue ;
565565 user : KeyValue ;
566566 }
@@ -570,7 +570,7 @@ declare module 'pryv' {
570570 } & PossibleError ;
571571
572572 export class Connection {
573- constructor ( apiEndpoint : string , service ?: Service ) : Connection ;
573+ constructor ( apiEndpoint : string , service ?: Service ) ;
574574 get service ( ) : Service ;
575575 username ( ) : Promise < string > ;
576576 api < Calls extends APICall [ ] = APICall [ ] > (
@@ -783,23 +783,21 @@ declare module 'pryv' {
783783 get state ( ) : AuthStatePayload ;
784784 }
785785
786- export type Auth = {
786+ export const Auth : {
787787 setupAuth : SetupAuth ;
788788 AuthStates : AuthStates ;
789789 AuthController : AuthController ;
790790 }
791791
792- export type CookieUtils = {
793- set ( cookieKey : string , value : any , expireInDays : number ) : void ;
794- get ( cookieKey : string ) : any ;
795- del ( cookieKey : string ) : void ;
796- }
797-
798792 export type getServiceInfoFromURL = ( url : string ) => string ;
799793
800- export type Browser = {
794+ export const Browser : {
801795 LoginButton : CustomLoginButton ;
802- CookieUtils : CookieUtils ;
796+ CookieUtils : {
797+ set ( cookieKey : string , value : any , expireInDays : number ) : void ;
798+ get ( cookieKey : string ) : any ;
799+ del ( cookieKey : string ) : void ;
800+ } ;
803801 AuthStates : AuthStates ;
804802 setupAuth : SetupAuth ;
805803 serviceInfoFromUrl : getServiceInfoFromURL ;
@@ -810,7 +808,7 @@ declare module 'pryv' {
810808 token : string ;
811809 } ;
812810
813- export type utils = {
811+ export const utils : {
814812 isBrowser ( ) : boolean ;
815813 extractTokenAndAPIEndpoint ( apiEndpoint : string ) : TokenAndAPIEndpoint ;
816814 buildAPIEndpoint ( tokenAndAPI : TokenAndAPIEndpoint ) : string ;
@@ -822,11 +820,6 @@ declare module 'pryv' {
822820 type version = string ;
823821
824822 let pryv : {
825- Service : Service ;
826- Connection : Connection ;
827- Auth : Auth ;
828- Browser : Browser ;
829- utils : utils ;
830823 version : version ;
831824 } ;
832825
0 commit comments