@shaxpir/duiduidui-models 1.3.0 → 1.3.2

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.
package/decs.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module '@shaxpir/sharedb/lib/client' {
2
+ import { Presence } from '@shaxpir/sharedb/lib/client/presence/Presence';
2
3
  interface Error {
3
4
  code: number;
4
5
  message: string;
@@ -43,8 +44,8 @@ declare module '@shaxpir/sharedb/lib/client' {
43
44
  createSubscribeQuery<T = any>(collectionName: string, query: any, options?: {results?: Array<Doc<T>>} | null, callback?: (err: Error, results: Array<Doc<T>>) => void): any;
44
45
  fetchSnapshot(collection: string, id: string, version: number, callback: (error: Error, snapshot: any) => void): void;
45
46
  fetchSnapshotByTimestamp(collection: string, id: string, timestamp: number, callback: (error: Error, snapshot: any) => void): void;
46
- getPresence(channel: string): any;
47
- getDocPresence(collection: string, id: string): any;
47
+ getPresence(channel: string): Presence;
48
+ getDocPresence(collection: string, id: string): Presence;
48
49
  on(eventName: string, listener: (error: Error) => void): void;
49
50
  off(eventName: string, listener: (error: Error) => void): void;
50
51
  }
@@ -85,3 +86,27 @@ declare module '@shaxpir/sharedb/lib/client' {
85
86
  ensureDocHasRecentData(minVersion:string|number, callback?: any): void;
86
87
  }
87
88
  }
89
+
90
+ declare module '@shaxpir/sharedb/lib/client/presence/Presence' {
91
+ import { LocalPresence } from '@shaxpir/sharedb/lib/client/presence/LocalPresence';
92
+ class Presence {
93
+ remotePresences: any;
94
+ localPresences: any;
95
+
96
+ on: (eventName:string, callback: any) => void;
97
+ off: (eventName:string, callback: any) => void;
98
+
99
+ create(id: string): LocalPresence;
100
+ destroy(callback?: any): void;
101
+ subscribe(callback?: any): void;
102
+ unsubscribe(callback?: any): void;
103
+ }
104
+ }
105
+
106
+ declare module '@shaxpir/sharedb/lib/client/presence/LocalPresence' {
107
+ class LocalPresence {
108
+ submit(presence: any, callback?: any): void;
109
+ send(callback?: any): void;
110
+ destroy(callback?: any): void;
111
+ }
112
+ }
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ /// <reference path="../decs.d.ts" />
18
19
  __exportStar(require("./models"), exports);
19
20
  __exportStar(require("./repo"), exports);
20
21
  __exportStar(require("./util"), exports);
package/lib/index.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  // created from 'create-ts-index'
2
2
 
3
+ /// <reference path="../decs.d.ts" />
4
+
3
5
  export * from './models';
4
6
  export * from './repo';
5
7
  export * from './util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"