@100mslive/hms-whiteboard 0.0.0-alpha.0
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/dist/ErrorFallback.d.ts +7 -0
- package/dist/Whiteboard.d.ts +14 -0
- package/dist/grpc/sessionstore.client.d.ts +102 -0
- package/dist/grpc/sessionstore.d.ts +400 -0
- package/dist/hooks/StoreClient.d.ts +13 -0
- package/dist/hooks/default_store.d.ts +141 -0
- package/dist/hooks/useCollaboration.d.ts +8 -0
- package/dist/hooks/useSessionStore.d.ts +7 -0
- package/dist/hooks/useSetEditorPermissions.d.ts +7 -0
- package/dist/index.cjs.css +2767 -0
- package/dist/index.cjs.css.map +7 -0
- package/dist/index.cjs.js +2267 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.css +2767 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2264 -0
- package/dist/index.js.map +7 -0
- package/dist/meta.cjs.json +1240 -0
- package/dist/meta.esbuild.json +1242 -0
- package/dist/utils.d.ts +4 -0
- package/package.json +57 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@tldraw/tldraw/tldraw.css';
|
|
3
|
+
import './index.css';
|
|
4
|
+
export interface WhiteboardProps {
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
token?: string;
|
|
7
|
+
zoomToContent?: boolean;
|
|
8
|
+
transparentCanvas?: boolean;
|
|
9
|
+
onMount?: (args: {
|
|
10
|
+
store?: unknown;
|
|
11
|
+
editor?: unknown;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function Whiteboard({ onMount, endpoint, token, zoomToContent, transparentCanvas }: WhiteboardProps): React.JSX.Element;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo, UnaryCall } from '@protobuf-ts/runtime-rpc';
|
|
2
|
+
import type { ChangeStream, DeleteRequest, DeleteResponse, Event, GetRequest, GetResponse, HelloRequest, HelloResponse, OpenRequest, SetRequest, SetResponse, SubscribeRequest } from './sessionstore';
|
|
3
|
+
/**
|
|
4
|
+
* @generated from protobuf service sessionstorepb.Api
|
|
5
|
+
*/
|
|
6
|
+
export interface IApiClient {
|
|
7
|
+
/**
|
|
8
|
+
* @generated from protobuf rpc: Hello(sessionstorepb.HelloRequest) returns (sessionstorepb.HelloResponse);
|
|
9
|
+
*/
|
|
10
|
+
hello(input: HelloRequest, options?: RpcOptions): UnaryCall<HelloRequest, HelloResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* @generated from protobuf rpc: Subscribe(sessionstorepb.SubscribeRequest) returns (stream sessionstorepb.Event);
|
|
13
|
+
*/
|
|
14
|
+
subscribe(input: SubscribeRequest, options?: RpcOptions): ServerStreamingCall<SubscribeRequest, Event>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @generated from protobuf service sessionstorepb.Api
|
|
18
|
+
*/
|
|
19
|
+
export declare class ApiClient implements IApiClient, ServiceInfo {
|
|
20
|
+
private readonly _transport;
|
|
21
|
+
typeName: string;
|
|
22
|
+
methods: import("@protobuf-ts/runtime-rpc").MethodInfo<any, any>[];
|
|
23
|
+
options: {
|
|
24
|
+
[extensionName: string]: import("@protobuf-ts/runtime").JsonValue;
|
|
25
|
+
};
|
|
26
|
+
constructor(_transport: RpcTransport);
|
|
27
|
+
/**
|
|
28
|
+
* @generated from protobuf rpc: Hello(sessionstorepb.HelloRequest) returns (sessionstorepb.HelloResponse);
|
|
29
|
+
*/
|
|
30
|
+
hello(input: HelloRequest, options?: RpcOptions): UnaryCall<HelloRequest, HelloResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* @generated from protobuf rpc: Subscribe(sessionstorepb.SubscribeRequest) returns (stream sessionstorepb.Event);
|
|
33
|
+
*/
|
|
34
|
+
subscribe(input: SubscribeRequest, options?: RpcOptions): ServerStreamingCall<SubscribeRequest, Event>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @generated from protobuf service sessionstorepb.Store
|
|
38
|
+
*/
|
|
39
|
+
export interface IStoreClient {
|
|
40
|
+
/**
|
|
41
|
+
* open - start listening to updates in keys with provided match patterns
|
|
42
|
+
* provide change_id as last received ID to resume updates
|
|
43
|
+
*
|
|
44
|
+
* @generated from protobuf rpc: open(sessionstorepb.OpenRequest) returns (stream sessionstorepb.ChangeStream);
|
|
45
|
+
*/
|
|
46
|
+
open(input: OpenRequest, options?: RpcOptions): ServerStreamingCall<OpenRequest, ChangeStream>;
|
|
47
|
+
/**
|
|
48
|
+
* get last stored value in given key
|
|
49
|
+
*
|
|
50
|
+
* @generated from protobuf rpc: get(sessionstorepb.GetRequest) returns (sessionstorepb.GetResponse);
|
|
51
|
+
*/
|
|
52
|
+
get(input: GetRequest, options?: RpcOptions): UnaryCall<GetRequest, GetResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* set key value
|
|
55
|
+
*
|
|
56
|
+
* @generated from protobuf rpc: set(sessionstorepb.SetRequest) returns (sessionstorepb.SetResponse);
|
|
57
|
+
*/
|
|
58
|
+
set(input: SetRequest, options?: RpcOptions): UnaryCall<SetRequest, SetResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* delete key from store
|
|
61
|
+
*
|
|
62
|
+
* @generated from protobuf rpc: delete(sessionstorepb.DeleteRequest) returns (sessionstorepb.DeleteResponse);
|
|
63
|
+
*/
|
|
64
|
+
delete(input: DeleteRequest, options?: RpcOptions): UnaryCall<DeleteRequest, DeleteResponse>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @generated from protobuf service sessionstorepb.Store
|
|
68
|
+
*/
|
|
69
|
+
export declare class StoreClient implements IStoreClient, ServiceInfo {
|
|
70
|
+
private readonly _transport;
|
|
71
|
+
typeName: string;
|
|
72
|
+
methods: import("@protobuf-ts/runtime-rpc").MethodInfo<any, any>[];
|
|
73
|
+
options: {
|
|
74
|
+
[extensionName: string]: import("@protobuf-ts/runtime").JsonValue;
|
|
75
|
+
};
|
|
76
|
+
constructor(_transport: RpcTransport);
|
|
77
|
+
/**
|
|
78
|
+
* open - start listening to updates in keys with provided match patterns
|
|
79
|
+
* provide change_id as last received ID to resume updates
|
|
80
|
+
*
|
|
81
|
+
* @generated from protobuf rpc: open(sessionstorepb.OpenRequest) returns (stream sessionstorepb.ChangeStream);
|
|
82
|
+
*/
|
|
83
|
+
open(input: OpenRequest, options?: RpcOptions): ServerStreamingCall<OpenRequest, ChangeStream>;
|
|
84
|
+
/**
|
|
85
|
+
* get last stored value in given key
|
|
86
|
+
*
|
|
87
|
+
* @generated from protobuf rpc: get(sessionstorepb.GetRequest) returns (sessionstorepb.GetResponse);
|
|
88
|
+
*/
|
|
89
|
+
get(input: GetRequest, options?: RpcOptions): UnaryCall<GetRequest, GetResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* set key value
|
|
92
|
+
*
|
|
93
|
+
* @generated from protobuf rpc: set(sessionstorepb.SetRequest) returns (sessionstorepb.SetResponse);
|
|
94
|
+
*/
|
|
95
|
+
set(input: SetRequest, options?: RpcOptions): UnaryCall<SetRequest, SetResponse>;
|
|
96
|
+
/**
|
|
97
|
+
* delete key from store
|
|
98
|
+
*
|
|
99
|
+
* @generated from protobuf rpc: delete(sessionstorepb.DeleteRequest) returns (sessionstorepb.DeleteResponse);
|
|
100
|
+
*/
|
|
101
|
+
delete(input: DeleteRequest, options?: RpcOptions): UnaryCall<DeleteRequest, DeleteResponse>;
|
|
102
|
+
}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { ServiceType } from '@protobuf-ts/runtime-rpc';
|
|
2
|
+
import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
|
|
3
|
+
import type { IBinaryWriter } from '@protobuf-ts/runtime';
|
|
4
|
+
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
|
|
5
|
+
import type { IBinaryReader } from '@protobuf-ts/runtime';
|
|
6
|
+
import type { PartialMessage } from '@protobuf-ts/runtime';
|
|
7
|
+
import { MessageType } from '@protobuf-ts/runtime';
|
|
8
|
+
/**
|
|
9
|
+
* @generated from protobuf message sessionstorepb.HelloRequest
|
|
10
|
+
*/
|
|
11
|
+
export interface HelloRequest {
|
|
12
|
+
/**
|
|
13
|
+
* @generated from protobuf field: string name = 1;
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @generated from protobuf message sessionstorepb.HelloResponse
|
|
19
|
+
*/
|
|
20
|
+
export interface HelloResponse {
|
|
21
|
+
/**
|
|
22
|
+
* @generated from protobuf field: string response = 1;
|
|
23
|
+
*/
|
|
24
|
+
response: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @generated from protobuf message sessionstorepb.SubscribeRequest
|
|
28
|
+
*/
|
|
29
|
+
export interface SubscribeRequest {
|
|
30
|
+
/**
|
|
31
|
+
* @generated from protobuf field: string name = 1;
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* @generated from protobuf field: int64 offset = 2;
|
|
36
|
+
*/
|
|
37
|
+
offset: bigint;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @generated from protobuf message sessionstorepb.Event
|
|
41
|
+
*/
|
|
42
|
+
export interface Event {
|
|
43
|
+
/**
|
|
44
|
+
* @generated from protobuf field: string message = 1;
|
|
45
|
+
*/
|
|
46
|
+
message: string;
|
|
47
|
+
/**
|
|
48
|
+
* @generated from protobuf field: int64 sequence = 2;
|
|
49
|
+
*/
|
|
50
|
+
sequence: bigint;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* define new structure for value based on client needs and add support in
|
|
54
|
+
* following message
|
|
55
|
+
*
|
|
56
|
+
* @generated from protobuf message sessionstorepb.Value
|
|
57
|
+
*/
|
|
58
|
+
export interface Value {
|
|
59
|
+
/**
|
|
60
|
+
* @generated from protobuf field: sessionstorepb.Value.Type type = 1;
|
|
61
|
+
*/
|
|
62
|
+
type: Value_Type;
|
|
63
|
+
/**
|
|
64
|
+
* @generated from protobuf oneof: Data
|
|
65
|
+
*/
|
|
66
|
+
data: {
|
|
67
|
+
oneofKind: 'number';
|
|
68
|
+
/**
|
|
69
|
+
* @generated from protobuf field: int64 number = 2;
|
|
70
|
+
*/
|
|
71
|
+
number: bigint;
|
|
72
|
+
} | {
|
|
73
|
+
oneofKind: 'float';
|
|
74
|
+
/**
|
|
75
|
+
* @generated from protobuf field: float float = 3;
|
|
76
|
+
*/
|
|
77
|
+
float: number;
|
|
78
|
+
} | {
|
|
79
|
+
oneofKind: 'str';
|
|
80
|
+
/**
|
|
81
|
+
* @generated from protobuf field: string str = 4;
|
|
82
|
+
*/
|
|
83
|
+
str: string;
|
|
84
|
+
} | {
|
|
85
|
+
oneofKind: 'rawBytes';
|
|
86
|
+
/**
|
|
87
|
+
* @generated from protobuf field: bytes raw_bytes = 5;
|
|
88
|
+
*/
|
|
89
|
+
rawBytes: Uint8Array;
|
|
90
|
+
} | {
|
|
91
|
+
oneofKind: undefined;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @generated from protobuf enum sessionstorepb.Value.Type
|
|
96
|
+
*/
|
|
97
|
+
export declare enum Value_Type {
|
|
98
|
+
/**
|
|
99
|
+
* @generated from protobuf enum value: NONE = 0;
|
|
100
|
+
*/
|
|
101
|
+
NONE = 0,
|
|
102
|
+
/**
|
|
103
|
+
* @generated from protobuf enum value: BYTES = 1;
|
|
104
|
+
*/
|
|
105
|
+
BYTES = 1,
|
|
106
|
+
/**
|
|
107
|
+
* @generated from protobuf enum value: STRING = 2;
|
|
108
|
+
*/
|
|
109
|
+
STRING = 2,
|
|
110
|
+
/**
|
|
111
|
+
* @generated from protobuf enum value: INTEGER = 3;
|
|
112
|
+
*/
|
|
113
|
+
INTEGER = 3,
|
|
114
|
+
/**
|
|
115
|
+
* @generated from protobuf enum value: FLOAT = 4;
|
|
116
|
+
*/
|
|
117
|
+
FLOAT = 4
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* @generated from protobuf message sessionstorepb.GetRequest
|
|
121
|
+
*/
|
|
122
|
+
export interface GetRequest {
|
|
123
|
+
/**
|
|
124
|
+
* @generated from protobuf field: string key = 1;
|
|
125
|
+
*/
|
|
126
|
+
key: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @generated from protobuf message sessionstorepb.GetResponse
|
|
130
|
+
*/
|
|
131
|
+
export interface GetResponse {
|
|
132
|
+
/**
|
|
133
|
+
* @generated from protobuf field: string key = 1;
|
|
134
|
+
*/
|
|
135
|
+
key: string;
|
|
136
|
+
/**
|
|
137
|
+
* @generated from protobuf field: string namespace = 2;
|
|
138
|
+
*/
|
|
139
|
+
namespace: string;
|
|
140
|
+
/**
|
|
141
|
+
* @generated from protobuf field: sessionstorepb.Value value = 3;
|
|
142
|
+
*/
|
|
143
|
+
value?: Value;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @generated from protobuf message sessionstorepb.DeleteRequest
|
|
147
|
+
*/
|
|
148
|
+
export interface DeleteRequest {
|
|
149
|
+
/**
|
|
150
|
+
* @generated from protobuf field: string key = 1;
|
|
151
|
+
*/
|
|
152
|
+
key: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @generated from protobuf message sessionstorepb.DeleteResponse
|
|
156
|
+
*/
|
|
157
|
+
export interface DeleteResponse {
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @generated from protobuf message sessionstorepb.SetRequest
|
|
161
|
+
*/
|
|
162
|
+
export interface SetRequest {
|
|
163
|
+
/**
|
|
164
|
+
* @generated from protobuf field: string key = 1;
|
|
165
|
+
*/
|
|
166
|
+
key: string;
|
|
167
|
+
/**
|
|
168
|
+
* @generated from protobuf field: sessionstorepb.Value value = 3;
|
|
169
|
+
*/
|
|
170
|
+
value?: Value;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @generated from protobuf message sessionstorepb.SetResponse
|
|
174
|
+
*/
|
|
175
|
+
export interface SetResponse {
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @generated from protobuf message sessionstorepb.ChangeStream
|
|
179
|
+
*/
|
|
180
|
+
export interface ChangeStream {
|
|
181
|
+
/**
|
|
182
|
+
* @generated from protobuf field: string change_id = 1;
|
|
183
|
+
*/
|
|
184
|
+
changeId: string;
|
|
185
|
+
/**
|
|
186
|
+
* @generated from protobuf field: string key = 2;
|
|
187
|
+
*/
|
|
188
|
+
key: string;
|
|
189
|
+
/**
|
|
190
|
+
* @generated from protobuf field: string namespace = 3;
|
|
191
|
+
*/
|
|
192
|
+
namespace: string;
|
|
193
|
+
/**
|
|
194
|
+
* @generated from protobuf field: sessionstorepb.Value value = 4;
|
|
195
|
+
*/
|
|
196
|
+
value?: Value;
|
|
197
|
+
/**
|
|
198
|
+
* @generated from protobuf field: string from_id = 5;
|
|
199
|
+
*/
|
|
200
|
+
fromId: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @generated from protobuf message sessionstorepb.Select
|
|
204
|
+
*/
|
|
205
|
+
export interface Select {
|
|
206
|
+
/**
|
|
207
|
+
* @generated from protobuf oneof: match
|
|
208
|
+
*/
|
|
209
|
+
match: {
|
|
210
|
+
oneofKind: 'all';
|
|
211
|
+
/**
|
|
212
|
+
* @generated from protobuf field: string all = 1;
|
|
213
|
+
*/
|
|
214
|
+
all: string;
|
|
215
|
+
} | {
|
|
216
|
+
oneofKind: 'key';
|
|
217
|
+
/**
|
|
218
|
+
* @generated from protobuf field: string key = 2;
|
|
219
|
+
*/
|
|
220
|
+
key: string;
|
|
221
|
+
} | {
|
|
222
|
+
oneofKind: 'prefix';
|
|
223
|
+
/**
|
|
224
|
+
* @generated from protobuf field: string prefix = 3;
|
|
225
|
+
*/
|
|
226
|
+
prefix: string;
|
|
227
|
+
} | {
|
|
228
|
+
oneofKind: 'suffix';
|
|
229
|
+
/**
|
|
230
|
+
* @generated from protobuf field: string suffix = 4;
|
|
231
|
+
*/
|
|
232
|
+
suffix: string;
|
|
233
|
+
} | {
|
|
234
|
+
oneofKind: undefined;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @generated from protobuf message sessionstorepb.OpenRequest
|
|
239
|
+
*/
|
|
240
|
+
export interface OpenRequest {
|
|
241
|
+
/**
|
|
242
|
+
* last received change_id for reconnection, "" if first connection
|
|
243
|
+
*
|
|
244
|
+
* @generated from protobuf field: string change_id = 1;
|
|
245
|
+
*/
|
|
246
|
+
changeId: string;
|
|
247
|
+
/**
|
|
248
|
+
* @generated from protobuf field: repeated sessionstorepb.Select select = 3;
|
|
249
|
+
*/
|
|
250
|
+
select: Select[];
|
|
251
|
+
}
|
|
252
|
+
declare class HelloRequest$Type extends MessageType<HelloRequest> {
|
|
253
|
+
constructor();
|
|
254
|
+
create(value?: PartialMessage<HelloRequest>): HelloRequest;
|
|
255
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HelloRequest): HelloRequest;
|
|
256
|
+
internalBinaryWrite(message: HelloRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @generated MessageType for protobuf message sessionstorepb.HelloRequest
|
|
260
|
+
*/
|
|
261
|
+
export declare const HelloRequest: HelloRequest$Type;
|
|
262
|
+
declare class HelloResponse$Type extends MessageType<HelloResponse> {
|
|
263
|
+
constructor();
|
|
264
|
+
create(value?: PartialMessage<HelloResponse>): HelloResponse;
|
|
265
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HelloResponse): HelloResponse;
|
|
266
|
+
internalBinaryWrite(message: HelloResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @generated MessageType for protobuf message sessionstorepb.HelloResponse
|
|
270
|
+
*/
|
|
271
|
+
export declare const HelloResponse: HelloResponse$Type;
|
|
272
|
+
declare class SubscribeRequest$Type extends MessageType<SubscribeRequest> {
|
|
273
|
+
constructor();
|
|
274
|
+
create(value?: PartialMessage<SubscribeRequest>): SubscribeRequest;
|
|
275
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeRequest): SubscribeRequest;
|
|
276
|
+
internalBinaryWrite(message: SubscribeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* @generated MessageType for protobuf message sessionstorepb.SubscribeRequest
|
|
280
|
+
*/
|
|
281
|
+
export declare const SubscribeRequest: SubscribeRequest$Type;
|
|
282
|
+
declare class Event$Type extends MessageType<Event> {
|
|
283
|
+
constructor();
|
|
284
|
+
create(value?: PartialMessage<Event>): Event;
|
|
285
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Event): Event;
|
|
286
|
+
internalBinaryWrite(message: Event, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @generated MessageType for protobuf message sessionstorepb.Event
|
|
290
|
+
*/
|
|
291
|
+
export declare const Event: Event$Type;
|
|
292
|
+
declare class Value$Type extends MessageType<Value> {
|
|
293
|
+
constructor();
|
|
294
|
+
create(value?: PartialMessage<Value>): Value;
|
|
295
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value;
|
|
296
|
+
internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* @generated MessageType for protobuf message sessionstorepb.Value
|
|
300
|
+
*/
|
|
301
|
+
export declare const Value: Value$Type;
|
|
302
|
+
declare class GetRequest$Type extends MessageType<GetRequest> {
|
|
303
|
+
constructor();
|
|
304
|
+
create(value?: PartialMessage<GetRequest>): GetRequest;
|
|
305
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRequest): GetRequest;
|
|
306
|
+
internalBinaryWrite(message: GetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* @generated MessageType for protobuf message sessionstorepb.GetRequest
|
|
310
|
+
*/
|
|
311
|
+
export declare const GetRequest: GetRequest$Type;
|
|
312
|
+
declare class GetResponse$Type extends MessageType<GetResponse> {
|
|
313
|
+
constructor();
|
|
314
|
+
create(value?: PartialMessage<GetResponse>): GetResponse;
|
|
315
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetResponse): GetResponse;
|
|
316
|
+
internalBinaryWrite(message: GetResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* @generated MessageType for protobuf message sessionstorepb.GetResponse
|
|
320
|
+
*/
|
|
321
|
+
export declare const GetResponse: GetResponse$Type;
|
|
322
|
+
declare class DeleteRequest$Type extends MessageType<DeleteRequest> {
|
|
323
|
+
constructor();
|
|
324
|
+
create(value?: PartialMessage<DeleteRequest>): DeleteRequest;
|
|
325
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteRequest): DeleteRequest;
|
|
326
|
+
internalBinaryWrite(message: DeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @generated MessageType for protobuf message sessionstorepb.DeleteRequest
|
|
330
|
+
*/
|
|
331
|
+
export declare const DeleteRequest: DeleteRequest$Type;
|
|
332
|
+
declare class DeleteResponse$Type extends MessageType<DeleteResponse> {
|
|
333
|
+
constructor();
|
|
334
|
+
create(value?: PartialMessage<DeleteResponse>): DeleteResponse;
|
|
335
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteResponse): DeleteResponse;
|
|
336
|
+
internalBinaryWrite(message: DeleteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* @generated MessageType for protobuf message sessionstorepb.DeleteResponse
|
|
340
|
+
*/
|
|
341
|
+
export declare const DeleteResponse: DeleteResponse$Type;
|
|
342
|
+
declare class SetRequest$Type extends MessageType<SetRequest> {
|
|
343
|
+
constructor();
|
|
344
|
+
create(value?: PartialMessage<SetRequest>): SetRequest;
|
|
345
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetRequest): SetRequest;
|
|
346
|
+
internalBinaryWrite(message: SetRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* @generated MessageType for protobuf message sessionstorepb.SetRequest
|
|
350
|
+
*/
|
|
351
|
+
export declare const SetRequest: SetRequest$Type;
|
|
352
|
+
declare class SetResponse$Type extends MessageType<SetResponse> {
|
|
353
|
+
constructor();
|
|
354
|
+
create(value?: PartialMessage<SetResponse>): SetResponse;
|
|
355
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetResponse): SetResponse;
|
|
356
|
+
internalBinaryWrite(message: SetResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* @generated MessageType for protobuf message sessionstorepb.SetResponse
|
|
360
|
+
*/
|
|
361
|
+
export declare const SetResponse: SetResponse$Type;
|
|
362
|
+
declare class ChangeStream$Type extends MessageType<ChangeStream> {
|
|
363
|
+
constructor();
|
|
364
|
+
create(value?: PartialMessage<ChangeStream>): ChangeStream;
|
|
365
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChangeStream): ChangeStream;
|
|
366
|
+
internalBinaryWrite(message: ChangeStream, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* @generated MessageType for protobuf message sessionstorepb.ChangeStream
|
|
370
|
+
*/
|
|
371
|
+
export declare const ChangeStream: ChangeStream$Type;
|
|
372
|
+
declare class Select$Type extends MessageType<Select> {
|
|
373
|
+
constructor();
|
|
374
|
+
create(value?: PartialMessage<Select>): Select;
|
|
375
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Select): Select;
|
|
376
|
+
internalBinaryWrite(message: Select, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @generated MessageType for protobuf message sessionstorepb.Select
|
|
380
|
+
*/
|
|
381
|
+
export declare const Select: Select$Type;
|
|
382
|
+
declare class OpenRequest$Type extends MessageType<OpenRequest> {
|
|
383
|
+
constructor();
|
|
384
|
+
create(value?: PartialMessage<OpenRequest>): OpenRequest;
|
|
385
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenRequest): OpenRequest;
|
|
386
|
+
internalBinaryWrite(message: OpenRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* @generated MessageType for protobuf message sessionstorepb.OpenRequest
|
|
390
|
+
*/
|
|
391
|
+
export declare const OpenRequest: OpenRequest$Type;
|
|
392
|
+
/**
|
|
393
|
+
* @generated ServiceType for protobuf service sessionstorepb.Api
|
|
394
|
+
*/
|
|
395
|
+
export declare const Api: ServiceType;
|
|
396
|
+
/**
|
|
397
|
+
* @generated ServiceType for protobuf service sessionstorepb.Store
|
|
398
|
+
*/
|
|
399
|
+
export declare const Store: ServiceType;
|
|
400
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface OpenCallbacks<T> {
|
|
2
|
+
handleChange: (key: string, value?: T) => void;
|
|
3
|
+
handleError: (error: Error) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare class SessionStore<T> {
|
|
6
|
+
private storeClient;
|
|
7
|
+
constructor(endpoint: string, token: string);
|
|
8
|
+
open({ handleChange, handleError }: OpenCallbacks<T>): void;
|
|
9
|
+
set(key: string, value?: T): import("@protobuf-ts/runtime-rpc").UnaryCall<import("../grpc/sessionstore").SetRequest, import("../grpc/sessionstore").SetResponse>;
|
|
10
|
+
get(key: string): Promise<T | undefined>;
|
|
11
|
+
delete(key: string): import("@protobuf-ts/runtime-rpc").UnaryCall<import("../grpc/sessionstore").DeleteRequest, import("../grpc/sessionstore").DeleteResponse>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const DEFAULT_STORE: {
|
|
2
|
+
store: {
|
|
3
|
+
'document:document': {
|
|
4
|
+
gridSize: number;
|
|
5
|
+
name: string;
|
|
6
|
+
meta: {};
|
|
7
|
+
id: string;
|
|
8
|
+
typeName: string;
|
|
9
|
+
};
|
|
10
|
+
'pointer:pointer': {
|
|
11
|
+
id: string;
|
|
12
|
+
typeName: string;
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
lastActivityTimestamp: number;
|
|
16
|
+
meta: {};
|
|
17
|
+
};
|
|
18
|
+
'page:page': {
|
|
19
|
+
meta: {};
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
index: string;
|
|
23
|
+
typeName: string;
|
|
24
|
+
};
|
|
25
|
+
'camera:page:page': {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
z: number;
|
|
29
|
+
meta: {};
|
|
30
|
+
id: string;
|
|
31
|
+
typeName: string;
|
|
32
|
+
};
|
|
33
|
+
'instance_page_state:page:page': {
|
|
34
|
+
editingShapeId: null;
|
|
35
|
+
croppingShapeId: null;
|
|
36
|
+
selectedShapeIds: never[];
|
|
37
|
+
hoveredShapeId: null;
|
|
38
|
+
erasingShapeIds: never[];
|
|
39
|
+
hintingShapeIds: never[];
|
|
40
|
+
focusedGroupId: null;
|
|
41
|
+
meta: {};
|
|
42
|
+
id: string;
|
|
43
|
+
pageId: string;
|
|
44
|
+
typeName: string;
|
|
45
|
+
};
|
|
46
|
+
'instance:instance': {
|
|
47
|
+
followingUserId: null;
|
|
48
|
+
opacityForNextShape: number;
|
|
49
|
+
stylesForNextShape: {};
|
|
50
|
+
brush: null;
|
|
51
|
+
scribble: null;
|
|
52
|
+
cursor: {
|
|
53
|
+
type: string;
|
|
54
|
+
rotation: number;
|
|
55
|
+
};
|
|
56
|
+
isFocusMode: boolean;
|
|
57
|
+
exportBackground: boolean;
|
|
58
|
+
isDebugMode: boolean;
|
|
59
|
+
isToolLocked: boolean;
|
|
60
|
+
screenBounds: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
w: number;
|
|
64
|
+
h: number;
|
|
65
|
+
};
|
|
66
|
+
zoomBrush: null;
|
|
67
|
+
isGridMode: boolean;
|
|
68
|
+
isPenMode: boolean;
|
|
69
|
+
chatMessage: string;
|
|
70
|
+
isChatting: boolean;
|
|
71
|
+
highlightedUserIds: never[];
|
|
72
|
+
canMoveCamera: boolean;
|
|
73
|
+
isFocused: boolean;
|
|
74
|
+
devicePixelRatio: number;
|
|
75
|
+
isCoarsePointer: boolean;
|
|
76
|
+
isHoveringCanvas: boolean;
|
|
77
|
+
openMenus: never[];
|
|
78
|
+
isChangingStyle: boolean;
|
|
79
|
+
isReadonly: boolean;
|
|
80
|
+
meta: {};
|
|
81
|
+
id: string;
|
|
82
|
+
currentPageId: string;
|
|
83
|
+
typeName: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
schema: {
|
|
87
|
+
schemaVersion: number;
|
|
88
|
+
storeVersion: number;
|
|
89
|
+
recordVersions: {
|
|
90
|
+
asset: {
|
|
91
|
+
version: number;
|
|
92
|
+
subTypeKey: string;
|
|
93
|
+
subTypeVersions: {
|
|
94
|
+
image: number;
|
|
95
|
+
video: number;
|
|
96
|
+
bookmark: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
camera: {
|
|
100
|
+
version: number;
|
|
101
|
+
};
|
|
102
|
+
document: {
|
|
103
|
+
version: number;
|
|
104
|
+
};
|
|
105
|
+
instance: {
|
|
106
|
+
version: number;
|
|
107
|
+
};
|
|
108
|
+
instance_page_state: {
|
|
109
|
+
version: number;
|
|
110
|
+
};
|
|
111
|
+
page: {
|
|
112
|
+
version: number;
|
|
113
|
+
};
|
|
114
|
+
shape: {
|
|
115
|
+
version: number;
|
|
116
|
+
subTypeKey: string;
|
|
117
|
+
subTypeVersions: {
|
|
118
|
+
group: number;
|
|
119
|
+
text: number;
|
|
120
|
+
bookmark: number;
|
|
121
|
+
draw: number;
|
|
122
|
+
geo: number;
|
|
123
|
+
note: number;
|
|
124
|
+
line: number;
|
|
125
|
+
frame: number;
|
|
126
|
+
arrow: number;
|
|
127
|
+
highlight: number;
|
|
128
|
+
embed: number;
|
|
129
|
+
image: number;
|
|
130
|
+
video: number;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
instance_presence: {
|
|
134
|
+
version: number;
|
|
135
|
+
};
|
|
136
|
+
pointer: {
|
|
137
|
+
version: number;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Editor, TLAnyShapeUtilConstructor, TLStoreWithStatus } from '@tldraw/tldraw';
|
|
2
|
+
export declare function useCollaboration({ endpoint, token, editor, shapeUtils, zoomToContent, }: {
|
|
3
|
+
endpoint?: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
editor?: Editor;
|
|
6
|
+
shapeUtils?: TLAnyShapeUtilConstructor[];
|
|
7
|
+
zoomToContent?: boolean;
|
|
8
|
+
}): TLStoreWithStatus;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TLRecord } from '@tldraw/tldraw';
|
|
2
|
+
import { SessionStore } from './StoreClient';
|
|
3
|
+
export declare const useSessionStore: ({ token, endpoint, handleError, }: {
|
|
4
|
+
token?: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
handleError: (error: Error) => void;
|
|
7
|
+
}) => void | SessionStore<TLRecord>;
|