一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
35 行
815 B
TypeScript
35 行
815 B
TypeScript
import BaseSyncTarget from './BaseSyncTarget';
|
|
import Setting from './models/Setting';
|
|
import Synchronizer from './Synchronizer';
|
|
import { FileApi } from './file-api';
|
|
import FileApiDriverMemory from './file-api-driver-memory';
|
|
|
|
export default class SyncTargetMemory extends BaseSyncTarget {
|
|
public static id() {
|
|
return 1;
|
|
}
|
|
|
|
public static targetName() {
|
|
return 'memory';
|
|
}
|
|
|
|
public static label() {
|
|
return 'Memory';
|
|
}
|
|
|
|
public async isAuthenticated() {
|
|
return true;
|
|
}
|
|
|
|
public async initFileApi() {
|
|
const fileApi = new FileApi('/root', new FileApiDriverMemory());
|
|
fileApi.setLogger(this.logger());
|
|
fileApi.setSyncTargetId(SyncTargetMemory.id());
|
|
return fileApi;
|
|
}
|
|
|
|
public async initSynchronizer() {
|
|
return new Synchronizer(this.db(), await this.fileApi(), Setting.value('appType'));
|
|
}
|
|
}
|