Skip to content

Commit

Permalink
Merge a564336 into edc1689
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannzhou committed Aug 10, 2022
2 parents edc1689 + a564336 commit 4424bd2
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/search-core.directanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A direct answer to a search.
<b>Signature:</b>

```typescript
export interface DirectAnswer
export interface DirectAnswer<T = unknown>
```

## Properties
Expand All @@ -19,6 +19,6 @@ export interface DirectAnswer
| [fieldType](./search-core.directanswer.fieldtype.md) | string | The field type of the direct answer. |
| [relatedResult](./search-core.directanswer.relatedresult.md) | [Result](./search-core.result.md) | The entity associated with the direct answer. |
| [type](./search-core.directanswer.type.md) | [DirectAnswerType](./search-core.directanswertype.md) | The [DirectAnswerType](./search-core.directanswertype.md)<!-- -->. |
| [value?](./search-core.directanswer.value.md) | string | <i>(Optional)</i> The result of the direct answer. |
| [value?](./search-core.directanswer.value.md) | T | <i>(Optional)</i> The result of the direct answer. |
| [verticalKey](./search-core.directanswer.verticalkey.md) | string | The vertical key of the direct answer. |

2 changes: 1 addition & 1 deletion docs/search-core.directanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The result of the direct answer.
<b>Signature:</b>

```typescript
value?: string;
value?: T;
```

## Remarks
Expand Down
4 changes: 2 additions & 2 deletions docs/search-core.featuredsnippetdirectanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ A direct answer which was found within a document.
<b>Signature:</b>

```typescript
export interface FeaturedSnippetDirectAnswer extends DirectAnswer
export interface FeaturedSnippetDirectAnswer extends DirectAnswer<string>
```
<b>Extends:</b> [DirectAnswer](./search-core.directanswer.md)
<b>Extends:</b> [DirectAnswer](./search-core.directanswer.md)<!-- -->&lt;string&gt;
## Properties
Expand Down
6 changes: 3 additions & 3 deletions docs/search-core.fieldvaluedirectanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ A direct answer where the answer came from a field from the knowledge graph.
<b>Signature:</b>

```typescript
export interface FieldValueDirectAnswer extends DirectAnswer
export interface FieldValueDirectAnswer<T = unknown> extends DirectAnswer<T>
```
<b>Extends:</b> [DirectAnswer](./search-core.directanswer.md)
<b>Extends:</b> [DirectAnswer](./search-core.directanswer.md)<!-- -->&lt;T&gt;
## Properties
Expand All @@ -23,6 +23,6 @@ export interface FieldValueDirectAnswer extends DirectAnswer
| [fieldType](./search-core.fieldvaluedirectanswer.fieldtype.md) | string | The field type of the direct answer. |
| [relatedResult](./search-core.fieldvaluedirectanswer.relatedresult.md) | [Result](./search-core.result.md) | The entity associated with the direct answer. |
| [type](./search-core.fieldvaluedirectanswer.type.md) | [DirectAnswerType.FieldValue](./search-core.directanswertype.md) | [DirectAnswerType](./search-core.directanswertype.md)<!-- -->.FieldValue. |
| [value](./search-core.fieldvaluedirectanswer.value.md) | string | The result of the direct answer. |
| [value](./search-core.fieldvaluedirectanswer.value.md) | T | The result of the direct answer. |
| [verticalKey](./search-core.fieldvaluedirectanswer.verticalkey.md) | string | The vertical key of the direct answer. |
2 changes: 1 addition & 1 deletion docs/search-core.fieldvaluedirectanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The result of the direct answer.
<b>Signature:</b>

```typescript
value: string;
value: T;
```

## Remarks
Expand Down
10 changes: 5 additions & 5 deletions etc/search-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ export interface CombinedFilter {
export type Context = any;

// @public
export interface DirectAnswer {
export interface DirectAnswer<T = unknown> {
fieldType: string;
relatedResult: Result;
type: DirectAnswerType;
value?: string;
value?: T;
verticalKey: string;
}

Expand Down Expand Up @@ -195,7 +195,7 @@ export interface FailedVertical {
}

// @public
export interface FeaturedSnippetDirectAnswer extends DirectAnswer {
export interface FeaturedSnippetDirectAnswer extends DirectAnswer<string> {
fieldType: string;
relatedResult: Result;
snippet: Snippet;
Expand All @@ -205,14 +205,14 @@ export interface FeaturedSnippetDirectAnswer extends DirectAnswer {
}

// @public
export interface FieldValueDirectAnswer extends DirectAnswer {
export interface FieldValueDirectAnswer<T = unknown> extends DirectAnswer<T> {
entityName: string;
fieldApiName: string;
fieldName: string;
fieldType: string;
relatedResult: Result;
type: DirectAnswerType.FieldValue;
value: string;
value: T;
verticalKey: string;
}

Expand Down
4 changes: 2 additions & 2 deletions src/models/searchservice/response/DirectAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DirectAnswerType } from './DirectAnswerType';
*
* @public
*/
export interface DirectAnswer {
export interface DirectAnswer<T = unknown> {
/** The {@link DirectAnswerType}. */
type: DirectAnswerType,
/**
Expand All @@ -15,7 +15,7 @@ export interface DirectAnswer {
* @remarks
* A value will not be present if the {@link DirectAnswer.fieldType} is 'rich_text'.
*/
value?: string,
value?: T,
/** The entity associated with the direct answer. */
relatedResult: Result,
/** The vertical key of the direct answer. */
Expand Down
22 changes: 22 additions & 0 deletions src/models/searchservice/response/DirectAnswerFieldType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Type for value of DirectAnswer.
*
* @public
*/
export enum DirectAnswerFieldType {
Url = 'url',
ComplexUrl = 'complex_url',
IOSAppUrl = 'ios_app_url',
AndroidAppUrl = 'android_app_url',
FacebookUrl = 'facebook_url',
Email = 'email',
InstagramHandle = 'instagram_handle',
TwitterHandle = 'twitter_handle',
Phone = 'phone',
Address = 'address',
Hours = 'hours',
Decimal = 'decimal',
RichText = 'rich_text',
SingleLineText = 'single_line_text',
MultiLineText = 'multi_line_text'
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Snippet } from './Snippet';
*
* @public
*/
export interface FeaturedSnippetDirectAnswer extends DirectAnswer {
export interface FeaturedSnippetDirectAnswer extends DirectAnswer<string> {
/** {@link DirectAnswerType}.FeaturedSnippet. */
type: DirectAnswerType.FeaturedSnippet,
/** {@inheritDoc DirectAnswer.value} */
Expand Down
4 changes: 2 additions & 2 deletions src/models/searchservice/response/FieldValueDirectAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Result } from './Result';
*
* @public
*/
export interface FieldValueDirectAnswer extends DirectAnswer {
export interface FieldValueDirectAnswer<T = unknown> extends DirectAnswer<T> {
/** {@link DirectAnswerType}.FieldValue. */
type: DirectAnswerType.FieldValue,
/** {@inheritDoc DirectAnswer.value} */
value: string,
value: T,
/** {@inheritDoc DirectAnswer.relatedResult} */
relatedResult: Result,
/** {@inheritDoc DirectAnswer.verticalKey} */
Expand Down

0 comments on commit 4424bd2

Please sign in to comment.