-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathconfig.ts
71 lines (64 loc) · 1.75 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import {
defineRuntimeConfig,
defineStartupConfig,
ModuleConfig,
} from '../../base/config';
interface DocStartupConfigurations {
manager: {
/**
* Whether auto merge updates into doc snapshot.
*/
enableUpdateAutoMerging: boolean;
/**
* How often the [DocManager] will start a new turn of merging pending updates into doc snapshot.
*
* This is not the latency a new joint client will take to see the latest doc,
* but the buffer time we introduced to reduce the load of our service.
*
* in {ms}
*/
updatePollInterval: number;
/**
* The maximum number of updates that will be pulled from the server at once.
* Existing for avoiding the server to be overloaded when there are too many updates for one doc.
*/
maxUpdatesPullCount: number;
};
history: {
/**
* How long the buffer time of creating a new history snapshot when doc get updated.
*
* in {ms}
*/
interval: number;
};
}
interface DocRuntimeConfigurations {
/**
* Use `y-octo` to merge updates at the same time when merging using Yjs.
*
* This is an experimental feature, and aimed to check the correctness of JwstCodec.
*/
experimentalMergeWithYOcto: boolean;
}
declare module '../../base/config' {
interface AppConfig {
doc: ModuleConfig<DocStartupConfigurations, DocRuntimeConfigurations>;
}
}
defineStartupConfig('doc', {
manager: {
enableUpdateAutoMerging: true,
updatePollInterval: 3000,
maxUpdatesPullCount: 500,
},
history: {
interval: 1000 * 60 * 10 /* 10 mins */,
},
});
defineRuntimeConfig('doc', {
experimentalMergeWithYOcto: {
desc: 'Use `y-octo` to merge updates at the same time when merging using Yjs.',
default: false,
},
});