stoplightio/markdown

View on GitHub
src/frontmatter/types.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { MDAST } from '../ast-types';

export type PropertyPath = PropertyKey | PropertyKey[];

export interface IFrontmatter<T extends object = any> {
  document: MDAST.Root;
  getAll(): Partial<T> | void;
  get<V = unknown>(prop: PropertyPath): V | void;
  set(prop: PropertyPath, value: unknown): void;
  unset(prop: PropertyPath): void;
  stringify(): string;
  isEmpty: boolean;
}