TypeScript

    The type of a content Type can be inferred.

    import {Infer, Config, Field} from 'alinea'
    
    const schema = {
      BlogOverview: Config.document('Blog overview', {
        contains: ['BlogPost']
      }),
      BlogPost: Config.document('Blog post', {
        fields: {
          publishDate: Field.date('Publish date'),
          body: Field.richText('Body')
        }
      })
    }
    
    type BlogOverview = Infer<typeof schema.BlogOverview>
    type BlogPost = Infer<typeof schema.BlogPost>