ModelInstance <D>
Index
Accessors
Methods
Accessors
categories
Returns a DynamicModelCategorySelector.
This is an accessor, which means that it should be used just like a common object parameter. For instance:
import Starlight from '@starlightcms/js-sdk'
// "categories" below is a DynamicModelCategorySelector.
const response = await Starlight.posts.categories.get('interviews')Returns DynamicModelCategorySelector<D>
entries
Returns an EntrySelector.
This is an accessor, which means that it should be used just like a common object parameter. For instance:
import Starlight from '@starlightcms/js-sdk'
// "entries" below is an EntrySelector.
const response = await Starlight.posts.entries.list()Returns EntrySelector<D>
Methods
category
Returns a ModelCategoryInstance.
If you’re using a DynamicModelInstance, you can use the dynamic syntax instead of this method.
Parameters
slug: string
The category slug.
Returns ModelCategoryInstance<D>
get
Returns a StarlightItemResponse with a single Model.
Returns Promise<StarlightItemResponse<Model>>
An Instance that provide methods to request information from a Model, its Entries, and its Categories.
You can access a ModelInstance using StarlightClient.model or using the dynamic syntax on a DynamicStarlightClient. Usage examples will use the dynamic syntax.
To list all workspace models, use a ModelSelector.