Remove clutter
This commit is contained in:
parent
419c29aa9d
commit
9445bbd21f
4 changed files with 3 additions and 54 deletions
|
|
@ -19,16 +19,6 @@ export class AuthenticationError extends Error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FileNotFoundError extends Error {
|
|
||||||
public constructor(
|
|
||||||
message: string,
|
|
||||||
public readonly filePath: string
|
|
||||||
) {
|
|
||||||
super(message);
|
|
||||||
this.name = "FileNotFoundError";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PermanentSyncError extends Error {}
|
export class PermanentSyncError extends Error {}
|
||||||
|
|
||||||
export class LocalChangesDuringReconciliation extends Error {}
|
export class LocalChangesDuringReconciliation extends Error {}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import type { RelativePath } from "../persistence/database";
|
|
||||||
import { EventListeners } from "../utils/data-structures/event-listeners";
|
|
||||||
|
|
||||||
export class FileChangeNotifier {
|
|
||||||
public readonly onFileChanged = new EventListeners<
|
|
||||||
(filePath: RelativePath) => unknown
|
|
||||||
>();
|
|
||||||
|
|
||||||
public notifyOfFileChange(filePath: RelativePath): void {
|
|
||||||
this.onFileChanged.trigger(filePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
export enum VaultHistoryStatus {
|
|
||||||
MISSING = "missing",
|
|
||||||
STORED = "stored"
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
type ResolveFunction<T> = undefined extends T
|
|
||||||
? (value?: T) => unknown
|
|
||||||
: (value: T) => unknown;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A type-safe utility function to create a Promise with resolve and reject functions.
|
|
||||||
* @returns A tuple containing a Promise, a resolve function, and a reject function.
|
|
||||||
*/
|
|
||||||
export function createPromise<T = unknown>(): [
|
|
||||||
Promise<T>,
|
|
||||||
ResolveFunction<T>,
|
|
||||||
(error: unknown) => unknown
|
|
||||||
] {
|
|
||||||
let resolve: undefined | ResolveFunction<T> = undefined;
|
|
||||||
let reject: undefined | ((error: unknown) => unknown) = undefined;
|
|
||||||
|
|
||||||
const creationPromise = new Promise<T>(
|
|
||||||
(resolve_, reject_) =>
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
||||||
((resolve = resolve_ as ResolveFunction<T>), (reject = reject_))
|
|
||||||
);
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
return [creationPromise, resolve!, reject!];
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue