UNPKG

1.25 kBTypeScriptView Raw
1import type { BasicMetaSysProps, DefaultElements, MakeRequest } from '../common-types';
2import type { ContentfulSpaceAPI } from '../create-space-api';
3export type SpaceProps = {
4 sys: BasicMetaSysProps & {
5 organization: {
6 sys: {
7 id: string;
8 };
9 };
10 archivedAt?: string;
11 };
12 name: string;
13};
14export type Space = SpaceProps & DefaultElements<SpaceProps> & ContentfulSpaceAPI;
15/**
16 * This method creates the API for the given space with all the methods for
17 * reading and creating other entities. It also passes down a clone of the
18 * http client with a space id, so the base path for requests now has the
19 * space id already set.
20 * @private
21 * @param makeRequest - function to make requests via an adapter
22 * @param data - API response for a Space
23 * @return {Space}
24 */
25export declare function wrapSpace(makeRequest: MakeRequest, data: SpaceProps): Space;
26/**
27 * This method wraps each space in a collection with the space API. See wrapSpace
28 * above for more details.
29 * @private
30 */
31export declare const wrapSpaceCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<SpaceProps>) => import("../common-types").Collection<Space, SpaceProps>;