diff --git a/lib/markdownlint.d.ts b/lib/markdownlint.d.ts index 6ebe8575..24cca631 100644 --- a/lib/markdownlint.d.ts +++ b/lib/markdownlint.d.ts @@ -10,61 +10,6 @@ declare function markdownlint(options: Options | null, callback: LintCallback): declare namespace markdownlint { export { markdownlintSync as sync, readConfig, readConfigSync, getVersion, promises, RuleFunction, RuleParams, MarkdownParsers, ParserMarkdownIt, ParserMicromark, MarkdownItToken, MicromarkTokenType, MicromarkToken, RuleOnError, RuleOnErrorInfo, RuleOnErrorFixInfo, Rule, Options, Plugin, ToStringCallback, LintResults, LintError, FixInfo, LintContentCallback, LintCallback, Configuration, RuleConfiguration, ConfigurationParser, ReadConfigCallback, ResolveConfigExtendsCallback }; } -/** - * Configuration options. - */ -type Options = { - /** - * Configuration object. - */ - config?: Configuration; - /** - * Configuration parsers. - */ - configParsers?: ConfigurationParser[]; - /** - * Custom rules. - */ - customRules?: Rule[] | Rule; - /** - * Files to lint. - */ - files?: string[] | string; - /** - * Front matter pattern. - */ - frontMatter?: RegExp | null; - /** - * File system implementation. - */ - fs?: any; - /** - * True to catch exceptions. - */ - handleRuleFailures?: boolean; - /** - * Additional plugins. - */ - markdownItPlugins?: Plugin[]; - /** - * True to ignore HTML directives. - */ - noInlineConfig?: boolean; - /** - * Results object version. - */ - resultVersion?: number; - /** - * Strings to lint. - */ - strings?: { - [x: string]: string; - }; -}; -/** - * Called with the result of the lint function. - */ -type LintCallback = (error: Error | null, results?: LintResults) => void; /** * Lint specified Markdown files synchronously. * @@ -354,6 +299,57 @@ type Rule = { */ function: RuleFunction; }; +/** + * Configuration options. + */ +type Options = { + /** + * Configuration object. + */ + config?: Configuration; + /** + * Configuration parsers. + */ + configParsers?: ConfigurationParser[]; + /** + * Custom rules. + */ + customRules?: Rule[] | Rule; + /** + * Files to lint. + */ + files?: string[] | string; + /** + * Front matter pattern. + */ + frontMatter?: RegExp | null; + /** + * File system implementation. + */ + fs?: any; + /** + * True to catch exceptions. + */ + handleRuleFailures?: boolean; + /** + * Additional plugins. + */ + markdownItPlugins?: Plugin[]; + /** + * True to ignore HTML directives. + */ + noInlineConfig?: boolean; + /** + * Results object version. + */ + resultVersion?: number; + /** + * Strings to lint. + */ + strings?: { + [x: string]: string; + }; +}; /** * A markdown-it plugin. */ @@ -430,6 +426,10 @@ type FixInfo = { * Called with the result of linting a string or document. */ type LintContentCallback = (error: Error | null, result?: LintError[]) => void; +/** + * Called with the result of the lint function. + */ +type LintCallback = (error: Error | null, results?: LintResults) => void; /** * Configuration object for linting rules. For the JSON schema, see * {@link ../schema/markdownlint-config-schema.json}.