@shaxpir/duiduidui-models 1.4.1 → 1.4.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.
Files changed (2) hide show
  1. package/package.json +2 -3
  2. package/decs.d.ts +0 -112
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"
@@ -13,8 +13,7 @@
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "files": [
16
- "dist/",
17
- "decs.d.ts"
16
+ "dist/"
18
17
  ],
19
18
  "dependencies": {
20
19
  "@shaxpir/sharedb": "^5.3.0",
package/decs.d.ts DELETED
@@ -1,112 +0,0 @@
1
- declare module '@shaxpir/sharedb/lib/client' {
2
- import { Presence } from '@shaxpir/sharedb/lib/client/presence/Presence';
3
- interface Error {
4
- code: number;
5
- message: string;
6
- stack: string;
7
- }
8
- interface Types {
9
- register: (type: any) => void;
10
- map: { [key: string]: any };
11
- }
12
- const types: Types;
13
- class Agent<TCustom = any> {
14
- backend: any;
15
- stream: any;
16
- custom: any;
17
- send(message: any): void;
18
- }
19
- class Connection {
20
- constructor(ws: any, options?:any);
21
-
22
- // This direct reference from connection to agent is not used internal to
23
- // ShareDB, but it is handy for server-side only user code that may cache
24
- // state on the agent and read it in middleware
25
- agent: Agent | null;
26
-
27
- collections: Record<string, Record<string, Doc>>;
28
- queries: Record<string, any>;
29
-
30
- seq: number;
31
- id: string | null; // Equals agent.src on the server
32
- nextQueryId: number;
33
- nextSnapshotRequestId: number;
34
-
35
- state: string;
36
- debug: boolean;
37
-
38
- ping():void;
39
- close(): void;
40
- get(collectionName: string, documentID: string): Doc;
41
- isDocInInventory(collection: string, id: string, minVersion?: string|number):boolean;
42
- forEachPendingDocCollectionId(callback:(collection: string, id: string) => void):void;
43
- createFetchQuery<T = any>(collectionName: string, query: any, options?: {results?: Array<Doc<T>>} | null, callback?: (err: Error, results: Array<Doc<T>>) => void): any;
44
- createSubscribeQuery<T = any>(collectionName: string, query: any, options?: {results?: Array<Doc<T>>} | null, callback?: (err: Error, results: Array<Doc<T>>) => void): any;
45
- fetchSnapshot(collection: string, id: string, version: number, callback: (error: Error, snapshot: any) => void): void;
46
- fetchSnapshotByTimestamp(collection: string, id: string, timestamp: number, callback: (error: Error, snapshot: any) => void): void;
47
- getPresence(channel: string): Presence;
48
- getDocPresence(collection: string, id: string): Presence;
49
- on(eventName: string, listener: (error: Error) => void): void;
50
- off(eventName: string, listener: (error: Error) => void): void;
51
- }
52
- class Doc<T = any> {
53
- connection: Connection;
54
- type: any;
55
- id: string;
56
- collection: string;
57
- data: T;
58
- version: any;
59
- subscribed: boolean;
60
- preventCompose: boolean;
61
- paused: boolean;
62
- submitSource: boolean;
63
-
64
- on: (eventName:string, callback:any) => void;
65
- off: (eventName:string, callback:any) => void;
66
-
67
- fetch: (callback?: (err: Error) => void) => void;
68
- subscribe: (callback?: (err: Error) => void) => void;
69
- unsubscribe: (callback?: (err: Error) => void) => void;
70
-
71
- ingestSnapshot(snapshot: any, callback?: any): void;
72
- destroy(callback?: any): void;
73
- create(data: any, callback?: any): void;
74
- create(data: any, type?: any, callback?: any): void;
75
- create(data: any, type?: any, options?: any, callback?: any): void;
76
- submitOp(data: any, options?: any, callback?: any): void;
77
- del(options: any, callback?: (err: Error) => void): void;
78
- whenNothingPending(callback: () => void): void;
79
- hasPending(): boolean;
80
- hasWritePending(): boolean;
81
- pause(): void;
82
- resume(): void;
83
- flush(): void;
84
-
85
- ensureDocHasData(callback?: any): void;
86
- ensureDocHasRecentData(minVersion:string|number, callback?: any): void;
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
- }