@types/yaml-front-matter
TypeScript icon, indicating that this package has built-in type declarations

4.1.3 • Public • Published

Installation

npm install --save @types/yaml-front-matter

Summary

This package contains type definitions for yaml-front-matter (https://github.com/dworthen/js-yaml-front-matter#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yaml-front-matter.

index.d.ts

/// <reference types="node" />

import { LoadOptions } from "js-yaml";

export function loadFront(
    content: string | Buffer,
    options?: LoadOptions,
): {
    readonly [key: string]: any;
    readonly __content: string;
};

export function loadFront<contentKeyName extends string>(
    content: string | Buffer,
    options: LoadOptions & { contentKeyName: contentKeyName },
):
    & {
        readonly [key in contentKeyName]: string;
    }
    & {
        readonly [key: string]: any;
    };

export function safeLoadFront(
    content: string | Buffer,
    options?: LoadOptions,
): {
    readonly [key: string]: any;
    readonly __content: string;
};

export function safeLoadFront<contentKeyName extends string>(
    content: string | Buffer,
    options: LoadOptions & { contentKeyName: contentKeyName },
):
    & {
        readonly [key in contentKeyName]: string;
    }
    & {
        readonly [key: string]: any;
    };

Additional Details

Credits

These definitions were written by ZHAO Jinxiang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/yaml-front-matter

Weekly Downloads

1,425

Version

4.1.3

License

MIT

Unpacked Size

4.67 kB

Total Files

5

Last publish

Collaborators

  • types