# page.corvus.block

> Published by [corvus.page](https://lexicon.garden/identity/did:plc:3qc4cbzcriye72qqqodeda26)

✓ This is the authoritative definition for this NSID.

## Description

A block

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.block)
- [Documentation](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.block/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:3qc4cbzcriye72qqqodeda26/page.corvus.block/examples)

## Definitions

### `page.corvus.block#add`

**Type**: `object`

Add a value to an OR-Set on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `set` | `string` | Yes | The name of the set to add to |
| `after` | `string` | No | The operation id that removed this value from the set previously |
| `value` | `unknown` | Yes | The value to add to the set |

### `page.corvus.block#set`

**Type**: `object`

Set a value on an LWW register on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `after` | `string` | No | The operation id that last wrote to this register |
| `value` | `unknown` | Yes | The value to set on the register |
| `register` | `string` | Yes | The name of the register to set |

### `page.corvus.block`

**Type**: `record`

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ops` | `array` | Yes | The edits that have been applied to this block |
| `inline` | `unknown` | No | Map of inline blocks, keyed by inline-tid. Each value is a `page.corvus.block#main` record body (the inline block's `ops`/`createdAt`/`inline`). Block-ids address inline blocks as `<this-record-uri>#inline/<inline-tid>`, with deeper nesting appended as `/inline/<inline-tid>` per level. Modeled as `unknown` because lexicons don't yet support map types; the runtime shape is `{ [inlineTid: string]: page.corvus.block#main }`. |
| `blockId` | `string` (at-uri) | No | The URI of the block record that created this block, omitted if this is the record that created the block |
| `createdAt` | `string` (datetime) | Yes | The ISO 8601 datetime the block was created |
| `collaborators` | `array` | No | A list of dids that are collaborators on the block |

### `page.corvus.block#create`

**Type**: `object`

create a new block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `data` | `unknown` | No | The data to create the block with |
| `blockType` | `string` (nsid) | Yes | The type of the block |

### `page.corvus.block#delete`

**Type**: `object`

Delete from an RGA sequence on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `seq` | `string` | Yes | The name of the sequence to delete from |
| `after` | `string` | Yes | The operation id of the atom to delete after |
| `count` | `integer` | Yes | The number of atoms to delete |
| `afterAtom` | `integer` | Yes | The index of the atom to delete after |

### `page.corvus.block#insert`

**Type**: `object`

Insert into an RGA sequence on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `seq` | `string` | Yes | The name of the sequence to insert into |
| `after` | `string` | No | The operation id of the atom to insert after |
| `value` | `unknown` | Yes | The value to insert into the sequence, either a string for text sequences or an array for list sequences |
| `afterAtom` | `integer` | No | The index of the atom to insert after |

### `page.corvus.block#remove`

**Type**: `object`

Remove a value from an OR-Set on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `set` | `string` | Yes | The name of the set to remove from |
| `after` | `string` | Yes | The operation id that added this value to the set previously |

### `page.corvus.block#increment`

**Type**: `object`

Increment a counter on this block

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | The operation id |
| `delta` | `integer` | Yes | The amount to increment the counter by |
| `counter` | `string` | Yes | The name of the counter to increment |

## Raw Schema

```json
{
  "id": "page.corvus.block",
  "defs": {
    "add": {
      "type": "object",
      "required": [
        "id",
        "set",
        "value"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "set": {
          "type": "string",
          "description": "The name of the set to add to"
        },
        "after": {
          "type": "string",
          "description": "The operation id that removed this value from the set previously"
        },
        "value": {
          "type": "unknown",
          "description": "The value to add to the set"
        }
      },
      "description": "Add a value to an OR-Set on this block"
    },
    "set": {
      "type": "object",
      "required": [
        "id",
        "register",
        "value"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "after": {
          "type": "string",
          "description": "The operation id that last wrote to this register"
        },
        "value": {
          "type": "unknown",
          "description": "The value to set on the register"
        },
        "register": {
          "type": "string",
          "description": "The name of the register to set"
        }
      },
      "description": "Set a value on an LWW register on this block"
    },
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "ops",
          "createdAt"
        ],
        "properties": {
          "ops": {
            "type": "array",
            "items": {
              "refs": [
                "#create",
                "#insert",
                "#delete",
                "#set",
                "#increment",
                "#add",
                "#remove"
              ],
              "type": "union",
              "closed": true
            },
            "description": "The edits that have been applied to this block"
          },
          "inline": {
            "type": "unknown",
            "description": "Map of inline blocks, keyed by inline-tid. Each value is a `page.corvus.block#main` record body (the inline block's `ops`/`createdAt`/`inline`). Block-ids address inline blocks as `<this-record-uri>#inline/<inline-tid>`, with deeper nesting appended as `/inline/<inline-tid>` per level. Modeled as `unknown` because lexicons don't yet support map types; the runtime shape is `{ [inlineTid: string]: page.corvus.block#main }`."
          },
          "blockId": {
            "type": "string",
            "format": "at-uri",
            "description": "The URI of the block record that created this block, omitted if this is the record that created the block"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "The ISO 8601 datetime the block was created"
          },
          "collaborators": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "description": "A list of dids that are collaborators on the block"
          }
        },
        "description": "A block record containing the edits that have been applied to this block by the owning user."
      }
    },
    "create": {
      "type": "object",
      "required": [
        "blockType"
      ],
      "properties": {
        "data": {
          "type": "unknown",
          "description": "The data to create the block with"
        },
        "blockType": {
          "type": "string",
          "format": "nsid",
          "description": "The type of the block",
          "knownValues": [
            "page.corvus.document",
            "page.corvus.document#prose",
            "page.corvus.database"
          ]
        }
      },
      "description": "create a new block"
    },
    "delete": {
      "type": "object",
      "required": [
        "id",
        "seq",
        "count",
        "after",
        "afterAtom"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "seq": {
          "type": "string",
          "description": "The name of the sequence to delete from"
        },
        "after": {
          "type": "string",
          "description": "The operation id of the atom to delete after"
        },
        "count": {
          "type": "integer",
          "description": "The number of atoms to delete"
        },
        "afterAtom": {
          "type": "integer",
          "description": "The index of the atom to delete after"
        }
      },
      "description": "Delete from an RGA sequence on this block"
    },
    "insert": {
      "type": "object",
      "required": [
        "id",
        "seq",
        "value"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "seq": {
          "type": "string",
          "description": "The name of the sequence to insert into"
        },
        "after": {
          "type": "string",
          "description": "The operation id of the atom to insert after"
        },
        "value": {
          "type": "unknown",
          "description": "The value to insert into the sequence, either a string for text sequences or an array for list sequences"
        },
        "afterAtom": {
          "type": "integer",
          "description": "The index of the atom to insert after"
        }
      },
      "description": "Insert into an RGA sequence on this block"
    },
    "remove": {
      "type": "object",
      "required": [
        "id",
        "set",
        "after"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "set": {
          "type": "string",
          "description": "The name of the set to remove from"
        },
        "after": {
          "type": "string",
          "description": "The operation id that added this value to the set previously"
        }
      },
      "description": "Remove a value from an OR-Set on this block"
    },
    "increment": {
      "type": "object",
      "required": [
        "id",
        "counter",
        "delta"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The operation id"
        },
        "delta": {
          "type": "integer",
          "description": "The amount to increment the counter by"
        },
        "counter": {
          "type": "string",
          "description": "The name of the counter to increment"
        }
      },
      "description": "Increment a counter on this block"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "A block"
}
```
