Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#67882 postcss-url CustomTransformFunction …
Browse files Browse the repository at this point in the history
…can be async by @philikon

Co-authored-by: Philipp Weitershausen <[email protected]>
  • Loading branch information
philikon and Philipp Weitershausen authored Dec 13, 2023
1 parent 7a7dd92 commit 6c0f45d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/postcss-url/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ declare namespace url {
*/
file?: string | undefined;
},
) => string;
) => string | Promise<string>;
type CustomHashFunction = (file: Buffer) => string;
type CustomFilterFunction = (file: string) => boolean;

Expand Down
4 changes: 4 additions & 0 deletions types/postcss-url/postcss-url-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ postcss().use(
{ filter: "cdn/**/*", url: asset => `https://cdn.url/${asset.url}` },
]),
);

postcss().use(url({ url: (asset) => asset.url }));

postcss().use(url({ url: async (asset) => asset.url }));

0 comments on commit 6c0f45d

Please sign in to comment.