// Hand-authored ESM declaration for the vendored slice of `gray-matter`. // The upstream `gray-matter.d.ts` is `export =` (CJS-style) and cannot be // re-exported as a default ESM binding without rewriting. Only the surface // eve touches is typed here: invoking the default function, the static // `test()` predicate, and the `data`/`content` properties on the result. export type Input = string | Buffer; export interface GrayMatterOption> { parser?: () => void; eval?: boolean; excerpt?: boolean | ((input: I, options: O) => string); excerpt_separator?: string; engines?: Record< string, ((input: string) => object) | { parse(input: string): object; stringify?(data: object): string } >; language?: string; delimiters?: string | [string, string]; } export interface GrayMatterFile { data: Record; content: string; excerpt?: string; orig: Buffer | I; language: string; matter: string; stringify(lang: string): string; } export interface GrayMatterFunction { >( input: I | { content: I }, options?: O, ): GrayMatterFile; test>( str: string, options?: GrayMatterOption, ): boolean; read>( filepath: string, options?: GrayMatterOption, ): GrayMatterFile; stringify>( file: string | { content: string }, data: object, options?: GrayMatterOption, ): string; language>( str: string, options?: GrayMatterOption, ): { name: string; raw: string }; } declare const matter: GrayMatterFunction; export default matter;