Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ type BodyBlock =
| Text
| Timeline
| ImagePair
| InNumbers
| Definition
```

`BodyBlock` nodes are the only things that are valid as the top level of a `Body`.
Expand Down Expand Up @@ -825,6 +827,29 @@ interface TimelineEvent extends Parent {
}
```

### InNumbers

```ts
/**
* A definition has a term and a related description. It is used to describe a term.
*/
interface Definition extends Node {
type: "definition"
term: string
description: string
}

/**
* InNumbers represents a set of numbers with related descriptions.
*/
interface InNumbers extends Parent {
type: "in-numbers"
/** The title for the InNumbers */
title?: string
children: [Definition, Definition, Definition]
}
```

## License

This software is published by the Financial Times under the [MIT licence](mit).
Expand Down
76 changes: 72 additions & 4 deletions content-tree.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export declare namespace ContentTree {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair | InNumbers | Definition;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -308,8 +308,25 @@ export declare namespace ContentTree {
/** Any combination of paragraphs and image sets */
children: (Paragraph | ImageSet)[];
}
/**
* A definition has a term and a related description. It is used to describe a term.
*/
interface Definition extends Node {
type: "definition";
term: string;
description: string;
}
/**
* InNumbers represents a set of numbers with related descriptions.
*/
interface InNumbers extends Parent {
type: "in-numbers";
/** The title for the InNumbers */
title?: string;
children: [Definition, Definition, Definition];
}
namespace full {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair | InNumbers | Definition;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -618,9 +635,26 @@ export declare namespace ContentTree {
/** Any combination of paragraphs and image sets */
children: (Paragraph | ImageSet)[];
}
/**
* A definition has a term and a related description. It is used to describe a term.
*/
interface Definition extends Node {
type: "definition";
term: string;
description: string;
}
/**
* InNumbers represents a set of numbers with related descriptions.
*/
interface InNumbers extends Parent {
type: "in-numbers";
/** The title for the InNumbers */
title?: string;
children: [Definition, Definition, Definition];
}
}
namespace transit {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair | InNumbers | Definition;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -914,9 +948,26 @@ export declare namespace ContentTree {
/** Any combination of paragraphs and image sets */
children: (Paragraph | ImageSet)[];
}
/**
* A definition has a term and a related description. It is used to describe a term.
*/
interface Definition extends Node {
type: "definition";
term: string;
description: string;
}
/**
* InNumbers represents a set of numbers with related descriptions.
*/
interface InNumbers extends Parent {
type: "in-numbers";
/** The title for the InNumbers */
title?: string;
children: [Definition, Definition, Definition];
}
}
namespace loose {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | Timeline | ImagePair | InNumbers | Definition;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -1225,5 +1276,22 @@ export declare namespace ContentTree {
/** Any combination of paragraphs and image sets */
children: (Paragraph | ImageSet)[];
}
/**
* A definition has a term and a related description. It is used to describe a term.
*/
interface Definition extends Node {
type: "definition";
term: string;
description: string;
}
/**
* InNumbers represents a set of numbers with related descriptions.
*/
interface InNumbers extends Parent {
type: "in-numbers";
/** The title for the InNumbers */
title?: string;
children: [Definition, Definition, Definition];
}
}
}
65 changes: 65 additions & 0 deletions schemas/body-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
},
{
"$ref": "#/definitions/ContentTree.transit.ImagePair"
},
{
"$ref": "#/definitions/ContentTree.transit.InNumbers"
},
{
"$ref": "#/definitions/ContentTree.transit.Definition"
}
]
},
Expand Down Expand Up @@ -173,6 +179,29 @@
],
"type": "object"
},
"ContentTree.transit.Definition": {
"additionalProperties": false,
"description": "A definition has a term and a related description. It is used to describe a term.",
"properties": {
"data": {},
"description": {
"type": "string"
},
"term": {
"type": "string"
},
"type": {
"const": "definition",
"type": "string"
}
},
"required": [
"description",
"term",
"type"
],
"type": "object"
},
"ContentTree.transit.Emphasis": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -318,6 +347,42 @@
],
"type": "object"
},
"ContentTree.transit.InNumbers": {
"additionalProperties": false,
"description": "InNumbers represents a set of numbers with related descriptions.",
"properties": {
"children": {
"items": [
{
"$ref": "#/definitions/ContentTree.transit.Definition"
},
{
"$ref": "#/definitions/ContentTree.transit.Definition"
},
{
"$ref": "#/definitions/ContentTree.transit.Definition"
}
],
"maxItems": 3,
"minItems": 3,
"type": "array"
},
"data": {},
"title": {
"description": "The title for the InNumbers",
"type": "string"
},
"type": {
"const": "in-numbers",
"type": "string"
}
},
"required": [
"children",
"type"
],
"type": "object"
},
"ContentTree.transit.Layout": {
"additionalProperties": false,
"properties": {
Expand Down
65 changes: 65 additions & 0 deletions schemas/content-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@
},
{
"$ref": "#/definitions/ContentTree.full.ImagePair"
},
{
"$ref": "#/definitions/ContentTree.full.InNumbers"
},
{
"$ref": "#/definitions/ContentTree.full.Definition"
}
]
},
Expand Down Expand Up @@ -224,6 +230,29 @@
],
"type": "object"
},
"ContentTree.full.Definition": {
"additionalProperties": false,
"description": "A definition has a term and a related description. It is used to describe a term.",
"properties": {
"data": {},
"description": {
"type": "string"
},
"term": {
"type": "string"
},
"type": {
"const": "definition",
"type": "string"
}
},
"required": [
"description",
"term",
"type"
],
"type": "object"
},
"ContentTree.full.Emphasis": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -587,6 +616,42 @@
],
"type": "object"
},
"ContentTree.full.InNumbers": {
"additionalProperties": false,
"description": "InNumbers represents a set of numbers with related descriptions.",
"properties": {
"children": {
"items": [
{
"$ref": "#/definitions/ContentTree.full.Definition"
},
{
"$ref": "#/definitions/ContentTree.full.Definition"
},
{
"$ref": "#/definitions/ContentTree.full.Definition"
}
],
"maxItems": 3,
"minItems": 3,
"type": "array"
},
"data": {},
"title": {
"description": "The title for the InNumbers",
"type": "string"
},
"type": {
"const": "in-numbers",
"type": "string"
}
},
"required": [
"children",
"type"
],
"type": "object"
},
"ContentTree.full.Layout": {
"additionalProperties": false,
"properties": {
Expand Down
Loading
Loading