-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add featured snippet DA interfaces for the builtin fieldType (#207)
- add `MultiLineTextFeaturedSnippetDirectAnswer` and `RichTextFeaturedSnippetDirectAnswer` for the two types that fieldType of featured snippet direct answer can be. - `multi_line_text` for feature snippet DA have non optional `value` field of type string - `rich_text` for feature snippet DA does not have `value` field so that is omitted in the interface - the old `FeaturedSnippetDirectAnswer` is now the base interface `BaseFeaturedSnippetDirectAnswer` that the specific interfaces extend from. The new `FeaturedSnippetDirectAnswer` is the union type. J=SLAP-2330 TEST=auto&manual oshi confirmed the structure of multi_line_text and rich_text through examples listed in the [comments under this item](https://yexttest.atlassian.net/browse/SLAP-2317) where rich_text does NOT provide `value` field and `multi_line_text` does. tested locally that: - 'value' field is not present in IDE for the switch case 'richtext' <img width="300" alt="Screen Shot 2022-08-15 at 1 19 51 PM" src="https://user-images.githubusercontent.com/36055303/184686077-a6ac524a-43f6-427f-a777-c0d044f542b3.png"> - 'value' field is present, of type string, and NOT optional in IDE for the switch case 'multi_line_text' <img width="300" alt="Screen Shot 2022-08-15 at 1 21 57 PM" src="https://user-images.githubusercontent.com/36055303/184686123-2bf731ca-755d-4d17-9b73-4c33f6091787.png">
- Loading branch information
Showing
23 changed files
with
215 additions
and
59 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
docs/search-core.basefeaturedsnippetdirectanswer.fieldtype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) > [fieldType](./search-core.basefeaturedsnippetdirectanswer.fieldtype.md) | ||
|
||
## BaseFeaturedSnippetDirectAnswer.fieldType property | ||
|
||
The field type of the direct answer. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
fieldType: EnumOrLiteral<BuiltInFieldType.MultiLineText | BuiltInFieldType.RichText>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) | ||
|
||
## BaseFeaturedSnippetDirectAnswer interface | ||
|
||
A direct answer which was found within a document. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface BaseFeaturedSnippetDirectAnswer<T = unknown> extends DirectAnswer<T> | ||
``` | ||
<b>Extends:</b> [DirectAnswer](./search-core.directanswer.md)<!-- --><T> | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [fieldType](./search-core.basefeaturedsnippetdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- --><[BuiltInFieldType.MultiLineText](./search-core.builtinfieldtype.md) \| [BuiltInFieldType.RichText](./search-core.builtinfieldtype.md)<!-- -->> | The field type of the direct answer. | | ||
| [snippet](./search-core.basefeaturedsnippetdirectanswer.snippet.md) | [Snippet](./search-core.snippet.md) | The snippet where the direct answer was found. | | ||
| [type](./search-core.basefeaturedsnippetdirectanswer.type.md) | [DirectAnswerType.FeaturedSnippet](./search-core.directanswertype.md) | Indicates that the DirectAnswer is a [FeaturedSnippetDirectAnswer](./search-core.featuredsnippetdirectanswer.md)<!-- -->. | | ||
4 changes: 2 additions & 2 deletions
4
...re.featuredsnippetdirectanswer.snippet.md → ...asefeaturedsnippetdirectanswer.snippet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) > [type](./search-core.basefeaturedsnippetdirectanswer.type.md) | ||
|
||
## BaseFeaturedSnippetDirectAnswer.type property | ||
|
||
Indicates that the DirectAnswer is a [FeaturedSnippetDirectAnswer](./search-core.featuredsnippetdirectanswer.md)<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
type: DirectAnswerType.FeaturedSnippet; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/search-core.multilinetextfeaturedsnippetdirectanswer.fieldtype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [MultiLineTextFeaturedSnippetDirectAnswer](./search-core.multilinetextfeaturedsnippetdirectanswer.md) > [fieldType](./search-core.multilinetextfeaturedsnippetdirectanswer.fieldtype.md) | ||
|
||
## MultiLineTextFeaturedSnippetDirectAnswer.fieldType property | ||
|
||
The field type of the direct answer. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
fieldType: EnumOrLiteral<BuiltInFieldType.MultiLineText>; | ||
``` |
22 changes: 22 additions & 0 deletions
22
docs/search-core.multilinetextfeaturedsnippetdirectanswer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [MultiLineTextFeaturedSnippetDirectAnswer](./search-core.multilinetextfeaturedsnippetdirectanswer.md) | ||
|
||
## MultiLineTextFeaturedSnippetDirectAnswer interface | ||
|
||
A [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) with 'multi\_line\_text' field type. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface MultiLineTextFeaturedSnippetDirectAnswer extends BaseFeaturedSnippetDirectAnswer<string> | ||
``` | ||
<b>Extends:</b> [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md)<!-- --><string> | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [fieldType](./search-core.multilinetextfeaturedsnippetdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- --><[BuiltInFieldType.MultiLineText](./search-core.builtinfieldtype.md)<!-- -->> | The field type of the direct answer. | | ||
| [value](./search-core.multilinetextfeaturedsnippetdirectanswer.value.md) | string | The value of the direct answer. | | ||
13 changes: 13 additions & 0 deletions
13
docs/search-core.multilinetextfeaturedsnippetdirectanswer.value.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [MultiLineTextFeaturedSnippetDirectAnswer](./search-core.multilinetextfeaturedsnippetdirectanswer.md) > [value](./search-core.multilinetextfeaturedsnippetdirectanswer.value.md) | ||
|
||
## MultiLineTextFeaturedSnippetDirectAnswer.value property | ||
|
||
The value of the direct answer. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
value: string; | ||
``` |
13 changes: 13 additions & 0 deletions
13
docs/search-core.richtextfeaturedsnippetdirectanswer.fieldtype.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [RichTextFeaturedSnippetDirectAnswer](./search-core.richtextfeaturedsnippetdirectanswer.md) > [fieldType](./search-core.richtextfeaturedsnippetdirectanswer.fieldtype.md) | ||
|
||
## RichTextFeaturedSnippetDirectAnswer.fieldType property | ||
|
||
The field type of the direct answer. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
fieldType: EnumOrLiteral<BuiltInFieldType.RichText>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [RichTextFeaturedSnippetDirectAnswer](./search-core.richtextfeaturedsnippetdirectanswer.md) | ||
|
||
## RichTextFeaturedSnippetDirectAnswer interface | ||
|
||
A [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) with 'rich\_text' field type. "value" field is omitted for featured snippet direct answer of this field type. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface RichTextFeaturedSnippetDirectAnswer extends Omit<BaseFeaturedSnippetDirectAnswer<string>, 'value'> | ||
``` | ||
<b>Extends:</b> Omit<[BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md)<!-- --><string>, 'value'> | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [fieldType](./search-core.richtextfeaturedsnippetdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- --><[BuiltInFieldType.RichText](./search-core.builtinfieldtype.md)<!-- -->> | The field type of the direct answer. | | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.