Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
07e67c8
fix(poool-access): fix audit sendEvent return Type
maximedasilva Jan 17, 2024
c97e51b
Merge branch 'DefinitelyTyped:master' into master
maximedasilva Mar 7, 2024
9b97556
feat(poool-access): add externalLinkClick and add Access/Audit to glo…
maximedasilva Mar 7, 2024
d5a8d69
feat(poool-access): format files
maximedasilva Mar 7, 2024
67450af
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Mar 7, 2024
9887a79
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Jun 26, 2024
75873b8
feat(poool-engage): add poool engage types
maximedasilva Jun 26, 2024
57151f7
feat(poool-engage): rename namespace
maximedasilva Jun 26, 2024
7bf2c36
Merge branch 'DefinitelyTyped:master' into master
maximedasilva Jun 26, 2024
9d4dab5
fix(poool-engage): remove useless deepency
maximedasilva Jun 26, 2024
100702c
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Jun 26, 2024
26c17db
feat(poool-engage): add type tests
maximedasilva Jun 27, 2024
a98792a
Merge branch 'DefinitelyTyped:master' into master
maximedasilva Jun 27, 2024
fdf92e3
feat(poool-engage): add type tests
maximedasilva Jun 27, 2024
6d36071
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Jun 27, 2024
3ed06b5
feat(poool-engage): fix wordings
maximedasilva Jun 27, 2024
745b543
feat(poool-engage): format files
maximedasilva Jun 27, 2024
1c9169e
Merge branch 'DefinitelyTyped:master' into master
maximedasilva Jul 8, 2024
3b155a2
feat(poool-engage): rename namespace and add a diplay condition value
maximedasilva Jul 8, 2024
f31e140
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Jul 16, 2024
b686642
Merge branch 'master' of https://github.com/p3ol/DefinitelyTyped
maximedasilva Jul 16, 2024
ba9c9a8
feat(poool-access): add isPoool on both access and engage elements, a…
maximedasilva Jul 16, 2024
610be63
feat(poool-engage): add isPoool for engage element, events names and …
maximedasilva Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions types/poool-access/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,25 +641,45 @@ export namespace Poool {

type EventsList =
| "identityAvailable"
| "onIdentityAvailable"
| "lock"
| "onLock"
| "ready"
| "onReady"
| "paywallSeen"
| "onPaywallSeen"
| "release"
| "onRelease"
| "register"
| "onRegister"
| "subscribeClick"
| "onSubscribeClick"
| "loginClick"
| "onLoginClick"
| "discoveryLinkClick"
| "onDiscoveryLinkClick"
| "alternativeClick"
| "onAlternativeClick"
| "error"
| "onError"
| "outdatedBrowser"
| "onOutdatedBrowser"
| "dataPolicyClick"
| "onDataPolicyClick"
| "formSubmit"
| "onFormSubmit"
| "facebookLoginClick"
| "onFacebookLoginClick"
| "googleLoginClick"
| "onGoogleLoginClick"
| "answer"
| "onAnswer"
| "consent"
| "onConsent"
| "customButtonClick"
| "externalLinkClick";
| "onCustomButtonClick"
| "externalLinkClick"
| "onExternalLinkClick";

interface AccessConfig {
/**
Expand Down Expand Up @@ -809,7 +829,7 @@ export namespace Poool {
*
* More infos: https://poool.dev/docs/access/javascript/audit/configuration
*/
context?: string;
context?: string | string[];
/**
* Used to allocate a reader to a custom group previously created in Poool's Dashboard.
*
Expand Down Expand Up @@ -975,7 +995,7 @@ export namespace Poool {
createPaywall(config: {
target?: string | HTMLElement;
content?: string | HTMLElement;
pageType?: "premium" | "free";
pageType?: "premium" | "free" | "page";
mode?: "hide" | "excerpt" | "custom";
percent?: number;
}): AccessFactory;
Expand Down Expand Up @@ -1023,6 +1043,10 @@ export namespace Poool {
}

interface Audit {
/**
* Whether the Element is a Poool instance, or not
*/
isPoool: boolean;
/**
* Initializes Audit using your app ID.
*
Expand Down Expand Up @@ -1095,6 +1119,10 @@ export namespace Poool {
}

interface Access {
/**
* Whether the Element is a Poool instance, or not
*/
isPoool: boolean;
/**
* Creates a new Access instance (required to display paywalls) using your app ID.
*
Expand Down
2 changes: 1 addition & 1 deletion types/poool-access/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/poool-access",
"version": "5.17.9999",
"version": "5.18.9999",
"nonNpm": true,
"nonNpmDescription": "poool-access",
"projects": [
Expand Down
54 changes: 54 additions & 0 deletions types/poool-access/poool-access-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,39 @@
// $ExpectType Access
window.Access;

// $ExpectType boolean
window.Access.isPoool;

// $ExpectType Access
globalThis.Access;

// $ExpectType boolean
globalThis.Access.isPoool;

// $ExpectType Access
Access;

// $ExpectType boolean
Access.isPoool;

// $ExpectType Access
window.PooolAccess;

// $ExpectType boolean
window.Access.isPoool;

// $ExpectType boolean
window.PooolAccess.isPoool;

// $ExpectType Access
globalThis.PooolAccess;

// $ExpectType boolean
globalThis.Access.isPoool;

// $ExpectType boolean
globalThis.PooolAccess.isPoool;

// $ExpectType Access
PooolAccess;

Expand All @@ -35,6 +56,15 @@ access.createPaywall({
percent: 80,
});

// $ExpectType AccessFactory
access.createPaywall({
target: "target",
content: "content",
mode: "hide",
pageType: "page",
percent: 80,
});

// $ExpectType AccessFactory
access.config(
{
Expand Down Expand Up @@ -109,6 +139,9 @@ access.variables({
// $ExpectType AccessFactory
access.on("subscribeClick", () => {});

// $ExpectType AccessFactory
access.on("onSubscribeClick", () => {});

// $ExpectType AccessFactory
access.once("subscribeClick", () => {});

Expand All @@ -122,21 +155,39 @@ access.destroy();
// $ExpectType Audit
window.Audit;

// $ExpectType boolean
window.Audit.isPoool;

// $ExpectType Audit
globalThis.Audit;

// $ExpectType boolean
globalThis.Audit.isPoool;

// $ExpectType Audit
Audit;

// $ExpectType boolean
Audit.isPoool;

// $ExpectType Audit
window.PooolAudit;

// $ExpectType boolean
window.PooolAudit.isPoool;

// $ExpectType Audit
globalThis.PooolAudit;

// $ExpectType boolean
globalThis.PooolAudit.isPoool;

// $ExpectType Audit
PooolAudit;

// $ExpectType boolean
PooolAudit.isPoool;

// $ExpectType Audit
Audit.noConflict();

Expand All @@ -153,6 +204,9 @@ audit.config(
true,
);

// $ExpectType Audit
audit.config({ context: ["context-1", "context-2"] });

// $ExpectType Promise<boolean>
audit.sendEvent("page-view", { type: "premium" }, { key: "value" });

Expand Down
15 changes: 13 additions & 2 deletions types/poool-engage/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,17 @@ export namespace Poool {

type EngageEventsList =
| "ready"
| "onReady"
| "seen"
| "onSeen"
| "click"
| "onClick"
| "formSubmit"
| "onFormSubmit"
| "destroy"
| "error";
| "onDestroy"
| "error"
| "onError";

type EngageTextsType =
| "form_optional"
Expand Down Expand Up @@ -214,6 +220,11 @@ export namespace Poool {
}

interface Engage {
/**
* Whether the Element is a Poool instance, or not
*/
isPoool: boolean;

/**
* Creates a new Engage instance (required to display Engage elements) using your app ID.
*
Expand Down Expand Up @@ -265,7 +276,7 @@ export namespace Poool {
*
* More infos: https://www.poool.dev/docs/engage/javascript/methods#on
*/
on(event: EngageEventsList, callback: (...props: any) => any): Engage;
on(event: EngageEventsList, callback: (...props: any) => any, opts?: { once?: boolean }): Engage;

/**
* @param event the event name
Expand Down
63 changes: 61 additions & 2 deletions types/poool-engage/poool-engage-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,39 @@ import { Poool } from "poool-engage";
// $ExpectType Engage
Engage;

// $ExpectType boolean
Engage.isPoool;

// $ExpectType Engage
window.Engage;

// $ExpectType boolean
window.Engage.isPoool;

// $ExpectType Engage
globalThis.Engage;

// $ExpectType boolean
globalThis.Engage.isPoool;

// $ExpectType Engage
PooolEngage;

// $ExpectType boolean
PooolEngage.isPoool;

// $ExpectType Engage
window.PooolEngage;

// $ExpectType boolean
window.PooolEngage.isPoool;

// $ExpectType Engage
globalThis.PooolEngage;

// $ExpectType boolean
globalThis.PooolEngage.isPoool;

// $ExpectType Engage
Engage.noConflict();

Expand Down Expand Up @@ -88,10 +112,10 @@ engage.variables({
});

// $ExpectType Engage
engage.on("click", () => {});
engage.on("click", () => {}, { once: false });

// $ExpectType Engage
engage.on("destroy", () => {});
engage.on("destroy", () => {}, { once: true });

// $ExpectType Engage
engage.on("error", () => {});
Expand Down Expand Up @@ -122,6 +146,41 @@ engage.off("ready", () => {});

// $ExpectType Engage
engage.off("seen", () => {});
// $ExpectType Engage
engage.on("onClick", () => {});

// $ExpectType Engage
engage.on("onDestroy", () => {});

// $ExpectType Engage
engage.on("onError", () => {});

// $ExpectType Engage
engage.on("onFormSubmit", () => {});

// $ExpectType Engage
engage.on("onReady", () => {});

// $ExpectType Engage
engage.on("onSeen", () => {});

// $ExpectType Engage
engage.off("onClick", () => {});

// $ExpectType Engage
engage.off("onDestroy", () => {});

// $ExpectType Engage
engage.off("onError", () => {});

// $ExpectType Engage
engage.off("onFormSubmit", () => {});

// $ExpectType Engage
engage.off("onReady", () => {});

// $ExpectType Engage
engage.off("onSeen", () => {});

const element = Engage.createElement("key", "value");

Expand Down