ReferenceAnnotationPresetCallback
Type Alias AnnotationPresetCallback
Type Alias
Type Signature
type AnnotationPresetCallback = (
currentAnnotationPresets: Record<string, AnnotationPreset>,
) => Record<string, AnnotationPreset>
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
Record<string, AnnotationPreset>
The new annotation presets
This callback can be used in the setAnnotationPresets() method to do atomic updates to the current annotation presets.