Pular para o conteúdo principal

ModelSelector

A Selector that provide methods to list and request information on Models.

You can use a ModelSelector by accessing StarlightClient.models.

To list entries or categories of a specific model, use a ModelInstance.

Index

Methods

Methods

get

  • Returns a StarlightItemResponse with a single Model.

    Note that this method only returns information on a model, like its title, slug, creation date, and entry count. If you want list its entries or categories, you need to use a ModelInstance.

    @example

    Requesting information from a model of slug “clients”.

    import Starlight from '@starlightcms/js-sdk'

    const response = await Starlight.posts.entries.get('clients')

    Parameters

    • slug: string

      The model slug.

    Returns Promise<StarlightItemResponse<Model>>

list