@stoplight/spectral
Version:
A flexible object linter with out of the box support for OpenAPI v2 and v3.
17 lines (16 loc) • 798 B
TypeScript
import { FunctionCollection, IConstructorOpts, IParsedResult, IRuleResult, PartialRuleCollection, RuleCollection, RuleDeclarationCollection, RunRuleCollection } from './types';
export * from './types';
export declare class Spectral {
private _rules;
private _functions;
private resolver;
constructor(opts?: IConstructorOpts);
run(target: IParsedResult | object | string): Promise<IRuleResult[]>;
readonly functions: FunctionCollection;
addFunctions(functions: FunctionCollection): void;
readonly rules: RunRuleCollection;
addRules(rules: RuleCollection): void;
mergeRules(rules: PartialRuleCollection): void;
applyRuleDeclarations(declarations: RuleDeclarationCollection): void;
}
export declare const isParsedResult: (obj: any) => obj is IParsedResult;