@kokimoki/app 1.11.1 → 1.13.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/kokimoki-client.d.ts +4 -0
- package/dist/kokimoki-client.js +14 -0
- package/dist/kokimoki.min.d.ts +4 -0
- package/dist/kokimoki.min.js +15 -1
- package/dist/kokimoki.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/kokimoki-client-refactored.d.ts +0 -68
- package/dist/kokimoki-client-refactored.js +0 -394
- package/dist/message-queue.d.ts +0 -8
- package/dist/message-queue.js +0 -19
- package/dist/synced-schema.d.ts +0 -59
- package/dist/synced-schema.js +0 -84
- package/dist/synced-store.d.ts +0 -7
- package/dist/synced-store.js +0 -9
- package/dist/synced-types.d.ts +0 -38
- package/dist/synced-types.js +0 -68
- package/dist/ws-message-type copy.d.ts +0 -6
- package/dist/ws-message-type copy.js +0 -7
package/dist/synced-types.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export declare abstract class SyncedGeneric<T> {
|
|
2
|
-
abstract get defaultValue(): T;
|
|
3
|
-
abstract set defaultValue(value: T);
|
|
4
|
-
}
|
|
5
|
-
export declare class SyncedNumber extends SyncedGeneric<number> {
|
|
6
|
-
defaultValue: number;
|
|
7
|
-
constructor(defaultValue?: number);
|
|
8
|
-
}
|
|
9
|
-
export declare function syncedNumber(defaultValue?: number): SyncedNumber;
|
|
10
|
-
export declare class SyncedString extends SyncedGeneric<string> {
|
|
11
|
-
defaultValue: string;
|
|
12
|
-
constructor(defaultValue?: string);
|
|
13
|
-
}
|
|
14
|
-
export declare function syncedString(defaultValue?: string): SyncedString;
|
|
15
|
-
export declare class SyncedBoolean extends SyncedGeneric<boolean> {
|
|
16
|
-
defaultValue: boolean;
|
|
17
|
-
constructor(defaultValue?: boolean);
|
|
18
|
-
}
|
|
19
|
-
export declare function syncedBoolean(defaultValue?: boolean): SyncedBoolean;
|
|
20
|
-
export declare class SyncedMap<Data extends Record<string, SyncedGeneric<unknown>>> extends SyncedGeneric<{
|
|
21
|
-
[key in keyof Data]: Data[key]["defaultValue"];
|
|
22
|
-
}> {
|
|
23
|
-
fields: Data;
|
|
24
|
-
constructor(fields: Data);
|
|
25
|
-
get defaultValue(): {
|
|
26
|
-
[key in keyof Data]: Data[key]["defaultValue"];
|
|
27
|
-
};
|
|
28
|
-
set defaultValue(value: {
|
|
29
|
-
[key in keyof Data]: Data[key]["defaultValue"];
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export declare function syncedMap<T extends Record<string, SyncedGeneric<unknown>>>(schema: T): SyncedMap<T>;
|
|
33
|
-
export declare class SyncedArray<T extends SyncedGeneric<unknown>> extends SyncedGeneric<T["defaultValue"][]> {
|
|
34
|
-
schema: T;
|
|
35
|
-
defaultValue: T["defaultValue"][];
|
|
36
|
-
constructor(schema: T, defaultValue?: T["defaultValue"][]);
|
|
37
|
-
}
|
|
38
|
-
export declare function syncedArray<T extends SyncedGeneric<unknown>>(schema: T, defaultValue?: T["defaultValue"][]): SyncedArray<T>;
|
package/dist/synced-types.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as Y from "yjs";
|
|
2
|
-
import { proxy as yjsProxy } from "valtio";
|
|
3
|
-
import { bind as yjsBind } from "valtio-yjs";
|
|
4
|
-
export class SyncedGeneric {
|
|
5
|
-
}
|
|
6
|
-
export class SyncedNumber extends SyncedGeneric {
|
|
7
|
-
defaultValue;
|
|
8
|
-
constructor(defaultValue = 0) {
|
|
9
|
-
super();
|
|
10
|
-
this.defaultValue = defaultValue;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export function syncedNumber(defaultValue = 0) {
|
|
14
|
-
return new SyncedNumber(defaultValue);
|
|
15
|
-
}
|
|
16
|
-
export class SyncedString extends SyncedGeneric {
|
|
17
|
-
defaultValue;
|
|
18
|
-
constructor(defaultValue = "") {
|
|
19
|
-
super();
|
|
20
|
-
this.defaultValue = defaultValue;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export function syncedString(defaultValue = "") {
|
|
24
|
-
return new SyncedString(defaultValue);
|
|
25
|
-
}
|
|
26
|
-
export class SyncedBoolean extends SyncedGeneric {
|
|
27
|
-
defaultValue;
|
|
28
|
-
constructor(defaultValue = false) {
|
|
29
|
-
super();
|
|
30
|
-
this.defaultValue = defaultValue;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export function syncedBoolean(defaultValue = false) {
|
|
34
|
-
return new SyncedBoolean(defaultValue);
|
|
35
|
-
}
|
|
36
|
-
export class SyncedMap extends SyncedGeneric {
|
|
37
|
-
fields;
|
|
38
|
-
constructor(fields) {
|
|
39
|
-
super();
|
|
40
|
-
this.fields = fields;
|
|
41
|
-
}
|
|
42
|
-
get defaultValue() {
|
|
43
|
-
return Object.entries(this.fields).reduce((acc, [key, field]) => {
|
|
44
|
-
acc[key] = field.defaultValue;
|
|
45
|
-
return acc;
|
|
46
|
-
}, {});
|
|
47
|
-
}
|
|
48
|
-
set defaultValue(value) {
|
|
49
|
-
for (const [key, field] of Object.entries(this.fields)) {
|
|
50
|
-
field.defaultValue = value[key];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export function syncedMap(schema) {
|
|
55
|
-
return new SyncedMap(schema);
|
|
56
|
-
}
|
|
57
|
-
export class SyncedArray extends SyncedGeneric {
|
|
58
|
-
schema;
|
|
59
|
-
defaultValue;
|
|
60
|
-
constructor(schema, defaultValue = []) {
|
|
61
|
-
super();
|
|
62
|
-
this.schema = schema;
|
|
63
|
-
this.defaultValue = defaultValue;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export function syncedArray(schema, defaultValue = []) {
|
|
67
|
-
return new SyncedArray(schema, defaultValue);
|
|
68
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export var WsMessageType;
|
|
2
|
-
(function (WsMessageType) {
|
|
3
|
-
WsMessageType[WsMessageType["SubscribeReq"] = 1] = "SubscribeReq";
|
|
4
|
-
WsMessageType[WsMessageType["SubscribeRes"] = 2] = "SubscribeRes";
|
|
5
|
-
WsMessageType[WsMessageType["Transaction"] = 3] = "Transaction";
|
|
6
|
-
WsMessageType[WsMessageType["RoomUpdate"] = 4] = "RoomUpdate";
|
|
7
|
-
})(WsMessageType || (WsMessageType = {}));
|