contentful-management
Version:
Client for Contentful's Content Management API
37 lines (36 loc) • 1.25 kB
TypeScript
import type { BasicCursorPaginationOptions, CursorPaginatedCollectionProp, MakeRequest, SysLink } from '../common-types';
export type ResourceQueryOptions = LookupQueryOptions | SearchQueryOptions;
type LookupQueryOptions = {
'sys.urn[in]': string;
} & BasicCursorPaginationOptions;
type SearchQueryOptions = {
query: string;
} & BasicCursorPaginationOptions;
export type ResourceProps = {
sys: {
type: 'Resource';
urn: string;
resourceType: SysLink;
resourceProvider: SysLink;
appDefinition: SysLink;
};
fields: {
title: string;
subtitle?: string;
description?: string;
externalUrl?: string;
image?: {
url: string;
altText?: string;
};
badge?: {
label: string;
variant: 'primary' | 'negative' | 'positive' | 'warning' | 'secondary';
};
};
};
export declare function wrapResource(makeRequest: MakeRequest, data: ResourceProps): ResourceProps & {
toPlainObject(): ResourceProps;
};
export declare const wrapResourceCollection: (makeRequest: MakeRequest, data: CursorPaginatedCollectionProp<ResourceProps>) => CursorPaginatedCollectionProp<ResourceProps>;
export {};