export interface SynConfig { hearbeatInterval : number ; requestTimeout : number ; outOfSessionTimeout : number ; syncStrategy : SyncStrategy ; commitStrategy : CommitStrategy ; } export enum SyncStrategy { CRDT , BlockOnConflict , DropOnConflict } export interface CommitStrategy { CommitEveryNMs : number | undefined ; CommitEveryNDeltas : number | undefined ; } export function defaultConfig ( ) { return { hearbeatInterval : 30 * 1000 , outOfSessionTimeout : 8 * 1000 , requestTimeout : 1000 , commitStrategy : { CommitEveryNDeltas : 20000 , CommitEveryNMs : 2 * 100000 * 60 } , syncStrategy : SyncStrategy . BlockOnConflict , } ; } export type RecursivePartial < T > = { [ P in keyof T ] ? : T [ P ] extends ( infer U ) [ ] ? RecursivePartial < U > [ ] : T [ P ] extends object ? RecursivePartial < T [ P ] > : T [ P ] ; } ;