/** * Copyright 2017-present Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain * a copy of the license in the LICENSE and PATENTS files in the root of this * repository. */ import { IFile, IPlugin } from "./client"; import { ICompilerOptions } from "./compiler"; /** * Plugins are stored with the regex used to match against file paths. */ export interface IPluginEntry { pattern: RegExp; plugin: IPlugin; } export declare class Documentalist { private options; private plugins; /** * Construct a new `Documentalist` instance with the provided options. * This method lends itself particularly well to the chaining syntax: * `Documentalist.create(options).use(...)`. */ static create(options?: ICompilerOptions): Documentalist<{}>; constructor(options?: ICompilerOptions, plugins?: Array>); /** * Adds the plugin to Documentalist. Returns a new instance of Documentalist * with a template type that includes the data from the plugin. This way the * `documentFiles` and `documentGlobs` methods will return an object that is * already typed to include each plugin's output. * * The plugin is applied to all files whose absolute path matches the * supplied pattern. * * @param pattern - A regexp pattern or a file extension string like "js" * @param plugin - The plugin implementation * @returns A new instance of `Documentalist` with an extended type */ use

(pattern: RegExp | string, plugin: IPlugin

): Documentalist; /** * Returns a new instance of Documentalist with no plugins. */ clearPlugins(): Documentalist<{}>; /** * Finds all files matching the provided variadic glob expressions and then * runs `documentFiles` with them, emitting all the documentation data. */ documentGlobs(...filesGlobs: string[]): Promise; /** * Iterates over all plugins, passing all matching files to each in turn. * The output of each plugin is merged to produce the resulting * documentation object. * * The return type `T` is a union of each plugin's data type. */ documentFiles(files: IFile[]): Promise; /** * Expands an array of globs and flatten to a single array of files. */ private expandGlobs; /** * Shallow-merges keys form source into destination object (modifying it in the process). */ private mergeInto; }