@types/sharedb 5.1.0 → 5.1.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 +2 -2
- sharedb/index.d.ts +22 -1
- sharedb/lib/sharedb.d.ts +9 -3
- sharedb/package.json +8 -3
sharedb/README.md
CHANGED
|
@@ -8,8 +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:
|
|
11
|
+
* Last updated: Sat, 04 Jul 2026 16:21:36 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
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), [Christina Burger](https://github.com/pypmannetjies),
|
|
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), [Christina Burger](https://github.com/pypmannetjies), [Craig Beck](https://github.com/craigbeck), and [Dawid Kisielwski](https://github.com/dawidreedsy).
|
sharedb/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { EventEmitter } from "events";
|
|
4
4
|
import { Duplex } from "stream";
|
|
5
5
|
import Agent = require("./lib/agent");
|
|
6
|
-
import { Connection } from "./lib/client";
|
|
6
|
+
import { Connection, Snapshot } from "./lib/client";
|
|
7
7
|
import * as ShareDB from "./lib/sharedb";
|
|
8
8
|
|
|
9
9
|
interface PubSubOptions {
|
|
@@ -56,6 +56,27 @@ declare class sharedb extends EventEmitter {
|
|
|
56
56
|
* or session info.
|
|
57
57
|
*/
|
|
58
58
|
listen(stream: Duplex, request?: any): Agent;
|
|
59
|
+
fetch<T = unknown>(
|
|
60
|
+
agent: Agent,
|
|
61
|
+
index: string,
|
|
62
|
+
id: string,
|
|
63
|
+
callback: (error: Error | null, snapshot?: Snapshot<T>) => void,
|
|
64
|
+
): void;
|
|
65
|
+
fetch<T = unknown>(
|
|
66
|
+
agent: Agent,
|
|
67
|
+
index: string,
|
|
68
|
+
id: string,
|
|
69
|
+
options: ShareDB.BackendFetchOptions | null,
|
|
70
|
+
callback: (error: Error | null, snapshot?: Snapshot<T>) => void,
|
|
71
|
+
): void;
|
|
72
|
+
submit(
|
|
73
|
+
agent: Agent,
|
|
74
|
+
index: string,
|
|
75
|
+
id: string,
|
|
76
|
+
op: SubmitRequest["op"],
|
|
77
|
+
options: ShareDB.BackendSubmitOptions | null,
|
|
78
|
+
callback: (error: Error | null, ops: any[], request?: SubmitRequest) => void,
|
|
79
|
+
): void;
|
|
59
80
|
close(callback?: BasicCallback): void;
|
|
60
81
|
/**
|
|
61
82
|
* Registers a server middleware function.
|
sharedb/lib/sharedb.d.ts
CHANGED
|
@@ -104,9 +104,9 @@ export interface RawOp {
|
|
|
104
104
|
d: DocumentID;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
export type CreateOp = RawOp & { create: { type: string; data: any }
|
|
108
|
-
export type DeleteOp = RawOp & { del: boolean
|
|
109
|
-
export type EditOp = RawOp & { op: any[]
|
|
107
|
+
export type CreateOp = Partial<RawOp> & { create: { type: string; data: any } };
|
|
108
|
+
export type DeleteOp = Partial<RawOp> & { del: boolean };
|
|
109
|
+
export type EditOp = Partial<RawOp> & { op: any[] };
|
|
110
110
|
|
|
111
111
|
export type OTType = "ot-text" | "ot-json0" | "ot-json1" | "ot-text-tp2" | "rich-text";
|
|
112
112
|
|
|
@@ -154,6 +154,12 @@ export interface ShareDBSourceOptions {
|
|
|
154
154
|
// interface ShareDBCreateOptions extends ShareDBSourceOptions {}
|
|
155
155
|
// interface ShareDBDelOptions extends ShareDBSourceOptions {}
|
|
156
156
|
// interface ShareDBSubmitOpOptions extends ShareDBSourceOptions {}
|
|
157
|
+
export interface BackendFetchOptions {
|
|
158
|
+
snapshotOptions?: Record<string, unknown>;
|
|
159
|
+
}
|
|
160
|
+
export interface BackendSubmitOptions {
|
|
161
|
+
[key: string]: unknown;
|
|
162
|
+
}
|
|
157
163
|
|
|
158
164
|
export type Callback = (err: Error) => any;
|
|
159
165
|
|
sharedb/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/sharedb",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"description": "TypeScript definitions for sharedb",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sharedb",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
"name": "Craig Beck",
|
|
35
35
|
"githubUsername": "craigbeck",
|
|
36
36
|
"url": "https://github.com/craigbeck"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Dawid Kisielwski",
|
|
40
|
+
"githubUsername": "dawidreedsy",
|
|
41
|
+
"url": "https://github.com/dawidreedsy"
|
|
37
42
|
}
|
|
38
43
|
],
|
|
39
44
|
"main": "",
|
|
@@ -46,6 +51,6 @@
|
|
|
46
51
|
"scripts": {},
|
|
47
52
|
"dependencies": {},
|
|
48
53
|
"peerDependencies": {},
|
|
49
|
-
"typesPublisherContentHash": "
|
|
50
|
-
"typeScriptVersion": "
|
|
54
|
+
"typesPublisherContentHash": "36bb4634baf147b72bf80dc019557a0d93cfe2b1066da427397bbf7339d9060e",
|
|
55
|
+
"typeScriptVersion": "5.6"
|
|
51
56
|
}
|