Skip to content

Commit 165abef

Browse files
committed
feat: support key for table field content
1 parent d5d7edb commit 165abef

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/types/value/table.ts

+34
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export type TableFieldBody = {
4242
* Represents a row in a table head.
4343
*/
4444
export type TableFieldHeadRow = {
45+
/**
46+
* Unique key of the row (UUID v4 format).
47+
*/
48+
key: string
49+
4550
/**
4651
* Cells in the row.
4752
*/
@@ -52,14 +57,31 @@ export type TableFieldHeadRow = {
5257
* Represents a table header cell.
5358
*/
5459
export type TableFieldHeaderCell = {
60+
/**
61+
* Unique key of the cell (UUID v4 format).
62+
*/
63+
key: string
64+
65+
/**
66+
* The type of the cell.
67+
*/
5568
type: "header"
69+
70+
/**
71+
* The content of the cell.
72+
*/
5673
content: RichTextField
5774
}
5875

5976
/**
6077
* Represents a row in a table body.
6178
*/
6279
export type TableFieldBodyRow = {
80+
/**
81+
* Unique key of the row (UUID v4 format).
82+
*/
83+
key: string
84+
6385
/**
6486
* Cells in the row.
6587
*/
@@ -70,6 +92,18 @@ export type TableFieldBodyRow = {
7092
* Represents a table data cell.
7193
*/
7294
export type TableFieldDataCell = {
95+
/**
96+
* Unique key of the cell (UUID v4 format).
97+
*/
98+
key: string
99+
100+
/**
101+
* The type of the cell.
102+
*/
73103
type: "data"
104+
105+
/**
106+
* The content of the cell.
107+
*/
74108
content: RichTextField
75109
}

test/types/fields-table.types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ expectType<prismic.TableField>({
2525
head: {
2626
rows: [
2727
{
28+
key: "string",
2829
cells: [
2930
{
31+
key: "string",
3032
type: "header",
3133
content: [
3234
{
@@ -49,8 +51,10 @@ expectType<prismic.TableField>({
4951
body: {
5052
rows: [
5153
{
54+
key: "string",
5255
cells: [
5356
{
57+
key: "string",
5458
type: "data",
5559
content: [
5660
{

0 commit comments

Comments
 (0)