/// import * as yaml from 'js-yaml'; import { IncludeDirOptions } from './dir'; import { IncludeDirSeqOptions } from './seq'; /** A wrapper around YAML loader to enable including of files or directories */ export declare class YamlInclude { private readonly _directoryOptions?; private readonly _seqOptions?; private readonly _encoding; private _baseFile; /** * Creates a new instance * @param _directoryOptions Default options for directory include * @param _seqOptions Default options for directory as array include * @param _encoding Encoding of files. */ constructor(_directoryOptions?: Partial, _seqOptions?: Partial, _encoding?: BufferEncoding); /** * Reads a YAML file and parses it's content using include schema * @param filePath Path to the file to read * @param baseSchema Determines the base schema for YAML parse. @default yaml.DEFAULT_SCHEMA * @typeParam T - Type of the expected result object * @returns Parsed file content */ load(filePath: string, baseSchema?: yaml.Schema): T; /** * Reads a YAML file asynchronously and parses it's content using include schema * @param filePath Path to the file to read * @param baseSchema Determines the base schema for YAML parse. @default yaml.DEFAULT_SCHEMA * @typeParam T - Type of the expected result object * @returns Parsed file content */ loadAsync(filePath: string, baseSchema?: yaml.Schema): Promise; /** * Parses a YAML content using include schema * @param src YAML as string * @param basePath Base path for the include schema * @param baseSchema Determines the base schema for YAML parse. @default yaml.DEFAULT_SCHEMA * @typeParam T - Type of the expected result object * @returns Parsed file content */ parse(src: string, basePath: string, baseSchema?: yaml.Schema): T; /** Sets a base file path for resolving files or directories */ set basePath(filePath: string); /** Gets a base file path for resolving files or directories */ get basePath(): string; /** Gets default encoding for reading the files */ get encoding(): BufferEncoding; /** Gets default directory include options */ get directoryOptions(): Partial | undefined; /** Gets default directory as array include options */ get seqOptions(): Partial | undefined; /** Gets include types for the YAML schema */ get types(): yaml.Type[]; /** Gets a schema for YAML */ get schema(): yaml.Schema; }