-
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
StringValueDirectAnswer
interface.
This PR creates the `StringValueDirectAnswer` interface, which describes a direct answer sourced from a string (or string list) field in the Knowledge Graph. J=SLAP-2315 TEST=manual I made a few code changes locally which are not included in this PR. These changes allowed me to generate a switch statement on `fieldType`. I added cases for `single_line_text` and `multi_line_text`. These cases were hit as expected when getting direct answers for string and string list fields. In these switch statements, I saw the IDE correctly inferring that the DA was a `StringValueDirectAnswer`.
- Loading branch information
1 parent
75a2d99
commit 5a84aba
Showing
4 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
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 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
11 changes: 11 additions & 0 deletions
11
src/models/searchservice/response/StringValueDirectAnswer.ts
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,11 @@ | ||
import { BuiltInFieldType } from './BuiltInFieldType'; | ||
import { FieldValueDirectAnswer } from './FieldValueDirectAnswer'; | ||
|
||
/** | ||
* A direct answer whose source is a string or string list field in the knowledge graph. | ||
* | ||
* @public | ||
*/ | ||
export interface StringValueDirectAnswer extends FieldValueDirectAnswer<string | string[]> { | ||
fieldType: BuiltInFieldType.SingleLineText | BuiltInFieldType.MultiLineText | ||
} |