# Interface: AccessHistory

Defined in: [packages/core/src/space/roles.ts:314](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L314)

## Properties

| Property | Modifier | Type | Description | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| <a id="property-current"></a> `current` | `readonly` | [`AccessState`](https://minca.dev/api/core/interfaces/AccessState.md) | Who holds what once everything held is replayed | [packages/core/src/space/roles.ts:316](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L316) |

## Methods

### at()

```ts
at(seen, within?): AccessState | null;
```

Defined in: [packages/core/src/space/roles.ts:327](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L327)

The state as of what `seen` names and saw, counting the changes valid in the whole history, or
with `within` valid among what both name. Null until all of it is here.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `seen` | readonly `string`[] |
| `within?` | readonly `string`[] |

#### Returns

[`AccessState`](https://minca.dev/api/core/interfaces/AccessState.md) \| `null`

***

### extend()

```ts
extend(event): AccessHistory | null;
```

Defined in: [packages/core/src/space/roles.ts:359](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L359)

The history with one more change, exactly as replaying all gives; null when only a whole replay can say

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `event` | [`AccessEvent`](https://minca.dev/api/core/type-aliases/AccessEvent.md) |

#### Returns

`AccessHistory` \| `null`

***

### forked()

```ts
forked(writer, collection): 
  | {
  event: string;
  from: number;
}
  | null;
```

Defined in: [packages/core/src/space/roles.ts:351](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L351)

Where a key's line for a collection forked, as the lowest place any applied change proves

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `writer` | `string` |
| `collection` | `string` |

#### Returns

  \| \{
  `event`: `string`;
  `from`: `number`;
\}
  \| `null`

***

### forks()

```ts
forks(): readonly ForkedLine[];
```

Defined in: [packages/core/src/space/roles.ts:353](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L353)

Every key whose line for a collection forked, and from where

#### Returns

readonly `ForkedLine`[]

***

### heads()

```ts
heads(): readonly string[];
```

Defined in: [packages/core/src/space/roles.ts:320](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L320)

The latest applied changes, which a new record's `seen` names: no revokes or fork proofs

#### Returns

readonly `string`[]

***

### headsFor()

```ts
headsFor(keys, max): readonly string[];
```

Defined in: [packages/core/src/space/roles.ts:322](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L322)

At most `max` heads: first ones that saw the latest change to each of `keys`, then the most recent

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `keys` | readonly `string`[] |
| `max` | `number` |

#### Returns

readonly `string`[]

***

### judge()

```ts
judge(
   record, 
   needs, 
   within?
): RecordVerdict;
```

Defined in: [packages/core/src/space/roles.ts:335](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L335)

Whether a record stands: its key not revoked or forked past what covers it, `needs` met as of
what it saw and as of the changes that stand, and no unseen removal of its account taking it.
With `within`, for a version another cites, only changes the citer saw can take it away.

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `record` | \{ `collection?`: `string`; `id`: `string`; `line?`: `number`; `root`: `string`; `seen`: readonly `string`[]; `writer?`: `string`; \} | - |
| `record.collection?` | `string` | - |
| `record.id` | `string` | - |
| `record.line?` | `number` | - |
| `record.root` | `string` | - |
| `record.seen` | readonly `string`[] | - |
| `record.writer?` | `string` | The key that signed it, its collection, and its place in that key's line there |
| `needs` | [`Needs`](https://minca.dev/api/core/type-aliases/Needs.md) | - |
| `within?` | readonly `string`[] | - |

#### Returns

[`RecordVerdict`](https://minca.dev/api/core/type-aliases/RecordVerdict.md)

***

### knownInvite()

```ts
knownInvite(inviteKey): boolean;
```

Defined in: [packages/core/src/space/roles.ts:357](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L357)

Whether any change held opens an invite with this key

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `inviteKey` | `string` |

#### Returns

`boolean`

***

### named()

```ts
named(did): boolean;
```

Defined in: [packages/core/src/space/roles.ts:355](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L355)

Whether any founder, constitution or assignment names an account: it only grows

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `did` | `string` |

#### Returns

`boolean`

***

### revoked()

```ts
revoked(key, root): readonly string[];
```

Defined in: [packages/core/src/space/roles.ts:349](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L349)

The applied changes by an account that revoked one of its keys

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |
| `root` | `string` |

#### Returns

readonly `string`[]

***

### seenAs()

```ts
seenAs(seen): AccessState | null;
```

Defined in: [packages/core/src/space/roles.ts:329](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L329)

The state as its writer saw it: what `seen` names and saw, judged among themselves alone

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `seen` | readonly `string`[] |

#### Returns

[`AccessState`](https://minca.dev/api/core/interfaces/AccessState.md) \| `null`

***

### status()

```ts
status(id): EventStatus | null;
```

Defined in: [packages/core/src/space/roles.ts:318](https://github.com/leifriksheim/minca/blob/main/core/src/space/roles.ts#L318)

What became of one change

#### Parameters

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

#### Returns

[`EventStatus`](https://minca.dev/api/core/type-aliases/EventStatus.md) \| `null`
