UNPKG

1.99 kBTypeScriptView Raw
1import { Dictionary } from '@stoplight/types';
2import { IPluginEvent, IPluginTask } from '../..';
3import { ISourceNodeInstance, Specs } from '../../graph';
4import { GraphiteEvent } from '../../notifier';
5import { IDeserializeSourceNode, ISerializeSourceNode } from '../../scheduler';
6import { AbstractLifecyclePlugin } from '../abstract-lifecycle';
7import { StoplightConfig } from './types';
8import { mergeConfig } from './utils/mergeConfig';
9export { DEFAULT_CONFIG, DEFAULT_PATHS, STOPLIGHT_CONFIG_PATH, STOPLIGHT_CONFIG_PLUGIN_ID } from './consts';
10export { mergeFormats } from './utils/mergeFormats';
11export { mergeConfig };
12export * from './types';
13export declare type StoplightConfigProps = {
14 cwd: string;
15 readFile: typeof import('fs').promises.readFile;
16 defaultConfig?: StoplightConfig;
17};
18export declare const createStoplightConfigPlugin: (props: StoplightConfigProps) => StoplightConfigPlugin;
19export declare class StoplightConfigPlugin extends AbstractLifecyclePlugin {
20 readonly id = "STOPLIGHT_CONFIG";
21 private readonly cwd;
22 private readonly uri;
23 private readonly readFile;
24 private readonly defaultConfig;
25 private config?;
26 private fileContents?;
27 private fileError?;
28 private readonly selector;
29 private paths?;
30 constructor({ cwd, readFile, defaultConfig }: StoplightConfigProps);
31 protected readonly specProvider: {
32 path: RegExp;
33 spec: Specs;
34 };
35 protected doActivate(): Promise<void>;
36 protected doDeactivate(): Promise<void>;
37 protected readonly tasks: [IPluginTask<IDeserializeSourceNode>, IPluginTask<ISerializeSourceNode>];
38 protected readonly events: [IPluginEvent<GraphiteEvent.DidPatch>];
39 getNodes(): import("../..").NodeInstance[];
40 createFilter(paths?: Dictionary<RegExp[], string>, cache?: WeakMap<ISourceNodeInstance, boolean> | null): (node: import("../..").NodeInstance) => boolean;
41 getPaths(): Dictionary<RegExp[], string>;
42 getConfig(): StoplightConfig;
43}