@@ -560,7 +560,7 @@ declare module 'pryv' {
560560
561561 export type APICallProgressHandler = ( percentage : number ) => void ;
562562
563- export interface AccessInfo extends Access {
563+ export class AccessInfo extends Access {
564564 calls : KeyValue ;
565565 user : KeyValue ;
566566 }
@@ -569,8 +569,8 @@ declare module 'pryv' {
569569 event ?: Event ;
570570 } & PossibleError ;
571571
572- export interface Connection {
573- new ( apiEndpoint : string , service ?: Service ) : Connection ;
572+ export class Connection {
573+ constructor ( apiEndpoint : string , service ?: Service ) : Connection ;
574574 get service ( ) : Service ;
575575 username ( ) : Promise < string > ;
576576 api < Calls extends APICall [ ] = APICall [ ] > (
@@ -650,11 +650,11 @@ declare module 'pryv' {
650650 [ key : string ] : any ;
651651 } ;
652652
653- export interface Service {
654- new (
653+ export class Service {
654+ constructor (
655655 serviceInfoUrl : string ,
656656 serviceCustomizations ?: serviceCustomizations ,
657- ) : Service ;
657+ ) ;
658658 info ( forceFetch ?: boolean ) : Promise < ServiceInfo > ;
659659 setServiceInfo ( serviceInfo : Partial < ServiceInfo > ) : Promise < void > ;
660660 assets ( forceFetch ?: boolean ) : Promise < AssetsConfig > ;
@@ -732,7 +732,7 @@ declare module 'pryv' {
732732 } ;
733733 } ;
734734
735- type SetupAuth = (
735+ export type SetupAuth = (
736736 settings : AuthSettings ,
737737 serviceInfoUrl : string ,
738738 serviceCustomizations ?: serviceCustomizations ,
@@ -754,7 +754,7 @@ declare module 'pryv' {
754754 message ?: string ;
755755 } ;
756756
757- export interface CustomLoginButton {
757+ export type CustomLoginButton = {
758758 init ?: ( ) => Promise < void > ;
759759 getAuthorizationData ( ) : string ;
760760 onStateChange ( state : AuthStatePayload ) : Promise < void > ;
@@ -763,12 +763,12 @@ declare module 'pryv' {
763763 deleteAuthorizationData ?: ( ) => Promise < void > ;
764764 }
765765
766- export interface AuthController {
767- new (
766+ export class AuthController {
767+ constructor (
768768 authSettings : AuthSettings ,
769769 service : Service ,
770770 loginButton : CustomLoginButton ,
771- ) : AuthController ;
771+ ) ;
772772 init ( ) : Promise < void > ;
773773 stopAuthRequest ( msg : string ) : void ;
774774 handleClick ( ) : Promise < void > ;
@@ -783,34 +783,34 @@ declare module 'pryv' {
783783 get state ( ) : AuthStatePayload ;
784784 }
785785
786- export interface Auth {
786+ export type Auth = {
787787 setupAuth : SetupAuth ;
788788 AuthStates : AuthStates ;
789789 AuthController : AuthController ;
790790 }
791791
792- export interface CookieUtils {
792+ export type CookieUtils = {
793793 set ( cookieKey : string , value : any , expireInDays : number ) : void ;
794794 get ( cookieKey : string ) : any ;
795795 del ( cookieKey : string ) : void ;
796796 }
797797
798- type getServiceInfoFromURL = ( url : string ) => string ;
798+ export type getServiceInfoFromURL = ( url : string ) => string ;
799799
800- export interface Browser {
800+ export type Browser = {
801801 LoginButton : CustomLoginButton ;
802802 CookieUtils : CookieUtils ;
803803 AuthStates : AuthStates ;
804804 setupAuth : SetupAuth ;
805805 serviceInfoFromUrl : getServiceInfoFromURL ;
806806 }
807807
808- type TokenAndAPIEndpoint = {
808+ export type TokenAndAPIEndpoint = {
809809 endpoint : string ;
810810 token : string ;
811811 } ;
812812
813- export interface utils {
813+ export type utils = {
814814 isBrowser ( ) : boolean ;
815815 extractTokenAndAPIEndpoint ( apiEndpoint : string ) : TokenAndAPIEndpoint ;
816816 buildAPIEndpoint ( tokenAndAPI : TokenAndAPIEndpoint ) : string ;
0 commit comments