# CollectionBindToChain

interface

An object returned by the [`bindTo()`](module_utils_collection-Collection.md#function-bindTo) method providing functions that specify the type of the binding.

See the [`bindTo()`](module_utils_collection-Collection.md#function-bindTo) documentation for examples.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/collection.ts#L829)

<a id="type-parameters">

## Type parameters

### `S`

### `T`

<a id="methods">

## Methods

<a id="function-as">

### `as( Class ) → void`

Creates the class factory binding in which items of the source collection are passed to the constructor of the specified class.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/collection.ts#L837)

#### Parameters

* `Class: new ( item: S ) => T`

  The class constructor used to create instances in the factory.

#### Returns

* `void`

<a id="function-using">

### `using( callbackOrProperty ) → void`

Creates a callback or a property binding.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/collection.ts#L845)

#### Parameters

* `callbackOrProperty: keyof S | ( item: S ) => ( T | null )`

  When the function is passed, it should return the collection items. When the string is provided, the property value is used to create the bound collection items.

#### Returns

* `void`

---

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