<!-- Public documentation export; not library implementation source. -->
# ISelectionApi

[Integration guide](https://docs.lumencharts.com/charting-library/drawings#selection-groups-and-ordering) · [Reference index](https://docs.lumencharts.com/charting-library/api/)

Public contract reference. This declaration describes types and callback shapes; availability is constrained by the linked integration guide and the runtime capability. Legacy product-specific fields are not a promise of implementation.

## add {#add}

```ts
add(entities: EntityId[] | EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `entities` | `EntityId[] &#124; EntityId` | Yes |

## set {#set}

```ts
set(entities: EntityId[] | EntityId): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `entities` | `EntityId[] &#124; EntityId` | Yes |

## remove {#remove}

```ts
remove(entities: EntityId[]): void;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `entities` | `EntityId[]` | Yes |

## contains {#contains}

```ts
contains(entity: EntityId): boolean;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `entity` | `EntityId` | Yes |

## allSources {#allsources}

```ts
allSources(): EntityId[];
```

Use the type signature above and the integration guide for the owning capability.

## isEmpty {#isempty}

```ts
isEmpty(): boolean;
```

Use the type signature above and the integration guide for the owning capability.

## clear {#clear}

```ts
clear(): void;
```

Use the type signature above and the integration guide for the owning capability.

## onChanged {#onchanged}

```ts
onChanged(): ISubscription<() => void>;
```

Use the type signature above and the integration guide for the owning capability.

## canBeAddedToSelection {#canbeaddedtoselection}

```ts
canBeAddedToSelection(entity: EntityId): boolean;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `entity` | `EntityId` | Yes |

## Related types

- [EntityId](https://docs.lumencharts.com/charting-library/api/EntityId)
- [ISubscription](https://docs.lumencharts.com/charting-library/api/ISubscription)

---
Documentation page: https://docs.lumencharts.com/charting-library/api/ISelectionApi
