Options
All
  • Public
  • Public/Protected
  • All
Menu

react-tinacms-contentful

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

ClientMode

ClientMode: "delivery" | "preview" | "management"

ContentfulEntriesFormOptions

ContentfulEntriesFormOptions: ContentfulEntryFormOptions

ContentfulMultiClient

ContentfulMultiClient: Pick<ContentfulClient, "authenticate" | "allowedOrigins"> & {}

ContentfulUpload

ContentfulUpload: { fields: { description: string; file: { contentType: string; file: string | ArrayBuffer | any; fileName: string }; title: string } }

Type declaration

  • fields: { description: string; file: { contentType: string; file: string | ArrayBuffer | any; fileName: string }; title: string }
    • description: string
    • file: { contentType: string; file: string | ArrayBuffer | any; fileName: string }
      • contentType: string
      • file: string | ArrayBuffer | any
      • fileName: string
    • title: string

Operation

Operation<Type>: Type extends "dereference" ? BaseOperation<"dereference"> & { fields: undefined } : BaseOperation<Type>

Type parameters

OperationType

OperationType: "create" | "update" | "dereference"

OptionalSpaceOptions

OptionalSpaceOptions: Partial<Omit<CreateClientParams, "accessToken" | "space" | "environment">> & { deliveryClient?: ContentfulClientApi; previewClient?: ContentfulClientApi }

Space

deprecated

Renamed to SpaceOptions. This type will be removed in v1.0.0.

getEntriesOptions

getEntriesOptions<Mode>: Omit<getEntryOptions<Mode>, "query">

Type parameters

getEntryOptions

getEntryOptions<Mode>: { locale?: string; mode?: Mode; preview?: boolean; query?: any }

Type parameters

Type declaration

  • Optional locale?: string
  • Optional mode?: Mode
  • Optional preview?: boolean
    deprecated

    Use mode instead. Will be removed in 1.0.0

  • Optional query?: any

Variables

Const AUTH_FAILURE

AUTH_FAILURE: "contentful:auth:failure" = "contentful:auth:failure"

Const AUTH_SUCCESS

AUTH_SUCCESS: "contentful:auth:success" = "contentful:auth:success"

Const CHANGE_ENVIRONMENT

CHANGE_ENVIRONMENT: "contentful:environment:change" = "contentful:environment:change"

Const CONTENTFUL_AUTH_HOSTNAME

CONTENTFUL_AUTH_HOSTNAME: "be.contentful.com" = "be.contentful.com"

Const CONTENTFUL_AUTH_TOKEN

CONTENTFUL_AUTH_TOKEN: "TINACMS_CONTENTFUL_USER_AUTH_TOKEN" = "TINACMS_CONTENTFUL_USER_AUTH_TOKEN"

Const CREATE_ENVIRONMENT

CREATE_ENVIRONMENT: "contentful:environment:create" = "contentful:environment:create"

Const CustomPaginatorPlugin

CustomPaginatorPlugin: MediaPaginatorPlugin = ...

Const ENTRY_DELETE

ENTRY_DELETE: "contentful:entry:delete" = "contentful:entry:delete"

Const ENTRY_PUBLISH

ENTRY_PUBLISH: "contentful:entry:publish" = "contentful:entry:publish"

Const ENTRY_UPDATE

ENTRY_UPDATE: "contentful:entry:update" = "contentful:entry:update"

Const ERROR

ERROR: "contentful:error" = "contentful:error"

Const FILE_TYPES

FILE_TYPES: FileTypes

Const MediaArchiveAction

MediaArchiveAction: { action: (props: ArchiveActionProps) => Element; type: string } = ...

Type declaration

Const MediaFilterAction

MediaFilterAction: { action: () => Element; type: string } = ...

Type declaration

  • action: () => Element
      • (): Element
      • Returns Element

  • type: string

Const MediaFilterScreenPlugin

MediaFilterScreenPlugin: ScreenPlugin = ...

Const ON_LOGIN

ON_LOGIN: "contentful:login" = "contentful:login"

Const ON_LOGOUT

ON_LOGOUT: "contentful:logout" = "contentful:logout"

Functions

Const AsyncAction

MediaArchiveActionButton

MediaFilter

  • MediaFilter(): Element

MediaFilterActionButton

  • MediaFilterActionButton(): Element

MediaManagerFilterModal

Paginator

  • Paginator(__namedParameters: MediaPaginatorProps): null | Element

Const TinaContentfulProvider

authenticateWithContentful

  • authenticateWithContentful(clientId: string, redirectUrl: string, allowedOrigins: string[], authWindow?: Window): Promise<string>
  • Parameters

    • clientId: string
    • redirectUrl: string
    • allowedOrigins: string[]
    • Optional authWindow: Window

    Returns Promise<string>

createContentfulClientForSpaces

Const createContentfulOperationsForEntries

  • createContentfulOperationsForEntries(initial: Entry<any>[], updated: Entry<any>[], parent?: null | Entry<any>, options?: GraphOptions): { create: BaseOperation<"create">[]; dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]; graph: OperationsGraph; update: BaseOperation<"update">[] }
  • Takes an initial and updated state of an array of entries, and computes a graph of the changes:

    • nodes: the individual operations to run to update the delta
    • edges: the relationships between operations, allowing different traversal paths

    Parameters

    • initial: Entry<any>[]

      The initial state of the entry

    • updated: Entry<any>[]

      The updated state of the entry

    • Optional parent: null | Entry<any>
    • Optional options: GraphOptions

    Returns { create: BaseOperation<"create">[]; dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]; graph: OperationsGraph; update: BaseOperation<"update">[] }

    operations and the graph

    • create: BaseOperation<"create">[]
    • dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]
    • graph: OperationsGraph
    • update: BaseOperation<"update">[]

Const createContentfulOperationsForEntry

  • createContentfulOperationsForEntry(initial: null | Entry<any>, updated: null | Entry<any>, options?: GraphOptions): { create: BaseOperation<"create">[]; dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]; graph: OperationsGraph; update: BaseOperation<"update">[] }
  • Takes an initial and updated state of an entry, and computes a graph of the changes:

    • nodes: the individual operations to run to update the delta
    • edges: the relationships between operations, allowing different traversal paths

    Parameters

    • initial: null | Entry<any>

      The initial state of the entry

    • updated: null | Entry<any>

      The updated state of the entry

    • Optional options: GraphOptions

    Returns { create: BaseOperation<"create">[]; dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]; graph: OperationsGraph; update: BaseOperation<"update">[] }

    operations and the graph

    • create: BaseOperation<"create">[]
    • dereference: (Entry<unknown> & { type: "dereference" } & { fields: undefined })[]
    • graph: OperationsGraph
    • update: BaseOperation<"update">[]

createFieldConfigFromContentType

  • createFieldConfigFromContentType(contentType: ContentType): TinaField<any>[]
  • Converts a Contentful Content Type to a TinaCMS Fields Array

    Parameters

    • contentType: ContentType

      The content type to convert

    Returns TinaField<any>[]

    An array of TinaCMS fields

getBearerToken

  • getBearerToken(window: Window, allowedOrigins?: string[]): void
  • Parameters

    • window: Window
    • Optional allowedOrigins: string[]

    Returns void

getCachedBearerToken

  • getCachedBearerToken(): string | undefined
  • Returns string | undefined

onBearerToken

  • onBearerToken(allowedOrigins?: string[]): Promise<string>
  • Parameters

    • Optional allowedOrigins: string[]

    Returns Promise<string>

openOauthWindow

  • openOauthWindow(clientId: string, redirectUrl: string): Window
  • Parameters

    • clientId: string
    • redirectUrl: string

    Returns Window

setCachedBearerToken

  • setCachedBearerToken(bearerToken: string, secure?: boolean): void
  • Parameters

    • bearerToken: string
    • Optional secure: boolean

    Returns void

useContentful

useContentfulAuthRedirect

  • useContentfulAuthRedirect(): void

useContentfulDelivery

  • useContentfulDelivery(spaceId?: string): ContentfulClientApi

useContentfulEntries

  • useContentfulEntries<TEntryType>(query: any, options?: useContentfulEntriesOptions): [Entry<TEntryType>[], boolean, Error | undefined]

useContentfulEntriesForm

  • useContentfulEntriesForm<EntryShape>(entries: Entry<EntryShape>[], options: ContentfulEntriesFormOptions, watch?: Partial<WatchableFormValue>): [Entry<EntryShape>[], Form]

useContentfulEntry

  • useContentfulEntry<TEntryType>(entryId: string, options?: useContentfulEntryOptions): [Entry<TEntryType> | undefined, boolean, Error | undefined]

useContentfulEntryForm

useContentfulManagement

  • useContentfulManagement(spaceId?: string): ClientAPI | undefined

useContentfulPreview

  • useContentfulPreview(spaceId?: string): ContentfulClientApi

Const useMediaFilterScreenPlugin

  • useMediaFilterScreenPlugin(): void

Generated using TypeDoc