From 7a43ada13c4c4e5e5ed5eb1d5eaf64836e6d7cc2 Mon Sep 17 00:00:00 2001 From: Daniel Manning Date: Tue, 11 Jan 2022 07:51:54 +1100 Subject: [PATCH] Fix incorrect generic type parameter (#58082) The introduction of the `Document` type [in this PR](https://github.com/postcss/postcss/pull/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`. --- types/postcss-less/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/postcss-less/index.d.ts b/types/postcss-less/index.d.ts index 9bd62537fcf7ac2..892957186ad8ff9 100644 --- a/types/postcss-less/index.d.ts +++ b/types/postcss-less/index.d.ts @@ -10,7 +10,7 @@ import * as postcss from 'postcss'; export = postcssLess; declare const postcssLess: postcss.Syntax & { - parse: postcss.Parser; + parse: postcss.Parser; stringify: postcss.Stringifier; nodeToString: (node: postcss.Node) => string; };