Refactor & update API
This commit is contained in:
parent
5f1075879f
commit
3065edba37
6 changed files with 42 additions and 33 deletions
|
|
@ -1,27 +1,11 @@
|
|||
import { Logger } from "src/logger";
|
||||
|
||||
export type DocumentId = string;
|
||||
export type DocumentVersionId = number;
|
||||
export type RelativePath = string;
|
||||
|
||||
export interface SyncSettings {
|
||||
remoteUri: string;
|
||||
token: string;
|
||||
fullScanIntervalInSeconds: number;
|
||||
fullScanEnabled: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: SyncSettings = {
|
||||
remoteUri: "",
|
||||
token: "",
|
||||
fullScanIntervalInSeconds: 60,
|
||||
fullScanEnabled: true,
|
||||
};
|
||||
|
||||
export interface DocumentMetadata {
|
||||
documentId: DocumentId;
|
||||
parentVersionId: DocumentVersionId;
|
||||
}
|
||||
import { DEFAULT_SETTINGS, SyncSettings } from "./sync-settings";
|
||||
import {
|
||||
RelativePath,
|
||||
DocumentMetadata,
|
||||
DocumentId,
|
||||
DocumentVersionId,
|
||||
} from "./document-metadata";
|
||||
|
||||
interface StoredDatabase {
|
||||
documents: Map<RelativePath, DocumentMetadata>;
|
||||
|
|
@ -69,6 +53,10 @@ export class Database {
|
|||
);
|
||||
}
|
||||
|
||||
public getDocuments(): Map<RelativePath, DocumentMetadata> {
|
||||
return this._documents;
|
||||
}
|
||||
|
||||
public getSettings(): SyncSettings {
|
||||
return this._settings;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue