UNPKG

1.29 kBTypeScriptView Raw
1import type { BasicCursorPaginationOptions, CursorPaginatedCollectionProp, MakeRequest, SysLink } from '../common-types';
2export type ResourceQueryOptions = LookupQueryOptions | SearchQueryOptions;
3type LookupQueryOptions = {
4 'sys.urn[in]': string;
5 locale?: string;
6} & BasicCursorPaginationOptions;
7type SearchQueryOptions = {
8 query: string;
9 locale?: string;
10} & BasicCursorPaginationOptions;
11export type ResourceProps = {
12 sys: {
13 type: 'Resource';
14 urn: string;
15 resourceType: SysLink;
16 resourceProvider: SysLink;
17 appDefinition: SysLink;
18 };
19 fields: {
20 title: string;
21 subtitle?: string;
22 description?: string;
23 externalUrl?: string;
24 image?: {
25 url: string;
26 altText?: string;
27 };
28 badge?: {
29 label: string;
30 variant: 'primary' | 'negative' | 'positive' | 'warning' | 'secondary';
31 };
32 };
33};
34export declare function wrapResource(makeRequest: MakeRequest, data: ResourceProps): ResourceProps & {
35 toPlainObject(): ResourceProps;
36};
37export declare const wrapResourceCollection: (makeRequest: MakeRequest, data: CursorPaginatedCollectionProp<ResourceProps>) => CursorPaginatedCollectionProp<ResourceProps>;
38export {};