astro/tools/language-server/astro.d.ts
Matthew Phillips 2c5380a266
Add support for Astro.* completion and Hover help (#1068)
* Add support for Astro.* completion and Hover help

* Allow providing a generic type to fetchContent
2021-08-10 09:30:02 -04:00

27 lines
No EOL
610 B
TypeScript

type AstroRenderedHTML = string;
type FetchContentResult<ContentFrontmatter extends Record<string, any> = Record<string, any>> = {
astro: {
headers: string[];
source: string;
html: AstroRenderedHTML;
};
url: URL;
} & ContentFrontmatter;
interface AstroPageRequest {
url: URL;
canonicalURL: URL;
}
interface Astro {
isPage: boolean;
fetchContent<ContentFrontmatter>(globStr: string): FetchContentResult<ContentFrontmatter>[];
props: Record<string, number | string | any>;
request: AstroPageRequest;
site: URL;
}
declare const Astro: Astro;
export default function(): string;