astro/packages/astro/env.d.ts
Ben Holmes f7afdb889f
[MDX] Fix remaining inconsistencies with Markdown (#4268)
* feat: add "file" and "url" to layout props

* feat: add rawContent and compiledContent errs

* fix: add "file" and "url" to frontmatter

* fix: add separate MDX instance type

* types: add MarkdownLayoutProps and MDXLayoutProps

* refactor: simplify MDXLayoutProps

* test: pass file and url to layout

* test: glob components with .default and Content

* feat: add <Content /> to MDX

* feat: declare MDX type module

* fix: [MD] move file and url to layout props only

* chore: changeset

* chore: bump MDX to "minor" with more details

* refactor: remove "file" + "url" top-level props (save for minor)

* revert: MDInstance type def updates (save for minor)

* fix: MDXInstance "default" + "content" types

* fix: bad test layout

* chore: remove getHeaders fro *.mdx
2022-08-12 18:17:26 -04:00

50 lines
1.6 KiB
TypeScript

/// <reference path="./client.d.ts" />
type Astro = import('./dist/types/@types/astro').AstroGlobal;
// We duplicate the description here because editors won't show the JSDoc comment from the imported type (but will for its properties, ex: Astro.request will show the AstroGlobal.request description)
/**
* Astro global available in all contexts in .astro files
*
* [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)
*/
declare const Astro: Readonly<Astro>;
declare const Fragment: any;
declare module '*.md' {
type MD = import('./dist/types/@types/astro').MarkdownInstance<Record<string, any>>;
export const frontmatter: MD['frontmatter'];
export const file: MD['file'];
export const url: MD['url'];
export const getHeadings: MD['getHeadings'];
/** @deprecated Renamed to `getHeadings()` */
export const getHeaders: () => void;
export const Content: MD['Content'];
export const rawContent: MD['rawContent'];
export const compiledContent: MD['compiledContent'];
const load: MD['default'];
export default load;
}
declare module '*.mdx' {
type MDX = import('astro').MDXInstance<Record<string, any>>;
export const frontmatter: MDX['frontmatter'];
export const file: MDX['file'];
export const url: MDX['url'];
export const getHeadings: MDX['getHeadings'];
export const Content: MDX['Content'];
export const rawContent: MDX['rawContent'];
export const compiledContent: MDX['compiledContent'];
const load: MDX['default'];
export default load;
}
declare module '*.html' {
const Component: { render(opts: { slots: Record<string, string> }): string };
export default Component;
}