Skip to content

Commit

Permalink
Merge eb9b635 into f4066f2
Browse files Browse the repository at this point in the history
  • Loading branch information
oshi97 committed Aug 16, 2022
2 parents f4066f2 + eb9b635 commit c15c242
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/search-core.builtinfieldtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export declare enum BuiltInFieldType
| Decimal | <code>&quot;decimal&quot;</code> | |
| FacebookURL | <code>&quot;facebook_url&quot;</code> | |
| InstagramHandle | <code>&quot;instagram_handle&quot;</code> | |
| Integer | <code>&quot;integer&quot;</code> | |
| IOSAppURL | <code>&quot;ios_app_url&quot;</code> | |
| MultiLineText | <code>&quot;multi_line_text&quot;</code> | |
| Phone | <code>&quot;phone&quot;</code> | |
Expand Down
2 changes: 2 additions & 0 deletions etc/search-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export enum BuiltInFieldType {
// (undocumented)
InstagramHandle = "instagram_handle",
// (undocumented)
Integer = "integer",
// (undocumented)
IOSAppURL = "ios_app_url",
// (undocumented)
MultiLineText = "multi_line_text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum BuiltInFieldType {
// Address = 'address',
// Hours = 'hours',
Decimal = 'decimal',
// Integer = 'integer',
Integer = 'integer',
SingleLineText = 'single_line_text',
RichText = 'rich_text',
MultiLineText = 'multi_line_text'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { EnumOrLiteral } from '../../../../utils/EnumOrLiteral';
import { BaseFieldValueDirectAnswer } from '../BaseFieldValueDirectAnswer';
import { BuiltInFieldType } from '../BuiltInFieldType';

/**
* A direct answer for an integer field.
*
* @remarks
* `IntegerDirectAnswer`s are only used for built in number fields.
* Custom number fields use {@link DecimalDirectAnswer} instead.
*
* @public
*/
export interface IntegerDirectAnswer extends BaseFieldValueDirectAnswer<number> {
fieldType: EnumOrLiteral<BuiltInFieldType.Integer>
}
3 changes: 3 additions & 0 deletions test-site/src/ts/initDirectAnswers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const FIELD_VALUE_QUERIES = {
'oliver shi my rich text field', // string
'oliver shi multi line rich text' // string[]
],
[BuiltInFieldType.Integer]: [
'oliver shi outdoor pools?' // number
]
};

export default function initDirectAnswers() {
Expand Down

0 comments on commit c15c242

Please sign in to comment.