Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
import z from "zod";
/**
* Zod schema for `UndoStackOptions`.
*/
export const UndoStackOptionsSchema = z
.object({
maxEntries: z.number().int().positive().optional(),
maxMemoryBytes: z.number().int().positive().optional(),
onTruncate: z.function().optional(),
clock: z.function().optional(),
idGenerator: z.function().optional(),
})
.strict();
export type UndoStackOptionsInput = z.input<typeof UndoStackOptionsSchema>;
/**
* Zod schema for `BranchingOptions`.
*/
export const BranchingOptionsSchema = z
.object({
initialBranchLabel: z.string().min(1).optional(),
branchOnDiverge: z.boolean().optional(),
maxEntries: z.number().int().positive().optional(),
clock: z.function().optional(),
idGenerator: z.function().optional(),
})
.strict();
export type BranchingOptionsInput = z.input<typeof BranchingOptionsSchema>;
/**
* Zod schema for `HistoryCompressorOptions`.
*/
export const HistoryCompressorOptionsSchema = z
.object({
compressionDepth: z.number().int().min(0).optional(),
maxHistorySize: z.number().int().positive().optional(),
})
.strict();
export type HistoryCompressorOptionsInput = z.input<
typeof HistoryCompressorOptionsSchema
>;
/**
* Zod schema for `CommandMergerOptions`.
*/
export const CommandMergerOptionsSchema = z
.object({
maxCount: z.number().int().positive().optional(),
timeWindowMs: z.number().positive().optional(),
clock: z.function().optional(),
})
.strict();
export type CommandMergerOptionsInput = z.input<
typeof CommandMergerOptionsSchema
>;
/**
* Zod schema for `SelectiveUndoOptions`.
*/
export const SelectiveUndoOptionsSchema = UndoStackOptionsSchema.extend({
throwOnConflict: z.boolean().optional(),
dependencyCheck: z.function().optional(),
});
export type SelectiveUndoOptionsInput = z.input<
typeof SelectiveUndoOptionsSchema
>;