jsdocs
This commit is contained in:
parent
86b6c6ba89
commit
397380ca39
1 changed files with 36 additions and 3 deletions
39
src/content-env.d.ts
vendored
39
src/content-env.d.ts
vendored
|
@ -1,25 +1,54 @@
|
||||||
declare module 'content/routes.js' {
|
declare module 'content/routes.js' {
|
||||||
|
/**
|
||||||
|
* Defines the available `views` that can be used to set up routes.
|
||||||
|
* Each `Template` has different configuration options
|
||||||
|
*/
|
||||||
type Template =
|
type Template =
|
||||||
| 'markdown'
|
| 'markdown'
|
||||||
|
|
||||||
type GenericRouteDefinition = {
|
/**
|
||||||
|
* Defines the shared options for a route
|
||||||
|
*/
|
||||||
|
type SharedRouteDefinition = {
|
||||||
id: string
|
id: string
|
||||||
stylesheetUrls: string[]
|
stylesheetUrls: string[]
|
||||||
template: Template
|
template: Template
|
||||||
}
|
}
|
||||||
|
|
||||||
type MarkdownDefinition = GenericRouteDefinition & {
|
/**
|
||||||
template: 'markdown'
|
* Defines a content-based route
|
||||||
|
*/
|
||||||
|
type ContentfulRouteDefintion = SharedRouteDefinition & {
|
||||||
content: string
|
content: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the config for a route using the `markdown` {@link Template}
|
||||||
|
*/
|
||||||
|
type MarkdownDefinition = ContentfulRouteDefintion & {
|
||||||
|
template: 'markdown'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines all available route definitions
|
||||||
|
*/
|
||||||
type RouteDefinition =
|
type RouteDefinition =
|
||||||
| MarkdownDefinition
|
| MarkdownDefinition
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the collection of routes the app uses
|
||||||
|
*/
|
||||||
type RouteCollection = { [key: string]: RouteDefinition }
|
type RouteCollection = { [key: string]: RouteDefinition }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The routes the app uses
|
||||||
|
*/
|
||||||
const routes: RouteCollection
|
const routes: RouteCollection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines an entry in the app header.
|
||||||
|
* Optionally recursive by defining children instead of path.
|
||||||
|
*/
|
||||||
type HeaderEntry = {
|
type HeaderEntry = {
|
||||||
displayName: string
|
displayName: string
|
||||||
} & ({
|
} & ({
|
||||||
|
@ -28,5 +57,9 @@ declare module 'content/routes.js' {
|
||||||
children: HeaderEntry[]
|
children: HeaderEntry[]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The header the app uses.
|
||||||
|
* If not present, the header will not show.
|
||||||
|
*/
|
||||||
const header: HeaderEntry[]
|
const header: HeaderEntry[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue