Include built Camino datatypes artifacts
This commit is contained in:
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
export type UnknownFieldClock = {
|
||||
kind: "unknown";
|
||||
};
|
||||
export type RevisionFieldClock = {
|
||||
kind: "revision";
|
||||
revision: bigint;
|
||||
};
|
||||
export type FieldClock = UnknownFieldClock | RevisionFieldClock;
|
||||
export type CanonicalFieldValue<T> = {
|
||||
value: T;
|
||||
clock: FieldClock;
|
||||
};
|
||||
export type PendingFieldWrite<T> = {
|
||||
clientMutationId: string;
|
||||
sequence: number;
|
||||
value: T;
|
||||
};
|
||||
export type RegisterFieldState<T> = {
|
||||
canonical: CanonicalFieldValue<T>;
|
||||
visible: T;
|
||||
pending: PendingFieldWrite<T>[];
|
||||
nextPendingSequence: number;
|
||||
};
|
||||
export type FieldApplyResult = {
|
||||
accepted: boolean;
|
||||
canonicalChanged: boolean;
|
||||
pendingChanged: boolean;
|
||||
visibleChanged: boolean;
|
||||
};
|
||||
export declare const unknownFieldClock: () => FieldClock;
|
||||
export declare const revisionFieldClock: (revision: string | number | bigint | undefined | null) => FieldClock;
|
||||
export declare const fieldClockToRevisionString: (clock: FieldClock) => string;
|
||||
export declare const compareFieldClocks: (left: FieldClock, right: FieldClock) => "older" | "same" | "newer" | "unknown";
|
||||
export declare const sameFieldClock: (left: FieldClock, right: FieldClock) => boolean;
|
||||
export declare const createRegisterFieldState: <T>(initial: CanonicalFieldValue<T>) => RegisterFieldState<T>;
|
||||
export declare const applyCanonicalFieldValue: <T>(state: RegisterFieldState<T>, incoming: CanonicalFieldValue<T>, clientMutationId?: string) => FieldApplyResult;
|
||||
export declare const beginLocalFieldWrite: <T>(state: RegisterFieldState<T>, clientMutationId: string, value: T) => FieldApplyResult;
|
||||
export declare const failLocalFieldWrite: <T>(state: RegisterFieldState<T>, clientMutationId: string) => FieldApplyResult;
|
||||
Reference in New Issue
Block a user