import { EntrySkeletonType, FieldsType } from "contentful"; import { Type } from "@angular/core"; import { ChainModifiers } from "contentful/dist/types/types/client"; import { LocaleCode } from "contentful/dist/types/types/locale"; import { BaseEntry, EntryFieldType, EntryFieldTypes, ResolvedLink } from "contentful/dist/types/types/entry"; import { Metadata } from "contentful/dist/types/types/metadata"; import { AssetFields, AssetSys } from "contentful/dist/types/types/asset"; export interface NcrAsset { sys: AssetSys; fields: AssetFields; metadata: Metadata; } export type CustomResolvedField, Modifiers extends ChainModifiers, Locales extends LocaleCode = LocaleCode> = Field extends ResponsiveField> ? ResponsiveField> : Field extends EntryFieldTypes.Array ? Array> : ResolvedLink; export type CustomEntry = BaseEntry & { sys: { contentType: { sys: { id: EntrySkeleton["contentTypeId"]; }; }; }; fields: { [FieldName in keyof EntrySkeleton["fields"]]: CustomResolvedField extends never ? EntrySkeleton["fields"][FieldName] : CustomResolvedField; }; }; export declare enum DefaultBreakpoints { xs = "xs", sm = "sm", md = "md", lg = "lg", xl = "xl" } export type ResponsiveField = { [Key in keyof (typeof DefaultBreakpoints & CustomBreakpoints)]?: T; }; export interface NcrEntry extends CustomEntry, undefined> { convertedData?: any; component: Type; responsiveField?: string[]; } export type NcrPage = NcrEntry<{ seoMeta: NcrEntry; metaData: NcrEntry; } & T>; export type BasePage = NcrPage<{}>; export type EntryFieldExtract = T extends NcrEntry ? K : never; export type TypeLink = NcrEntry<{ href: EntryFieldTypes.Text; item: NcrEntry; target: string; }>; export type PageMetaData = { /** * the page title is used for the page title tag which * is visible in the browser navigation as well as in the * Search Engine Result Page */ title: string; /** * The page description is used in the Search Engine Result Page. */ description: string; /** * The robots information drives search engines to index the page and * follow links in the page. */ robots: PageRobotsMeta[]; /** * Image that can be added to the og:image metatag. */ image: string; customMeta: CustomMeta; }; export interface CustomMeta { [key: string]: string; } export declare enum PageRobotsMeta { NOINDEX = "noindex", NOFOLLOW = "nofollow" }