chore: ci fix & module split

This commit is contained in:
DarkSky
2022-08-24 04:14:14 +08:00
parent a81456450f
commit 86d4449db4
3 changed files with 26 additions and 39 deletions
@@ -1,15 +1,16 @@
import { Array as YArray, Map as YMap } from 'yjs';
import { RemoteKvService } from '@toeverything/datasource/remote-kv';
import type { RemoteKvService } from '@toeverything/datasource/remote-kv';
export class YjsRemoteBinaries {
private readonly _binaries: YMap<YArray<ArrayBuffer>>; // binary instance
private readonly _remoteStorage?: RemoteKvService;
constructor(binaries: YMap<YArray<ArrayBuffer>>, remote_token?: string) {
constructor(binaries: YMap<YArray<ArrayBuffer>>, remoteToken?: string) {
this._binaries = binaries;
if (remote_token) {
this._remoteStorage = new RemoteKvService(remote_token);
if (remoteToken) {
// TODO: remote kv need to refactor, we may use cloudflare kv
// this._remoteStorage = new RemoteKvService(remote_token);
} else {
console.warn(`Remote storage is not ready`);
}