@types/sharedb 3.3.5 → 3.3.7

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.
sharedb/README.md CHANGED
@@ -8,9 +8,8 @@ This package contains type definitions for sharedb (https://github.com/share/sha
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sharedb.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 13 Oct 2023 07:36:07 GMT
11
+ * Last updated: Wed, 18 Oct 2023 11:45:06 GMT
12
12
  * Dependencies: none
13
- * Global values: none
14
13
 
15
14
  # Credits
16
15
  These definitions were written by [Steve Oney](https://github.com/soney), [Eric Hwang](https://github.com/ericyhwang), [Peter Xu](https://github.com/pxpeterxu), [Alec Gibson](https://github.com/alecgibson), and [Christina Burger](https://github.com/pypmannetjies).
sharedb/index.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- // Type definitions for sharedb 3.3
2
- // Project: https://github.com/share/sharedb
3
- // Definitions by: Steve Oney <https://github.com/soney>
4
- // Eric Hwang <https://github.com/ericyhwang>
5
- // Peter Xu <https://github.com/pxpeterxu>
6
- // Alec Gibson <https://github.com/alecgibson>
7
- // Christina Burger <https://github.com/pypmannetjies>
8
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
- // TypeScript Version: 3.0
10
-
11
1
  /// <reference path="lib/sharedb.d.ts" />
12
2
 
13
3
  import { EventEmitter } from "events";
@@ -289,6 +279,7 @@ declare namespace sharedb {
289
279
 
290
280
  type Path = ShareDB.Path;
291
281
  type ShareDBSourceOptions = ShareDB.ShareDBSourceOptions;
282
+ const MESSAGE_ACTIONS: ShareDB.RequestActions;
292
283
 
293
284
  namespace middleware {
294
285
  interface ActionContextMap {
sharedb/lib/client.d.ts CHANGED
@@ -10,8 +10,8 @@ export class Connection extends ShareDB.TypedEmitter<ShareDB.ConnectionEventMap>
10
10
  // state on the agent and read it in middleware
11
11
  agent: Agent | null;
12
12
 
13
- collections: Record<string, Record<string, Doc>>;
14
- queries: Record<string, Query>;
13
+ collections: Record<string, Record<string, ShareDB.Doc>>;
14
+ queries: Record<string, ShareDB.Query>;
15
15
 
16
16
  seq: number;
17
17
  id: string | null; // Equals agent.src on the server
@@ -23,19 +23,19 @@ export class Connection extends ShareDB.TypedEmitter<ShareDB.ConnectionEventMap>
23
23
  debug: boolean;
24
24
 
25
25
  close(): void;
26
- get(collectionName: string, documentID: string): Doc;
26
+ get(collectionName: string, documentID: string): ShareDB.Doc;
27
27
  createFetchQuery<T = any>(
28
28
  collectionName: string,
29
29
  query: any,
30
- options?: { results?: Array<Doc<T>> } | null,
31
- callback?: (err: Error, results: Array<Doc<T>>) => void,
32
- ): Query<T>;
30
+ options?: { results?: Array<ShareDB.Doc<T>> } | null,
31
+ callback?: (err: Error, results: Array<ShareDB.Doc<T>>) => void,
32
+ ): ShareDB.Query<T>;
33
33
  createSubscribeQuery<T = any>(
34
34
  collectionName: string,
35
35
  query: any,
36
- options?: { results?: Array<Doc<T>> } | null,
37
- callback?: (err: Error, results: Array<Doc<T>>) => void,
38
- ): Query<T>;
36
+ options?: { results?: Array<ShareDB.Doc<T>> } | null,
37
+ callback?: (err: Error, results: Array<ShareDB.Doc<T>>) => void,
38
+ ): ShareDB.Query<T>;
39
39
  fetchSnapshot(
40
40
  collection: string,
41
41
  id: string,
@@ -48,8 +48,8 @@ export class Connection extends ShareDB.TypedEmitter<ShareDB.ConnectionEventMap>
48
48
  timestamp: number | null,
49
49
  callback: (error: Error, snapshot: ShareDB.Snapshot) => void,
50
50
  ): void;
51
- getPresence(channel: string): Presence;
52
- getDocPresence(collection: string, id: string): Presence;
51
+ getPresence(channel: string): ShareDB.Presence;
52
+ getDocPresence(collection: string, id: string): ShareDB.Presence;
53
53
 
54
54
  /**
55
55
  * Returns whether anything in this client is either:
@@ -77,27 +77,29 @@ export class Connection extends ShareDB.TypedEmitter<ShareDB.ConnectionEventMap>
77
77
 
78
78
  ping(): void;
79
79
  }
80
- export type Doc<T = any> = ShareDB.Doc<T>;
81
- export type Snapshot<T = any> = ShareDB.Snapshot<T>;
82
- export type Query<T = any> = ShareDB.Query<T>;
83
- export type Presence<T = any> = ShareDB.Presence<T>;
84
- export type LocalPresence<T = any> = ShareDB.LocalPresence<T>;
85
- export type Error = ShareDB.Error;
86
- export type Op = ShareDB.Op;
87
- export type AddNumOp = ShareDB.AddNumOp;
88
- export type ListMoveOp = ShareDB.ListMoveOp;
89
- export type ListInsertOp = ShareDB.ListInsertOp;
90
- export type ListDeleteOp = ShareDB.ListDeleteOp;
91
- export type ListReplaceOp = ShareDB.ListReplaceOp;
92
- export type StringInsertOp = ShareDB.StringInsertOp;
93
- export type StringDeleteOp = ShareDB.StringDeleteOp;
94
- export type ObjectInsertOp = ShareDB.ObjectInsertOp;
95
- export type ObjectDeleteOp = ShareDB.ObjectDeleteOp;
96
- export type ObjectReplaceOp = ShareDB.ObjectReplaceOp;
97
- export type SubtypeOp = ShareDB.SubtypeOp;
98
80
 
99
- export type Path = ShareDB.Path;
100
- export type ShareDBSourceOptions = ShareDB.ShareDBSourceOptions;
81
+ export {
82
+ AddNumOp,
83
+ Doc,
84
+ Error,
85
+ ListDeleteOp,
86
+ ListInsertOp,
87
+ ListMoveOp,
88
+ ListReplaceOp,
89
+ LocalPresence,
90
+ ObjectDeleteOp,
91
+ ObjectInsertOp,
92
+ ObjectReplaceOp,
93
+ Op,
94
+ Path,
95
+ Presence,
96
+ Query,
97
+ ShareDBSourceOptions,
98
+ Snapshot,
99
+ StringDeleteOp,
100
+ StringInsertOp,
101
+ SubtypeOp,
102
+ } from "./sharedb";
101
103
 
102
104
  export const types: ShareDB.Types;
103
105
  export const logger: ShareDB.Logger;
sharedb/lib/sharedb.d.ts CHANGED
@@ -277,7 +277,31 @@ export interface LocalPresenceEventMap {
277
277
  "error": (error: Error) => void;
278
278
  }
279
279
 
280
- export type RequestAction = "qf" | "qs" | "qu" | "bf" | "bs" | "bu" | "f" | "s" | "u" | "op" | "nf" | "nt";
280
+ export interface RequestActions {
281
+ initLegacy: "init";
282
+ handshake: "hs";
283
+ queryFetch: "qf";
284
+ querySubscribe: "qs";
285
+ queryUnsubscribe: "qu";
286
+ queryUpdate: "q";
287
+ bulkFetch: "bf";
288
+ bulkSubscribe: "bs";
289
+ bulkUnsubscribe: "bu";
290
+ fetch: "f";
291
+ fixup: "fixup";
292
+ subscribe: "s";
293
+ unsubscribe: "u";
294
+ op: "op";
295
+ snapshotFetch: "nf";
296
+ snapshotFetchByTimestamp: "nt";
297
+ pingPong: "pp";
298
+ presence: "p";
299
+ presenceSubscribe: "ps";
300
+ presenceUnsubscribe: "pu";
301
+ presenceRequest: "pr";
302
+ }
303
+
304
+ export type RequestAction = RequestActions[keyof RequestActions];
281
305
 
282
306
  export interface ClientRequest {
283
307
  /** Short name of the request's action */
sharedb/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@types/sharedb",
3
- "version": "3.3.5",
3
+ "version": "3.3.7",
4
4
  "description": "TypeScript definitions for sharedb",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sharedb",
6
6
  "license": "MIT",
7
7
  "contributors": [
8
8
  {
9
9
  "name": "Steve Oney",
10
- "url": "https://github.com/soney",
11
- "githubUsername": "soney"
10
+ "githubUsername": "soney",
11
+ "url": "https://github.com/soney"
12
12
  },
13
13
  {
14
14
  "name": "Eric Hwang",
15
- "url": "https://github.com/ericyhwang",
16
- "githubUsername": "ericyhwang"
15
+ "githubUsername": "ericyhwang",
16
+ "url": "https://github.com/ericyhwang"
17
17
  },
18
18
  {
19
19
  "name": "Peter Xu",
20
- "url": "https://github.com/pxpeterxu",
21
- "githubUsername": "pxpeterxu"
20
+ "githubUsername": "pxpeterxu",
21
+ "url": "https://github.com/pxpeterxu"
22
22
  },
23
23
  {
24
24
  "name": "Alec Gibson",
25
- "url": "https://github.com/alecgibson",
26
- "githubUsername": "alecgibson"
25
+ "githubUsername": "alecgibson",
26
+ "url": "https://github.com/alecgibson"
27
27
  },
28
28
  {
29
29
  "name": "Christina Burger",
30
- "url": "https://github.com/pypmannetjies",
31
- "githubUsername": "pypmannetjies"
30
+ "githubUsername": "pypmannetjies",
31
+ "url": "https://github.com/pypmannetjies"
32
32
  }
33
33
  ],
34
34
  "main": "",
@@ -40,6 +40,6 @@
40
40
  },
41
41
  "scripts": {},
42
42
  "dependencies": {},
43
- "typesPublisherContentHash": "c4e07675910d7c9953cad2d42597e5fdee670c92a537e56a0f99c636b04bdd47",
43
+ "typesPublisherContentHash": "46d24f74d1dfce18e6a2214c49ac62ce3f7a0d5d25218f3818726c3a7d70d165",
44
44
  "typeScriptVersion": "4.5"
45
45
  }