Skip to content

Commit 40b5d27

Browse files
committed
Changing modules definitions
1 parent 8fa3ef4 commit 40b5d27

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

components/pryv-monitor/src/index.d.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
import pryv from 'pryv';
1+
import pryv, { Service, Connection, Auth, Browser, utils } from 'pryv';
22
import { EventEmitter } from 'events';
33

4+
/**
5+
* Type for the pryv library parameter - accepts both default and namespace imports
6+
*/
7+
export type PryvLibrary = {
8+
Service: typeof Service;
9+
Connection: typeof Connection;
10+
Auth: typeof Auth;
11+
Browser: typeof Browser;
12+
utils: typeof utils;
13+
version?: string;
14+
};
15+
416
/**
517
* Extends a `pryv` instance with monitoring capabilities.
618
*
@@ -22,7 +34,7 @@ import { EventEmitter } from 'events';
2234
* await mon.start();
2335
* ```
2436
*/
25-
export default function extendPryvMonitor(pryvLib: typeof pryv): typeof pryv.Monitor;
37+
export default function extendPryvMonitor(pryvLib: PryvLibrary): typeof pryv.Monitor;
2638

2739
declare module 'pryv' {
2840

components/pryv-socket.io/src/index.d.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
import pryv from 'pryv';
1+
import pryv, { Service, Connection, Auth, Browser, utils } from 'pryv';
22
import { EventEmitter } from 'events';
33

4+
/**
5+
* Type for the pryv library parameter - accepts both default and namespace imports
6+
*/
7+
export type PryvLibrary = {
8+
Service: typeof Service;
9+
Connection: typeof Connection;
10+
Auth: typeof Auth;
11+
Browser: typeof Browser;
12+
utils: typeof utils;
13+
version?: string;
14+
};
15+
416
/**
517
* Extends a `pryv` instance with Socket.IO capabilities.
618
*
@@ -18,7 +30,7 @@ import { EventEmitter } from 'events';
1830
* });
1931
* ```
2032
*/
21-
export default function extendPryvSocketIO(pryvLib: typeof pryv): void;
33+
export default function extendPryvSocketIO(pryvLib: PryvLibrary): void;
2234

2335
declare module 'pryv' {
2436
export type SocketIOEventName =

0 commit comments

Comments
 (0)