Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Type aliases

LocalizationLookupMapping

LocalizationLookupMapping: Record<string, Record<string, string>>

WrappedContentful

WrappedContentful: { getContentType: typeof getContentType; getContentTypes: typeof getContentTypes; getFullContentById: typeof getFullContentById; getGlobalSettings: typeof getGlobalSettings; getLocales: typeof getLocales; getLocalizationLookup: typeof getLocalizationLookup; getPageBySlug: typeof getPageBySlug; getStaticSlugsForContentType: typeof getStaticSlugsForContentType }

Type declaration

Variables

Const client

client: ContentfulClientApi = createClient({space: process.env.CONTENTFUL_SPACE_ID,environment: process.env.CONTENTFUL_ENV || 'master',accessToken: process.env.CONTENTFUL_ACCESSTOKEN,host: process.env.CONTENTFUL_HOST || 'preview.contentful.com'})

Functions

Const Contentful

Const getContentType

  • getContentType(contentTypeId: string): Promise<ContentType>
  • Parameters

    • contentTypeId: string

    Returns Promise<ContentType>

Const getContentTypes

  • getContentTypes(): Promise<ContentTypeCollection>
  • Returns Promise<ContentTypeCollection>

Const getFullContentById

  • getFullContentById(contentTypeId: string, id: string, include?: number): Promise<Record<string, unknown>>
  • Parameters

    • contentTypeId: string
    • id: string
    • Default value include: number = 5

    Returns Promise<Record<string, unknown>>

Const getGlobalSettings

  • getGlobalSettings(include?: number, contentTypeId?: string): Promise<Record<string, unknown>>
  • Parameters

    • Default value include: number = 6
    • Default value contentTypeId: string = DEFAULT_SETTINGS_CONTENT_TYPE

    Returns Promise<Record<string, unknown>>

Const getLocales

  • getLocales(): Promise<Locale[]>

Const getLocalizationLookup

  • Parameters

    • Default value localizationLookupFieldName: string = DEFAULT_LOCALIZATION_LOOKUP_FIELD_NAME
    • Default value contentTypeId: string = DEFAULT_SETTINGS_CONTENT_TYPE

    Returns Promise<LocalizationLookupMapping>

Const getPageBySlug

  • getPageBySlug(slug: string, contentTypeId: string, include?: number, slugFieldName?: string): Promise<Record<string, unknown>>
  • Parameters

    • slug: string
    • contentTypeId: string
    • Default value include: number = 4
    • Default value slugFieldName: string = DEFAULT_SLUG_FIELD_NAME

    Returns Promise<Record<string, unknown>>

Const getStaticSlugsForContentType

  • getStaticSlugsForContentType(contentTypeId: string, slugFieldName?: string): Promise<string[]>
  • Parameters

    • contentTypeId: string
    • Default value slugFieldName: string = DEFAULT_SLUG_FIELD_NAME

    Returns Promise<string[]>

Const removeCircularRefs

  • removeCircularRefs(entries: any): any
  • Parameters

    • entries: any

    Returns any

Generated using TypeDoc