app.d.ts definitions

This commit is contained in:
matthieu42morin 2024-04-29 05:01:30 +02:00
parent 3d19886432
commit a902adaf43
1 changed files with 79 additions and 79 deletions

158
src/app.d.ts vendored
View File

@ -3,92 +3,92 @@
import type { FFFBase, FFFMedia, FFFMention } from 'fff-flavored-frontmatter' import type { FFFBase, FFFMedia, FFFMention } from 'fff-flavored-frontmatter'
interface ImportMetaEnv extends Readonly<Record<string, string>> { interface ImportMetaEnv extends Readonly<Record<string, string>> {
readonly URARA_SITE_PROTOCOL?: 'http://' | 'https://' readonly URARA_SITE_PROTOCOL?: 'http://' | 'https://'
readonly URARA_SITE_DOMAIN?: string readonly URARA_SITE_DOMAIN?: string
} }
interface ImportMeta { interface ImportMeta {
glob<Module = { [key: string]: unknown }>(pattern: string): Record<string, Module> glob<Module = { [key: string]: unknown }>(pattern: string): Record<string, Module>
readonly env: ImportMetaEnv readonly env: ImportMetaEnv
} }
declare global { declare global {
namespace Urara { namespace Urara {
namespace Post { namespace Post {
type Frontmatter = Omit<FFFBase, 'flags'> & type Frontmatter = Omit<FFFBase, 'flags'> &
Pick<FFFMention, 'in_reply_to'> & Pick<FFFMention, 'in_reply_to'> &
Pick<FFFMedia, 'alt'> & { Pick<FFFMedia, 'alt'> & {
/** /**
* post type. * post type.
* @remarks auto-generated * @remarks auto-generated
*/ */
type: 'article' | 'note' | 'photo' | 'reply' | 'audio' | 'video' | 'like' | 'repost' | 'bookmark' type: 'article' | 'note' | 'photo' | 'reply' | 'audio' | 'video' | 'like' | 'repost' | 'bookmark'
/** /**
* post layout. * post layout.
*/ */
layout?: 'article' | 'note' | 'photo' | 'reply' layout?: 'article' | 'note' | 'photo' | 'reply'
/** /**
* post path. * post path.
* @remarks auto-generated * @remarks auto-generated
*/ */
path: string path: string
/** /**
* post slug. * post slug.
* @remarks auto-generated * @remarks auto-generated
*/ */
slug: string slug: string
/** /**
* table of contents. * table of contents.
* @remarks auto-generated, article-only, set to `false` to disable * @remarks auto-generated, article-only, set to `false` to disable
*/ */
toc?: false | Toc[] toc?: false | Toc[]
/** /**
* the created date of the post. * the created date of the post.
* @remarks auto-generated or set manually * @remarks auto-generated or set manually
*/ */
created: string created: string
/** /**
* the updated date of the post. * the updated date of the post.
* @remarks auto-generated or set manually * @remarks auto-generated or set manually
*/ */
updated: string updated: string
/** /**
* the published date of the post. * the published date of the post.
*/ */
published?: string published?: string
/** /**
* the featured image for article, or image for "photo" / "multi-photo" posts. * the featured image for article, or image for "photo" / "multi-photo" posts.
* @remarks currently only supports string * @remarks currently only supports string
*/ */
image?: string image?: string
/** enable some advanced features. /** enable some advanced features.
* @property hidden - deprecated, transfer to `unlisted` * @property hidden - deprecated, transfer to `unlisted`
* @property unlisted - hide this post from the homepage and feed. * @property unlisted - hide this post from the homepage and feed.
* @property bridgy-fed - add a link to Bridgy Fed in the post. https://fed.brid.gy/ * @property bridgy-fed - add a link to Bridgy Fed in the post. https://fed.brid.gy/
* @property bridgy-{target} - add a link to Bridgy in the post. https://brid.gy/publish/{target} * @property bridgy-{target} - add a link to Bridgy in the post. https://brid.gy/publish/{target}
*/ */
flags?: string[] flags?: string[]
} }
type Toc = { type Toc = {
depth: number depth: number
title?: string title?: string
slug?: string slug?: string
children?: Toc[] children?: Toc[]
} }
interface Module { interface Module {
default: { default: {
render: () => { render: () => {
html: string html: string
head: string head: string
css: { css: {
code: string code: string
}
}
}
metadata: Frontmatter
} }
}
} }
metadata: Frontmatter type Post = Post.Frontmatter & { html?: string }
} type Page = { title?: string; path: string }
} }
type Post = Post.Frontmatter & { html?: string }
type Page = { title?: string; path: string }
}
} }