Document Type

The Typescript definition of the visual editor's Document type

The following Document interface is extracted from the @stackbit/types package.

To extend the visual editor's Document with custom data, you can use the DocumentContext generic type when defining your content source class.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
interface Document<DocumentContext = unknown> { type: 'document' id: string manageUrl: string modelName: string status: 'added' | 'modified' | 'published' | 'deleted' createdAt: string createdBy?: string updatedAt: string updatedBy?: string[] locale?: string fields: Record<string, DocumentField> context: DocumentContext }

Please install @stackbit/types package to introspect the DocumentField type.