1 | import { Dictionary } from '@stoplight/types';
|
2 | import { IPluginEvent, IPluginTask } from '../..';
|
3 | import { ISourceNodeInstance, Specs } from '../../graph';
|
4 | import { GraphiteEvent } from '../../notifier';
|
5 | import { IDeserializeSourceNode, ISerializeSourceNode } from '../../scheduler';
|
6 | import { AbstractLifecyclePlugin } from '../abstract-lifecycle';
|
7 | import { StoplightConfig } from './types';
|
8 | import { mergeConfig } from './utils/mergeConfig';
|
9 | export { DEFAULT_CONFIG, DEFAULT_PATHS, STOPLIGHT_CONFIG_PATH, STOPLIGHT_CONFIG_PLUGIN_ID } from './consts';
|
10 | export { mergeFormats } from './utils/mergeFormats';
|
11 | export { mergeConfig };
|
12 | export * from './types';
|
13 | export declare type StoplightConfigProps = {
|
14 | cwd: string;
|
15 | readFile: typeof import('fs').promises.readFile;
|
16 | defaultConfig?: StoplightConfig;
|
17 | };
|
18 | export declare const createStoplightConfigPlugin: (props: StoplightConfigProps) => StoplightConfigPlugin;
|
19 | export 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 | }
|