Skip to content

Commit 8654dfb

Browse files
🤖 Merge PR DefinitelyTyped#73304 feat(poool-engage): add filters on createElement by @maximedasilva
1 parent b00bfab commit 8654dfb

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎types/poool-engage/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export namespace Poool {
296296
*
297297
* More infos: https://www.poool.dev/docs/engage/javascript/methods#createelement
298298
*/
299-
createElement(slug: string, target: string | Element): Promise<EngageElement>;
299+
createElement(slug: string, target: string | Element, opts?: { filters?: string[] }): Promise<EngageElement>;
300300

301301
/**
302302
* Creates all elements matching multiple conditions like device, country, custom filters, etc.

‎types/poool-engage/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/poool-engage",
4-
"version": "2.1.9999",
4+
"version": "2.2.9999",
55
"nonNpm": true,
66
"nonNpmDescription": "poool-engage",
77
"projects": [

‎types/poool-engage/poool-engage-tests.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const engage = Engage.init("key-string");
4747
// $ExpectType Promise<EngageElement>
4848
engage.createElement("key", "value");
4949

50+
// $ExpectType Promise<EngageElement>
51+
Engage.createElement("key", "target", { filters: ["filter1", "filter2"] });
52+
5053
// $ExpectType Engage
5154
engage.config(
5255
{

0 commit comments

Comments
 (0)