Skip to content

Commit b7a104a

Browse files
author
Perki
committed
completing types and version
1 parent b44e35f commit b7a104a

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

components/pryv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pryv",
3-
"version": "2.4.2",
3+
"version": "2.4.3",
44
"description": "Pryv JavaScript library",
55
"keywords": [
66
"Pryv",

components/pryv/src/index.d.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)