@liveblocks/core 3.12.0 → 3.12.1-enums1
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/index.cjs +197 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -44
- package/dist/index.d.ts +93 -44
- package/dist/index.js +157 -152
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -331,16 +331,28 @@ type ContextualPromptContext = {
|
|
|
331
331
|
afterSelection: string;
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
334
|
+
type OpCode = (typeof OpCode)[keyof typeof OpCode];
|
|
335
|
+
declare const OpCode: Readonly<{
|
|
336
|
+
INIT: 0;
|
|
337
|
+
SET_PARENT_KEY: 1;
|
|
338
|
+
CREATE_LIST: 2;
|
|
339
|
+
UPDATE_OBJECT: 3;
|
|
340
|
+
CREATE_OBJECT: 4;
|
|
341
|
+
DELETE_CRDT: 5;
|
|
342
|
+
DELETE_OBJECT_KEY: 6;
|
|
343
|
+
CREATE_MAP: 7;
|
|
344
|
+
CREATE_REGISTER: 8;
|
|
345
|
+
}>;
|
|
346
|
+
declare namespace OpCode {
|
|
347
|
+
type INIT = typeof OpCode.INIT;
|
|
348
|
+
type SET_PARENT_KEY = typeof OpCode.SET_PARENT_KEY;
|
|
349
|
+
type CREATE_LIST = typeof OpCode.CREATE_LIST;
|
|
350
|
+
type UPDATE_OBJECT = typeof OpCode.UPDATE_OBJECT;
|
|
351
|
+
type CREATE_OBJECT = typeof OpCode.CREATE_OBJECT;
|
|
352
|
+
type DELETE_CRDT = typeof OpCode.DELETE_CRDT;
|
|
353
|
+
type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
|
|
354
|
+
type CREATE_MAP = typeof OpCode.CREATE_MAP;
|
|
355
|
+
type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
|
|
344
356
|
}
|
|
345
357
|
/**
|
|
346
358
|
* These operations are the payload for {@link UpdateStorageServerMsg} messages
|
|
@@ -434,13 +446,22 @@ type DeleteObjectKeyOp = {
|
|
|
434
446
|
readonly key: string;
|
|
435
447
|
};
|
|
436
448
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
449
|
+
type ClientMsgCode = (typeof ClientMsgCode)[keyof typeof ClientMsgCode];
|
|
450
|
+
declare const ClientMsgCode: Readonly<{
|
|
451
|
+
UPDATE_PRESENCE: 100;
|
|
452
|
+
BROADCAST_EVENT: 103;
|
|
453
|
+
FETCH_STORAGE: 200;
|
|
454
|
+
UPDATE_STORAGE: 201;
|
|
455
|
+
FETCH_YDOC: 300;
|
|
456
|
+
UPDATE_YDOC: 301;
|
|
457
|
+
}>;
|
|
458
|
+
declare namespace ClientMsgCode {
|
|
459
|
+
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
460
|
+
type BROADCAST_EVENT = typeof ClientMsgCode.BROADCAST_EVENT;
|
|
461
|
+
type FETCH_STORAGE = typeof ClientMsgCode.FETCH_STORAGE;
|
|
462
|
+
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
463
|
+
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
464
|
+
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
444
465
|
}
|
|
445
466
|
/**
|
|
446
467
|
* Messages that can be sent from the client to the server.
|
|
@@ -573,11 +594,18 @@ type PlainLsonList = {
|
|
|
573
594
|
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
|
|
574
595
|
|
|
575
596
|
type IdTuple<T> = [id: string, value: T];
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
597
|
+
type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
|
|
598
|
+
declare const CrdtType: Readonly<{
|
|
599
|
+
OBJECT: 0;
|
|
600
|
+
LIST: 1;
|
|
601
|
+
MAP: 2;
|
|
602
|
+
REGISTER: 3;
|
|
603
|
+
}>;
|
|
604
|
+
declare namespace CrdtType {
|
|
605
|
+
type OBJECT = typeof CrdtType.OBJECT;
|
|
606
|
+
type LIST = typeof CrdtType.LIST;
|
|
607
|
+
type MAP = typeof CrdtType.MAP;
|
|
608
|
+
type REGISTER = typeof CrdtType.REGISTER;
|
|
581
609
|
}
|
|
582
610
|
type SerializedCrdt = SerializedRootObject | SerializedChild;
|
|
583
611
|
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
|
|
@@ -2468,25 +2496,46 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2468
2496
|
canZombie: () => boolean;
|
|
2469
2497
|
};
|
|
2470
2498
|
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2499
|
+
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2500
|
+
declare const ServerMsgCode: Readonly<{
|
|
2501
|
+
UPDATE_PRESENCE: 100;
|
|
2502
|
+
USER_JOINED: 101;
|
|
2503
|
+
USER_LEFT: 102;
|
|
2504
|
+
BROADCASTED_EVENT: 103;
|
|
2505
|
+
ROOM_STATE: 104;
|
|
2506
|
+
INITIAL_STORAGE_STATE: 200;
|
|
2507
|
+
UPDATE_STORAGE: 201;
|
|
2508
|
+
UPDATE_YDOC: 300;
|
|
2509
|
+
THREAD_CREATED: 400;
|
|
2510
|
+
THREAD_DELETED: 407;
|
|
2511
|
+
THREAD_METADATA_UPDATED: 401;
|
|
2512
|
+
THREAD_UPDATED: 408;
|
|
2513
|
+
COMMENT_CREATED: 402;
|
|
2514
|
+
COMMENT_EDITED: 403;
|
|
2515
|
+
COMMENT_DELETED: 404;
|
|
2516
|
+
COMMENT_REACTION_ADDED: 405;
|
|
2517
|
+
COMMENT_REACTION_REMOVED: 406;
|
|
2518
|
+
REJECT_STORAGE_OP: 299;
|
|
2519
|
+
}>;
|
|
2520
|
+
declare namespace ServerMsgCode {
|
|
2521
|
+
type UPDATE_PRESENCE = typeof ServerMsgCode.UPDATE_PRESENCE;
|
|
2522
|
+
type USER_JOINED = typeof ServerMsgCode.USER_JOINED;
|
|
2523
|
+
type USER_LEFT = typeof ServerMsgCode.USER_LEFT;
|
|
2524
|
+
type BROADCASTED_EVENT = typeof ServerMsgCode.BROADCASTED_EVENT;
|
|
2525
|
+
type ROOM_STATE = typeof ServerMsgCode.ROOM_STATE;
|
|
2526
|
+
type INITIAL_STORAGE_STATE = typeof ServerMsgCode.INITIAL_STORAGE_STATE;
|
|
2527
|
+
type UPDATE_STORAGE = typeof ServerMsgCode.UPDATE_STORAGE;
|
|
2528
|
+
type UPDATE_YDOC = typeof ServerMsgCode.UPDATE_YDOC;
|
|
2529
|
+
type THREAD_CREATED = typeof ServerMsgCode.THREAD_CREATED;
|
|
2530
|
+
type THREAD_DELETED = typeof ServerMsgCode.THREAD_DELETED;
|
|
2531
|
+
type THREAD_METADATA_UPDATED = typeof ServerMsgCode.THREAD_METADATA_UPDATED;
|
|
2532
|
+
type THREAD_UPDATED = typeof ServerMsgCode.THREAD_UPDATED;
|
|
2533
|
+
type COMMENT_CREATED = typeof ServerMsgCode.COMMENT_CREATED;
|
|
2534
|
+
type COMMENT_EDITED = typeof ServerMsgCode.COMMENT_EDITED;
|
|
2535
|
+
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2536
|
+
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2537
|
+
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2538
|
+
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2490
2539
|
}
|
|
2491
2540
|
/**
|
|
2492
2541
|
* Messages that can be sent from the server to the client.
|
|
@@ -2676,9 +2725,9 @@ type RoomStateServerMsg<U extends BaseUserMeta> = {
|
|
|
2676
2725
|
};
|
|
2677
2726
|
};
|
|
2678
2727
|
/**
|
|
2679
|
-
*
|
|
2728
|
+
* Metadata sent from the server to the client.
|
|
2680
2729
|
*/
|
|
2681
|
-
readonly meta
|
|
2730
|
+
readonly meta: JsonObject;
|
|
2682
2731
|
};
|
|
2683
2732
|
/**
|
|
2684
2733
|
* Sent by the WebSocket server to a single client in response to the client
|
|
@@ -3564,7 +3613,7 @@ type DynamicSessionInfo = {
|
|
|
3564
3613
|
readonly actor: number;
|
|
3565
3614
|
readonly nonce: string;
|
|
3566
3615
|
readonly scopes: string[];
|
|
3567
|
-
readonly meta
|
|
3616
|
+
readonly meta: JsonObject;
|
|
3568
3617
|
};
|
|
3569
3618
|
type Polyfills = {
|
|
3570
3619
|
atob?: (data: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -331,16 +331,28 @@ type ContextualPromptContext = {
|
|
|
331
331
|
afterSelection: string;
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
334
|
+
type OpCode = (typeof OpCode)[keyof typeof OpCode];
|
|
335
|
+
declare const OpCode: Readonly<{
|
|
336
|
+
INIT: 0;
|
|
337
|
+
SET_PARENT_KEY: 1;
|
|
338
|
+
CREATE_LIST: 2;
|
|
339
|
+
UPDATE_OBJECT: 3;
|
|
340
|
+
CREATE_OBJECT: 4;
|
|
341
|
+
DELETE_CRDT: 5;
|
|
342
|
+
DELETE_OBJECT_KEY: 6;
|
|
343
|
+
CREATE_MAP: 7;
|
|
344
|
+
CREATE_REGISTER: 8;
|
|
345
|
+
}>;
|
|
346
|
+
declare namespace OpCode {
|
|
347
|
+
type INIT = typeof OpCode.INIT;
|
|
348
|
+
type SET_PARENT_KEY = typeof OpCode.SET_PARENT_KEY;
|
|
349
|
+
type CREATE_LIST = typeof OpCode.CREATE_LIST;
|
|
350
|
+
type UPDATE_OBJECT = typeof OpCode.UPDATE_OBJECT;
|
|
351
|
+
type CREATE_OBJECT = typeof OpCode.CREATE_OBJECT;
|
|
352
|
+
type DELETE_CRDT = typeof OpCode.DELETE_CRDT;
|
|
353
|
+
type DELETE_OBJECT_KEY = typeof OpCode.DELETE_OBJECT_KEY;
|
|
354
|
+
type CREATE_MAP = typeof OpCode.CREATE_MAP;
|
|
355
|
+
type CREATE_REGISTER = typeof OpCode.CREATE_REGISTER;
|
|
344
356
|
}
|
|
345
357
|
/**
|
|
346
358
|
* These operations are the payload for {@link UpdateStorageServerMsg} messages
|
|
@@ -434,13 +446,22 @@ type DeleteObjectKeyOp = {
|
|
|
434
446
|
readonly key: string;
|
|
435
447
|
};
|
|
436
448
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
449
|
+
type ClientMsgCode = (typeof ClientMsgCode)[keyof typeof ClientMsgCode];
|
|
450
|
+
declare const ClientMsgCode: Readonly<{
|
|
451
|
+
UPDATE_PRESENCE: 100;
|
|
452
|
+
BROADCAST_EVENT: 103;
|
|
453
|
+
FETCH_STORAGE: 200;
|
|
454
|
+
UPDATE_STORAGE: 201;
|
|
455
|
+
FETCH_YDOC: 300;
|
|
456
|
+
UPDATE_YDOC: 301;
|
|
457
|
+
}>;
|
|
458
|
+
declare namespace ClientMsgCode {
|
|
459
|
+
type UPDATE_PRESENCE = typeof ClientMsgCode.UPDATE_PRESENCE;
|
|
460
|
+
type BROADCAST_EVENT = typeof ClientMsgCode.BROADCAST_EVENT;
|
|
461
|
+
type FETCH_STORAGE = typeof ClientMsgCode.FETCH_STORAGE;
|
|
462
|
+
type UPDATE_STORAGE = typeof ClientMsgCode.UPDATE_STORAGE;
|
|
463
|
+
type FETCH_YDOC = typeof ClientMsgCode.FETCH_YDOC;
|
|
464
|
+
type UPDATE_YDOC = typeof ClientMsgCode.UPDATE_YDOC;
|
|
444
465
|
}
|
|
445
466
|
/**
|
|
446
467
|
* Messages that can be sent from the client to the server.
|
|
@@ -573,11 +594,18 @@ type PlainLsonList = {
|
|
|
573
594
|
type PlainLson = PlainLsonObject | PlainLsonMap | PlainLsonList | Json;
|
|
574
595
|
|
|
575
596
|
type IdTuple<T> = [id: string, value: T];
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
597
|
+
type CrdtType = (typeof CrdtType)[keyof typeof CrdtType];
|
|
598
|
+
declare const CrdtType: Readonly<{
|
|
599
|
+
OBJECT: 0;
|
|
600
|
+
LIST: 1;
|
|
601
|
+
MAP: 2;
|
|
602
|
+
REGISTER: 3;
|
|
603
|
+
}>;
|
|
604
|
+
declare namespace CrdtType {
|
|
605
|
+
type OBJECT = typeof CrdtType.OBJECT;
|
|
606
|
+
type LIST = typeof CrdtType.LIST;
|
|
607
|
+
type MAP = typeof CrdtType.MAP;
|
|
608
|
+
type REGISTER = typeof CrdtType.REGISTER;
|
|
581
609
|
}
|
|
582
610
|
type SerializedCrdt = SerializedRootObject | SerializedChild;
|
|
583
611
|
type SerializedChild = SerializedObject | SerializedList | SerializedMap | SerializedRegister;
|
|
@@ -2468,25 +2496,46 @@ type Delegates<T extends BaseAuthResult> = {
|
|
|
2468
2496
|
canZombie: () => boolean;
|
|
2469
2497
|
};
|
|
2470
2498
|
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2499
|
+
type ServerMsgCode = (typeof ServerMsgCode)[keyof typeof ServerMsgCode];
|
|
2500
|
+
declare const ServerMsgCode: Readonly<{
|
|
2501
|
+
UPDATE_PRESENCE: 100;
|
|
2502
|
+
USER_JOINED: 101;
|
|
2503
|
+
USER_LEFT: 102;
|
|
2504
|
+
BROADCASTED_EVENT: 103;
|
|
2505
|
+
ROOM_STATE: 104;
|
|
2506
|
+
INITIAL_STORAGE_STATE: 200;
|
|
2507
|
+
UPDATE_STORAGE: 201;
|
|
2508
|
+
UPDATE_YDOC: 300;
|
|
2509
|
+
THREAD_CREATED: 400;
|
|
2510
|
+
THREAD_DELETED: 407;
|
|
2511
|
+
THREAD_METADATA_UPDATED: 401;
|
|
2512
|
+
THREAD_UPDATED: 408;
|
|
2513
|
+
COMMENT_CREATED: 402;
|
|
2514
|
+
COMMENT_EDITED: 403;
|
|
2515
|
+
COMMENT_DELETED: 404;
|
|
2516
|
+
COMMENT_REACTION_ADDED: 405;
|
|
2517
|
+
COMMENT_REACTION_REMOVED: 406;
|
|
2518
|
+
REJECT_STORAGE_OP: 299;
|
|
2519
|
+
}>;
|
|
2520
|
+
declare namespace ServerMsgCode {
|
|
2521
|
+
type UPDATE_PRESENCE = typeof ServerMsgCode.UPDATE_PRESENCE;
|
|
2522
|
+
type USER_JOINED = typeof ServerMsgCode.USER_JOINED;
|
|
2523
|
+
type USER_LEFT = typeof ServerMsgCode.USER_LEFT;
|
|
2524
|
+
type BROADCASTED_EVENT = typeof ServerMsgCode.BROADCASTED_EVENT;
|
|
2525
|
+
type ROOM_STATE = typeof ServerMsgCode.ROOM_STATE;
|
|
2526
|
+
type INITIAL_STORAGE_STATE = typeof ServerMsgCode.INITIAL_STORAGE_STATE;
|
|
2527
|
+
type UPDATE_STORAGE = typeof ServerMsgCode.UPDATE_STORAGE;
|
|
2528
|
+
type UPDATE_YDOC = typeof ServerMsgCode.UPDATE_YDOC;
|
|
2529
|
+
type THREAD_CREATED = typeof ServerMsgCode.THREAD_CREATED;
|
|
2530
|
+
type THREAD_DELETED = typeof ServerMsgCode.THREAD_DELETED;
|
|
2531
|
+
type THREAD_METADATA_UPDATED = typeof ServerMsgCode.THREAD_METADATA_UPDATED;
|
|
2532
|
+
type THREAD_UPDATED = typeof ServerMsgCode.THREAD_UPDATED;
|
|
2533
|
+
type COMMENT_CREATED = typeof ServerMsgCode.COMMENT_CREATED;
|
|
2534
|
+
type COMMENT_EDITED = typeof ServerMsgCode.COMMENT_EDITED;
|
|
2535
|
+
type COMMENT_DELETED = typeof ServerMsgCode.COMMENT_DELETED;
|
|
2536
|
+
type COMMENT_REACTION_ADDED = typeof ServerMsgCode.COMMENT_REACTION_ADDED;
|
|
2537
|
+
type COMMENT_REACTION_REMOVED = typeof ServerMsgCode.COMMENT_REACTION_REMOVED;
|
|
2538
|
+
type REJECT_STORAGE_OP = typeof ServerMsgCode.REJECT_STORAGE_OP;
|
|
2490
2539
|
}
|
|
2491
2540
|
/**
|
|
2492
2541
|
* Messages that can be sent from the server to the client.
|
|
@@ -2676,9 +2725,9 @@ type RoomStateServerMsg<U extends BaseUserMeta> = {
|
|
|
2676
2725
|
};
|
|
2677
2726
|
};
|
|
2678
2727
|
/**
|
|
2679
|
-
*
|
|
2728
|
+
* Metadata sent from the server to the client.
|
|
2680
2729
|
*/
|
|
2681
|
-
readonly meta
|
|
2730
|
+
readonly meta: JsonObject;
|
|
2682
2731
|
};
|
|
2683
2732
|
/**
|
|
2684
2733
|
* Sent by the WebSocket server to a single client in response to the client
|
|
@@ -3564,7 +3613,7 @@ type DynamicSessionInfo = {
|
|
|
3564
3613
|
readonly actor: number;
|
|
3565
3614
|
readonly nonce: string;
|
|
3566
3615
|
readonly scopes: string[];
|
|
3567
|
-
readonly meta
|
|
3616
|
+
readonly meta: JsonObject;
|
|
3568
3617
|
};
|
|
3569
3618
|
type Polyfills = {
|
|
3570
3619
|
atob?: (data: string) => string;
|