@diory/client-js 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,11 +10,11 @@ declare class DioryClient implements IDioryClient {
10
10
  diory?: IDiory;
11
11
  constructor(dataClients: IDataClient[]);
12
12
  initialise: (connections: IConnectionObject[]) => Promise<void>;
13
+ enterRoom: (roomObject: IRoomObject) => Promise<IRoom>;
14
+ focusDiory: (dioryObject: IDioryObject) => IDiory;
13
15
  getDiosphere: () => Promise<void>;
14
16
  saveDiosphere: () => Promise<void>;
15
- enterRoom: (roomObject: IRoomObject) => Promise<IRoom>;
16
17
  getDiograph: () => Promise<void>;
17
18
  saveDiograph: () => Promise<void>;
18
- focusDiory: (dioryObject: IDioryObject) => IDiory;
19
19
  }
20
20
  export { DioryClient };
@@ -23,9 +23,17 @@ class DioryClient {
23
23
  this.connections = connections;
24
24
  await this.getDiosphere();
25
25
  await this.enterRoom({ id: '/' });
26
- await this.focusDiory({ id: '/' });
27
26
  return;
28
27
  };
28
+ this.enterRoom = async (roomObject) => {
29
+ this.room = this.diosphere.getRoom(roomObject);
30
+ await this.getDiograph();
31
+ this.focusDiory({ id: '/' });
32
+ return this.room;
33
+ };
34
+ this.focusDiory = (dioryObject) => {
35
+ return (this.diory = this.diograph.getDiory(dioryObject));
36
+ };
29
37
  this.getDiosphere = async () => {
30
38
  console.info('getDiosphere', this.connections);
31
39
  if (this.connections) {
@@ -49,11 +57,6 @@ class DioryClient {
49
57
  }
50
58
  return;
51
59
  };
52
- this.enterRoom = async (roomObject) => {
53
- this.room = this.diosphere.getRoom(roomObject);
54
- await this.getDiograph();
55
- return this.room;
56
- };
57
60
  this.getDiograph = async () => {
58
61
  var _a, _b;
59
62
  console.info('getDiograph', (_a = this.room) === null || _a === void 0 ? void 0 : _a.connections);
@@ -79,9 +82,6 @@ class DioryClient {
79
82
  }
80
83
  return;
81
84
  };
82
- this.focusDiory = (dioryObject) => {
83
- return (this.diory = this.diograph.getDiory(dioryObject));
84
- };
85
85
  this.dataClients = dataClients;
86
86
  this.diosphere = new diosphere_js_1.Diosphere();
87
87
  this.diograph = new diograph_1.Diograph();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diory/client-js",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Olli-Pekka Pohjola <op@diory.me>, Jouni Alanen <jouni@diory.me>",
@@ -46,11 +46,23 @@ class DioryClient implements IDioryClient {
46
46
 
47
47
  await this.getDiosphere()
48
48
  await this.enterRoom({ id: '/' })
49
- await this.focusDiory({ id: '/' })
50
49
 
51
50
  return
52
51
  }
53
52
 
53
+ enterRoom = async (roomObject: IRoomObject): Promise<IRoom> => {
54
+ this.room = this.diosphere.getRoom(roomObject)
55
+
56
+ await this.getDiograph()
57
+ this.focusDiory({ id: '/' })
58
+
59
+ return this.room
60
+ }
61
+
62
+ focusDiory = (dioryObject: IDioryObject): IDiory => {
63
+ return (this.diory = this.diograph.getDiory(dioryObject))
64
+ }
65
+
54
66
  getDiosphere = async (): Promise<void> => {
55
67
  console.info('getDiosphere', this.connections)
56
68
  if (this.connections) {
@@ -84,14 +96,6 @@ class DioryClient implements IDioryClient {
84
96
  return
85
97
  }
86
98
 
87
- enterRoom = async (roomObject: IRoomObject): Promise<IRoom> => {
88
- this.room = this.diosphere.getRoom(roomObject)
89
-
90
- await this.getDiograph()
91
-
92
- return this.room
93
- }
94
-
95
99
  getDiograph = async (): Promise<void> => {
96
100
  console.info('getDiograph', this.room?.connections)
97
101
  if (this.room?.connections) {
@@ -124,10 +128,6 @@ class DioryClient implements IDioryClient {
124
128
 
125
129
  return
126
130
  }
127
-
128
- focusDiory = (dioryObject: IDioryObject): IDiory => {
129
- return (this.diory = this.diograph.getDiory(dioryObject))
130
- }
131
131
  }
132
132
 
133
133
  export { DioryClient }