smartfm/dist/index.d.ts

34 lines
891 B
TypeScript
Raw Normal View History

2016-11-13 22:11:49 +00:00
import 'typings-global';
2016-11-14 12:04:25 +00:00
export declare type TFrontMatter = 'yaml' | 'json';
2016-11-13 22:11:49 +00:00
export interface IParsedFM {
data: any;
content: string;
orig: string;
}
2016-11-14 12:04:25 +00:00
export interface ISmartfmContructorOptions {
fmType: TFrontMatter;
}
2016-11-13 22:11:49 +00:00
/**
* class smartfm handles frontmatter
*/
export declare class Smartfm {
2016-11-14 12:04:25 +00:00
fmType: TFrontMatter;
constructor(optionsArg: ISmartfmContructorOptions);
2016-11-13 22:11:49 +00:00
/**
* add frontmatter to a string
*/
2016-11-14 12:04:25 +00:00
stringify(bodyString: string, frontmatterData: any): any;
2016-11-13 22:11:49 +00:00
/**
* parse a string that has frontmatter attached, YAML notation
*/
parse(stringToParse: string): IParsedFM;
}
/**
* parse a string that has frontmatter attached, YAML notation
*/
export declare let parse: (stringToParse: string) => IParsedFM;
/**
* add frontmatter to a string
*/
2016-11-14 12:04:25 +00:00
export declare let stringify: (bodyString: string, frontmatterData: any) => any;