Skip to content

Commit

Permalink
Fix incorrect generic type parameter (DefinitelyTyped#58082)
Browse files Browse the repository at this point in the history
The introduction of the `Document` type [in this PR](postcss/postcss#1582) incorrectly advertises that `parse` can return a `Document` object, because the [`Parser` interface is now generic](https://github.com/postcss/postcss/pull/1582/files#diff-68ba6abc949516587990ca61016794e81039fd6ae58437d5cfaccd4eeebdac07R224).

This PR exposes the parser as a more specific type of `Parser` so that consumers aren't given a `Root | Document`, but just a `Root`.
  • Loading branch information
dmisdm authored and Martin Badin committed Feb 23, 2022
1 parent 7dfcff8 commit 7a43ada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/postcss-less/index.d.ts
Expand Up @@ -10,7 +10,7 @@ import * as postcss from 'postcss';
export = postcssLess;

declare const postcssLess: postcss.Syntax & {
parse: postcss.Parser;
parse: postcss.Parser<postcss.Root>;
stringify: postcss.Stringifier;
nodeToString: (node: postcss.Node) => string;
};
Expand Down

0 comments on commit 7a43ada

Please sign in to comment.