@types/sharedb 2.2.1 → 2.2.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.
- sharedb/README.md +1 -1
- sharedb/index.d.ts +11 -7
- sharedb/package.json +2 -2
sharedb/README.md
CHANGED
|
@@ -8,7 +8,7 @@ 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:
|
|
11
|
+
* Last updated: Thu, 02 Jun 2022 18:01:29 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: none
|
|
14
14
|
|
sharedb/index.d.ts
CHANGED
|
@@ -97,14 +97,11 @@ declare class sharedb extends EventEmitter {
|
|
|
97
97
|
fn: (context: sharedb.middleware.ActionContextMap[A], callback: (err?: any) => void) => void,
|
|
98
98
|
): void;
|
|
99
99
|
|
|
100
|
-
on
|
|
101
|
-
on(
|
|
102
|
-
on(event: 'error', callback: (err: Error) => void): this;
|
|
103
|
-
on(event: 'send', callback: (agent: Agent, response: ShareDB.ServerResponseSuccess | ShareDB.ServerResponseError) => void): this;
|
|
100
|
+
on<E extends keyof sharedb.BackendEventListenerMap>(event: E, callback: sharedb.BackendEventListenerMap[E]): this;
|
|
101
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
104
102
|
|
|
105
|
-
addListener
|
|
106
|
-
addListener(
|
|
107
|
-
addListener(event: 'error', callback: (err: Error) => void): this;
|
|
103
|
+
addListener<E extends keyof sharedb.BackendEventListenerMap>(event: E, callback: sharedb.BackendEventListenerMap[E]): this;
|
|
104
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
108
105
|
|
|
109
106
|
getOps(agent: Agent, index: string, id: string, from: number, to: number, options: GetOpsOptions, callback: (error: Error, ops: any[]) => any): void;
|
|
110
107
|
getOpsBulk(agent: Agent, index: string, id: string, fromMap: Record<string, number>, toMap: Record<string, number>, options: GetOpsOptions, callback: (error: Error, ops: any[]) => any): void;
|
|
@@ -143,6 +140,13 @@ declare namespace sharedb {
|
|
|
143
140
|
type DBQueryMethod = (collection: string, query: any, fields: ProjectionFields, options: any, callback: DBQueryCallback) => void;
|
|
144
141
|
type DBQueryCallback = (err: Error | null, snapshots: Snapshot[], extra?: any) => void;
|
|
145
142
|
|
|
143
|
+
interface BackendEventListenerMap {
|
|
144
|
+
error: (err: Error) => void;
|
|
145
|
+
send: (agent: Agent, response: ShareDB.ServerResponseSuccess | ShareDB.ServerResponseError) => void;
|
|
146
|
+
submitRequestEnd: (error: Error, request: SubmitRequest) => void;
|
|
147
|
+
timing: (type: string, time: number, request: any) => void;
|
|
148
|
+
}
|
|
149
|
+
|
|
146
150
|
abstract class PubSub {
|
|
147
151
|
private static shallowCopy(obj: any): any;
|
|
148
152
|
protected prefix?: string;
|
sharedb/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/sharedb",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "TypeScript definitions for sharedb",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sharedb",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {},
|
|
42
42
|
"dependencies": {},
|
|
43
|
-
"typesPublisherContentHash": "
|
|
43
|
+
"typesPublisherContentHash": "37f57c8f390e581233bacd93aafe070e7c8f911eb66d6d5d4cffc59385d19136",
|
|
44
44
|
"typeScriptVersion": "3.9"
|
|
45
45
|
}
|