Skip to content
Merged
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
7 changes: 4 additions & 3 deletions spec/data-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,20 @@ interface CatchallKey {

Each `Pattern` contains a linear sequence of text and placeholders corresponding to potential output of a message.

Each element of the `Pattern` MUST either be a non-empty string or an `Expression` object.
Each element of the `Pattern` MUST either be a non-empty string, an `Expression`, or a `Markup` object.
String values represent literal _text_.
String values include all processing of the underlying _text_ values,
including escape sequence processing.
`Expression` values wrap each of the _expression_ shapes.
`Expression` wraps each of the potential _expression_ shapes.
`Markup` wraps each of the potential _markup_ shapes.

Implementations MUST NOT rely on the set of `Expression` and
`Markup` interfaces defined in this document being exhaustive.
Future versions of this specification might define additional
expressions or markup.

```ts
type Pattern = Array<string | Expression>;
type Pattern = Array<string | Expression | Markup>;

type Expression =
| LiteralExpression
Expand Down
33 changes: 20 additions & 13 deletions spec/data-model/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@
},
"required": ["type", "name"]
},
"option": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": {
"oneOf": [
{ "$ref": "#/$defs/literal" },
{ "$ref": "#/$defs/variable" }
]
}
},
"required": ["name", "value"]
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": {
"oneOf": [
{ "$ref": "#/$defs/literal" },
{ "$ref": "#/$defs/variable" }
]
}
},
"required": ["name", "value"]
}
},

"function-annotation": {
Expand Down Expand Up @@ -146,7 +149,11 @@
"pattern": {
"type": "array",
"items": {
"oneOf": [{ "type": "string" }, { "$ref": "#/$defs/expression" }]
"oneOf": [
{ "type": "string" },
{ "$ref": "#/$defs/expression" },
{ "$ref": "#/$defs/markup" }
]
}
},

Expand Down