types.d.ts — astro Source File
Architecture documentation for types.d.ts, a typescript file in the astro codebase.
Entity Profile
Relationship Graph
Source Code
declare module 'astro:content' {
export interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}
export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
export type CollectionKey = keyof DataEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<DataEntryMap[C]>;
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
export type ReferenceDataEntry<
C extends CollectionKey,
E extends keyof DataEntryMap[C] = string,
> = {
collection: C;
id: E;
};
export type ReferenceLiveEntry<C extends keyof LiveContentConfig['collections']> = {
collection: C;
id: string;
};
export function getCollection<C extends keyof DataEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof DataEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;
export function getLiveCollection<C extends keyof LiveContentConfig['collections']>(
collection: C,
filter?: LiveLoaderCollectionFilterType<C>,
): Promise<
import('astro').LiveDataCollectionResult<LiveLoaderDataType<C>, LiveLoaderErrorType<C>>
>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
entry: ReferenceDataEntry<C, E>,
): E extends keyof DataEntryMap[C]
// ... (94 more lines)
Classes
Types
- AllValuesOf
- CollectionEntry
- CollectionKey
- ContentConfig
- DataEntryMap
- ExtractCollectionFilterType
- ExtractEntryFilterType
- ExtractErrorType
- ExtractLoaderTypes
- Flatten
- InferEntrySchema
- InferLoaderSchema
- LiveContentConfig
- LiveLoaderCollectionFilterType
- LiveLoaderDataType
- LiveLoaderEntryFilterType
- LiveLoaderErrorType
- ReferenceDataEntry
- ReferenceLiveEntry
- Render
- RenderResult
- RenderedContent
Source
Frequently Asked Questions
What does types.d.ts do?
types.d.ts is a source file in the astro codebase, written in typescript.
Where is types.d.ts in the architecture?
types.d.ts is located at packages/astro/templates/content/types.d.ts (directory: packages/astro/templates/content).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free