magicrealmsshared 0.1.4 → 0.2.0

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.
@@ -0,0 +1,22 @@
1
+ import { Well } from "../types/types";
2
+
3
+
4
+ export const AUTH = "AUTH";
5
+ export const AUTH_ACK = "AUTH_ACK";
6
+
7
+ export const DATA_UPDATE_COMMAND = "DATA_UPDATE";
8
+ export type DATA_UPDATE<T> = {
9
+ wells: Well<T>[],
10
+ }
11
+
12
+ export const POSUPDATE_COMMAND = "POSUPDATE";
13
+ export type POSUPDATE = {
14
+ pos: GeoJSON.Point,
15
+
16
+ /**
17
+ * The precision of the pos.
18
+ *
19
+ * @type {number}
20
+ */
21
+ pre: number,
22
+ }
@@ -0,0 +1,3 @@
1
+ import { POSUPDATE } from "./ws";
2
+
3
+ export type POSUPDATE_CLIENT = POSUPDATE;
@@ -0,0 +1,3 @@
1
+ import { POSUPDATE } from "./ws";
2
+
3
+ export type POSUPDATE_SERVER = POSUPDATE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magicrealmsshared",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/types/types.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { ObjectId } from "mongodb"
2
-
3
1
 
4
2
  //#region Base Types
5
3
  export type ObjectWithId<T> = {
@@ -11,8 +9,6 @@ import { ObjectId } from "mongodb"
11
9
  }
12
10
  //#endregion
13
11
 
14
- export type Well_Client = Well<string>;
15
- export type Well_Server = Well<ObjectId>;
16
12
  export type Well<T> = WorldObject<T> & {
17
13
  name: string,
18
14
  color: number,
@@ -0,0 +1,4 @@
1
+ import { Well } from "./types";
2
+
3
+
4
+ export type Well_Client = Well<string>;
@@ -0,0 +1,4 @@
1
+ import { ObjectId } from "mongodb"
2
+ import { Well } from "./types";
3
+
4
+ export type Well_Server = Well<ObjectId>;
@@ -9,4 +9,18 @@ export type DATA_UPDATE_CLIENT = DATA_UPDATE<string>;
9
9
  export type DATA_UPDATE_SERVER = DATA_UPDATE<ObjectId>;
10
10
  type DATA_UPDATE<T> = {
11
11
  wells: Well<T>[],
12
+ }
13
+
14
+ export const POSUPDATE_COMMAND = "POSUPDATE";
15
+ export type POSUPDATE_CLIENT = POSUPDATE;
16
+ export type POSUPDATE_SERVER = POSUPDATE;
17
+ type POSUPDATE = {
18
+ pos: GeoJSON.Point,
19
+
20
+ /**
21
+ * The precision of the pos.
22
+ *
23
+ * @type {number}
24
+ */
25
+ pre: number,
12
26
  }