@magnetarjs/core
Version:
Magnetar core library.
28 lines (27 loc) • 831 B
TypeScript
import type { DocMetadata, WriteLock } from '@magnetarjs/types';
/**
* await if there's a WriteLock for the document
*/
export declare function writeLockPromise(writeLockMap: Map<string, WriteLock>, docIdentifier: string): Promise<void>;
/**
* await if there's a WriteLock for the document, and return the latest version of the doc after this
*/
export declare function getDocAfterWritelock(params: {
writeLockMap: Map<string, WriteLock>;
lastIncomingDocs: Map<string, {
payload: {
[key: string]: unknown;
} | undefined;
meta: DocMetadata;
}>;
docIdentifier: string;
payload: {
[key: string]: unknown;
} | undefined;
meta: DocMetadata;
}): Promise<undefined | {
payload: {
[key: string]: unknown;
} | undefined;
meta: DocMetadata;
}>;