Skip to content

Commit

Permalink
feat: extended guideline search result type (#597)
Browse files Browse the repository at this point in the history
* extended guideline search result type

* exposed result type

* udpated type

* renamed
  • Loading branch information
bojangles-m authored Oct 12, 2023
1 parent 4599249 commit c0b9f21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class GuidelineSearchResultApiDummy {
document_title: 'Document Title',
portal_id: 1,
portal_token: 'portal-token',
section_id: null,
section_slug: null,
section_title: null,
color_hex: undefined,
};
}
}
14 changes: 13 additions & 1 deletion packages/app-bridge/src/types/GuidelineSearchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

import type { CamelCasedPropertiesDeep } from 'type-fest';

export const GuidelineSearchResultTypeMap = {
block: 'BLOCK',
section: 'SECTION',
page: 'PAGE',
color: 'COLOR',
} as const;
type GuidelineSearchResultType = (typeof GuidelineSearchResultTypeMap)[keyof typeof GuidelineSearchResultTypeMap];

export type GuidelineSearchResultApi = {
highlights: string[];
type: 'PAGE' | 'SECTION' | 'BLOCK' | 'COLOR';
type: GuidelineSearchResultType;
object_id: number;
page_id: number;
page_slug: string;
Expand All @@ -16,6 +24,10 @@ export type GuidelineSearchResultApi = {
document_title: string;
portal_id: number;
portal_token: string | null;
section_id: string | null;
section_slug: string | null;
section_title: string | null;
color_hex?: string;
};

export type GuidelineSearchResult = CamelCasedPropertiesDeep<GuidelineSearchResultApi>;

0 comments on commit c0b9f21

Please sign in to comment.