# comments/annotations/annotationcollection

module

<a id="classes">

## Classes

<a id="class-AnnotationCollection">

### [AnnotationCollection](module_comments_annotations_annotationcollection-AnnotationCollection.md)

<a id="type-definitions">

## Type Definitions

<a id="typedef-AnnotationBlurEvent">

### `AnnotationBlurEvent`

<a id="typedef-AnnotationFocusEvent">

### `AnnotationFocusEvent`

<a id="functions">

## Functions

<a id="function-bindAnnotationCollections">

### `bindAnnotationCollections( options = { options.filter, options.source, options.target } ) → void`

A helper function that binds two [AnnotationCollection](module_comments_annotations_annotationcollection-AnnotationCollection.md)s and allows filtering items based on the passed callback.

Since [`refreshPositioning`](module_comments_annotations_annotationcollection-AnnotationCollection.md#function-refreshPositioning) sorts the annotations by removing and inserting items, the binding implemented by the `bindTo()` method is lost. This is why this helper needs to be used.

This helper is used by the annotations UIs to filter which annotations from the [main annotation collection](module_comments_annotations_annotations-Annotations.md#member-collection) should be handled by a given annotations UI.

#### Parameters

* `options: object`

  An object with configuration options.

  Properties

  * `options.filter: ( annotation: Annotation ) => boolean`

    Filtering function that gets an annotation and should return `true` if the annotation should be copied to the `target` collection.

  * `options.source: AnnotationCollection`

    The source collection from which the annotations will be taken.

  * `options.target: AnnotationCollection`

    The target collection that will be synced to the source collection.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
