Nutrient Web SDK

ReferenceAnnotationPresetCallback

Type Alias AnnotationPresetCallback

This callback can be used in the setAnnotationPresets() method to do atomic updates to the current annotation presets.

Type Alias
Type Signature
type AnnotationPresetCallback = (
    currentAnnotationPresets: Record<string, AnnotationPreset>,
) => Record<string, AnnotationPreset>

Example

Use ES2015 arrow functions and the update callback to reduce boilerplate

instance.setAnnotationPresets(presets => {
presets.custom = {
strokeWidth: 10,
};
return presets;
});

Type Declaration

Parameters

currentAnnotationPresetsRecord<string, AnnotationPreset>

The current annotation presets

Returns

The new annotation presets