@jitsu/js 1.9.18-canary.1269.20250403142744 → 1.9.18-canary.1288.20250415191203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +67 -0
- package/.turbo/turbo-clean.log +5 -0
- package/.turbo/turbo-test.log +2884 -0
- package/__tests__/node/method-queue.test.ts +66 -0
- package/__tests__/node/nodejs.test.ts +306 -0
- package/__tests__/playwright/cases/anonymous-id-bug.html +26 -0
- package/__tests__/playwright/cases/basic.html +32 -0
- package/__tests__/playwright/cases/callbacks.html +21 -0
- package/__tests__/playwright/cases/cookie-names.html +22 -0
- package/__tests__/playwright/cases/disable-user-ids.html +23 -0
- package/__tests__/playwright/cases/dont-send.html +22 -0
- package/__tests__/playwright/cases/ip-policy.html +22 -0
- package/__tests__/playwright/cases/reset.html +32 -0
- package/__tests__/playwright/cases/segment-reference.html +64 -0
- package/__tests__/playwright/cases/url-bug.html +20 -0
- package/__tests__/playwright/integration.test.ts +640 -0
- package/__tests__/simple-syrup.ts +136 -0
- package/dist/jitsu.cjs.js +4 -8
- package/dist/jitsu.es.js +4 -8
- package/dist/web/p.js.txt +4 -8
- package/jest.config.js +13 -0
- package/package/README.md +9 -0
- package/package/dist/analytics-plugin.d.ts +28 -0
- package/package/dist/browser.d.ts +10 -0
- package/package/dist/index.d.ts +28 -0
- package/package/dist/jitsu.cjs.js +2100 -0
- package/package/dist/jitsu.d.ts +78 -0
- package/package/dist/jitsu.es.js +2090 -0
- package/package/dist/method-queue.d.ts +19 -0
- package/package/dist/script-loader.d.ts +8 -0
- package/package/dist/tlds.d.ts +3 -0
- package/package/dist/version.d.ts +3 -0
- package/package/dist/web/p.js.txt +2219 -0
- package/package/package.json +56 -0
- package/package.json +3 -9
- package/playwrite.config.ts +91 -0
- package/rollup.config.js +32 -0
- package/src/analytics-plugin.ts +989 -0
- package/src/browser.ts +163 -0
- package/src/destination-plugins/ga4.ts +138 -0
- package/src/destination-plugins/gtm.ts +142 -0
- package/src/destination-plugins/index.ts +61 -0
- package/src/destination-plugins/logrocket.ts +85 -0
- package/src/destination-plugins/tag.ts +85 -0
- package/src/index.ts +255 -0
- package/src/method-queue.ts +70 -0
- package/src/script-loader.ts +76 -0
- package/src/tlds.ts +27 -0
- package/src/version.ts +6 -0
- package/tsconfig.json +23 -0
- package/tsconfig.test.json +15 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type InterfaceWrapper<T> = {
|
|
2
|
+
get(): WithAsyncMethods<T>;
|
|
3
|
+
loaded(instance: T): any;
|
|
4
|
+
};
|
|
5
|
+
type WithAsyncMethods<T> = {
|
|
6
|
+
[K in keyof T]: T[K] extends (...args: infer A) => infer R
|
|
7
|
+
? (...args: A) => R extends Promise<any> ? R : Promise<R>
|
|
8
|
+
: T[K];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* This function creates a wrapper around an interface that allows to call methods on it, but all methods will go to queue. Once actual instance
|
|
12
|
+
* implementation becomes available, all queued methods will be called on it.
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* @param methods of methods that should be wrapped. Per each method of you should specify if it should be wrapped. You'll need to mark all
|
|
16
|
+
* methods for type safety. If method is not wrapped, it will throw an error when called.
|
|
17
|
+
*/
|
|
18
|
+
export declare function delayMethodExec<T>(methods: Record<keyof T, boolean>): InterfaceWrapper<T>;
|
|
19
|
+
export {};
|