Markdown Editor Kit

CheckpointPolicy

Variable: CheckpointPolicy

const CheckpointPolicy: {
  always: () => MdKitCheckpointPolicy;
  function: (shouldCheckpoint: (input: MdKitCheckpointPolicyInput) => boolean | Promise<boolean>) => MdKitCheckpointPolicy;
  never: () => MdKitCheckpointPolicy;
  smart: (options: MdKitSmartCheckpointPolicyOptions) => MdKitCheckpointPolicy;
};

Defined in: packages/mdkit/src/core/checkpointPolicy.ts:76

Factories for the policy that decides when a saved document becomes a checkpoint. Pass the result to createMdKitBackend, not to your store.

Type Declaration

Remarks

smart() applies the default autosave-friendly heuristic; function() receives mdkit's computed edit distance alongside the raw content so you can build a custom rule.

On this page