> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# AccessList

> Class exported by @botmesh/core.

Defined in: [gates/accessList.ts:115](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L115)

A set of opaque ids with change notifications. Used as `bot.blacklist`; the
[Whitelist](https://botmesh.afaya.com.co/api/core/classes/Whitelist.md) subclass adds the enable/disable switch.

## Extended by

* [`Whitelist`](https://botmesh.afaya.com.co/api/core/classes/Whitelist)

## Constructors

### Constructor

```ts theme={null}
new AccessList(name): AccessList;
```

Defined in: [gates/accessList.ts:119](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L119)

#### Parameters

| Parameter | Type |
| - | - |
| `name` | [`AccessListName`](https://botmesh.afaya.com.co/api/core/type-aliases/AccessListName) |

#### Returns

`AccessList`

## Properties

### name

```ts theme={null}
readonly name: AccessListName;
```

Defined in: [gates/accessList.ts:119](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L119)

## Methods

### add()

```ts theme={null}
add(ids): this;
```

Defined in: [gates/accessList.ts:122](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L122)

Add one id or many. Duplicates are ignored. Throws `TypeError` on an empty/non-string id.

#### Parameters

| Parameter | Type |
| - | - |
| `ids` | `string` \| readonly `string`\[] |

#### Returns

`this`

***

### remove()

```ts theme={null}
remove(ids): this;
```

Defined in: [gates/accessList.ts:134](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L134)

Remove one id or many. Unknown ids are ignored. Throws `TypeError` on an empty/non-string id.

#### Parameters

| Parameter | Type |
| - | - |
| `ids` | `string` \| readonly `string`\[] |

#### Returns

`this`

***

### has()

```ts theme={null}
has(id): boolean;
```

Defined in: [gates/accessList.ts:144](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L144)

Is `id` on the list? Exact, case-sensitive match. Never throws.

#### Parameters

| Parameter | Type |
| - | - |
| `id` | `string` |

#### Returns

`boolean`

***

### list()

```ts theme={null}
list(): string[];
```

Defined in: [gates/accessList.ts:149](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L149)

The ids on the list, in insertion order (a copy).

#### Returns

`string`\[]

***

### clear()

```ts theme={null}
clear(): this;
```

Defined in: [gates/accessList.ts:159](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L159)

Remove every id.

#### Returns

`this`

***

### load()

```ts theme={null}
load(snapshot): this;
```

Defined in: [gates/accessList.ts:171](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L171)

Replace the contents with a snapshot from [export](#export) (or a bare id array).
Always notifies `onChange` listeners with action `'load'`.

#### Parameters

| Parameter | Type |
| - | - |
| `snapshot` | \| readonly `string`\[] \| [`AccessListSnapshot`](https://botmesh.afaya.com.co/api/core/interfaces/AccessListSnapshot) |

#### Returns

`this`

***

### export()

```ts theme={null}
export(): AccessListSnapshot;
```

Defined in: [gates/accessList.ts:180](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L180)

JSON-serializable snapshot for host-side persistence.

#### Returns

[`AccessListSnapshot`](https://botmesh.afaya.com.co/api/core/interfaces/AccessListSnapshot)

***

### onChange()

```ts theme={null}
onChange(listener): () => void;
```

Defined in: [gates/accessList.ts:188](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L188)

Subscribe to effective mutations (no-op calls do not notify). Returns an
unsubscriber. A throwing listener never breaks the mutation that triggered it.

#### Parameters

| Parameter | Type |
| - | - |
| `listener` | (`change`) => `void` |

#### Returns

() => `void`

## Accessors

### size

#### Get Signature

```ts theme={null}
get size(): number;
```

Defined in: [gates/accessList.ts:154](https://github.com/andresayac/botmesh/blob/main/packages/core/src/gates/accessList.ts#L154)

Number of ids on the list.

##### Returns

`number`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.