@smoud/playable-sdk 1.0.4 → 1.0.5

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/dist/esm/index.js CHANGED
@@ -1,600 +1,2 @@
1
- // src/events.ts
2
- var registeredEvents = {};
3
- function onEvent(event, fn, context, once) {
4
- let listeners = registeredEvents[event];
5
- if (!listeners) {
6
- listeners = registeredEvents[event] = {
7
- list: []
8
- };
9
- }
10
- listeners.list.push(fn, context || null, once || false);
11
- }
12
- function offEvent(event, fn, context) {
13
- const listeners = registeredEvents[event];
14
- if (!listeners) return;
15
- var fnArray = listeners.list;
16
- if (!fn) {
17
- fnArray.length = 0;
18
- } else {
19
- let i = fnArray.length;
20
- while (i > 0) {
21
- i -= 3;
22
- if (fnArray[i] == fn && (context !== void 0 || fnArray[i + 1] == context)) {
23
- fnArray.splice(i, 3);
24
- }
25
- }
26
- }
27
- if (fnArray.length == 0) {
28
- delete registeredEvents[event];
29
- }
30
- }
31
- function emitEvent(event, a1, a2, a3) {
32
- var listeners = registeredEvents[event];
33
- if (!listeners) return;
34
- const fnArray = listeners.list;
35
- const len = arguments.length;
36
- let fn, ctx;
37
- for (var i = 0; i < fnArray.length; i += 3) {
38
- fn = fnArray[i];
39
- ctx = fnArray[i + 1];
40
- if (fnArray[i + 2]) {
41
- fnArray.splice(i, 3);
42
- i -= 3;
43
- }
44
- if (len <= 1) fn.call(ctx);
45
- else if (len == 2) fn.call(ctx, a1);
46
- else if (len == 3) fn.call(ctx, a1, a2);
47
- else fn.call(ctx, a1, a2, a3);
48
- }
49
- if (fnArray.length == 0) {
50
- delete registeredEvents[event];
51
- }
52
- }
53
-
54
- // src/protocols.ts
55
- var uid = 0;
56
- var NONE = uid++;
57
- var MRAID = uid++;
58
- var DAPI = uid++;
59
- var NUCLEO = uid++;
60
- var FACEBOOK = uid++;
61
- var GOOGLE = uid++;
62
- var MINTEGRAL = uid++;
63
- var TAPJOY = uid++;
64
- var TIKTOK = uid++;
65
- var actualProtocol = NONE;
66
- function isMraid() {
67
- return actualProtocol === MRAID;
68
- }
69
- function isDapi() {
70
- return actualProtocol === DAPI;
71
- }
72
- function isNucleo() {
73
- return actualProtocol === NUCLEO;
74
- }
75
- function isFacebook() {
76
- return actualProtocol === FACEBOOK;
77
- }
78
- function isGoogle() {
79
- return actualProtocol === GOOGLE;
80
- }
81
- function isMintegral() {
82
- return actualProtocol === MINTEGRAL;
83
- }
84
- function isTapjoy() {
85
- return actualProtocol === TAPJOY;
86
- }
87
- function isTikTok() {
88
- return actualProtocol === TIKTOK;
89
- }
90
- function ensureProtocol() {
91
- if ("mraid" === AD_PROTOCOL) {
92
- try {
93
- mraid.getState();
94
- actualProtocol = MRAID;
95
- } catch (error) {
96
- }
97
- } else if ("dapi" === AD_PROTOCOL) {
98
- try {
99
- dapi.isReady();
100
- actualProtocol = DAPI;
101
- } catch (error) {
102
- }
103
- } else if ("facebook" === AD_NETWORK) {
104
- try {
105
- if (FbPlayableAd) actualProtocol = FACEBOOK;
106
- } catch (error) {
107
- }
108
- } else if ("google" === AD_NETWORK) {
109
- try {
110
- if (ExitApi) actualProtocol = GOOGLE;
111
- } catch (error) {
112
- }
113
- } else if ("mintegral" === AD_NETWORK) {
114
- if (window.gameReady) actualProtocol = MINTEGRAL;
115
- } else if ("tapjoy" === AD_NETWORK) {
116
- if (window.TJ_API) actualProtocol = TAPJOY;
117
- } else if ("tiktok" === AD_NETWORK) {
118
- if (window.openAppStore) actualProtocol = TIKTOK;
119
- }
120
- }
121
-
122
- // src/core.ts
123
- var destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
124
- var isSDKInitialized = false;
125
- var isProtocolInitialized = false;
126
- var isForcePaused = false;
127
- var isInstallClicked = false;
128
- var initCallback = () => {
129
- };
130
- function bootAd() {
131
- if (sdk.isReady) return;
132
- emitEvent("boot");
133
- document.body.oncontextmenu = function() {
134
- return false;
135
- };
136
- initCallback(sdk.maxWidth, sdk.maxHeight);
137
- emitEvent("ready");
138
- sdk.isReady = true;
139
- }
140
- function changeVolume(value) {
141
- emitEvent("volume", value);
142
- }
143
- function handlePause() {
144
- changeVolume(0);
145
- sdk.isPaused = true;
146
- emitEvent("pause");
147
- }
148
- function handleResume() {
149
- if (isForcePaused) return;
150
- changeVolume(sdk.volume);
151
- sdk.isPaused = false;
152
- emitEvent("resume");
153
- }
154
- function mraidIsViewable(viewable) {
155
- if ("mraid" !== AD_PROTOCOL) return;
156
- if (viewable) {
157
- if (sdk.isReady) {
158
- handleResume();
159
- } else {
160
- if (AD_NETWORK == "ironsource") {
161
- const maxSize = mraid.getMaxSize();
162
- sdk.maxWidth = Math.floor(maxSize.width);
163
- sdk.maxHeight = Math.floor(maxSize.height);
164
- }
165
- bootAd();
166
- }
167
- } else {
168
- handlePause();
169
- }
170
- }
171
- function dapiIsViewable(event) {
172
- if ("dapi" !== AD_PROTOCOL) return;
173
- if (event.isViewable) {
174
- if (sdk.isReady) {
175
- handleResume();
176
- } else {
177
- var screenSize = dapi.getScreenSize();
178
- screenSize.width = Math.floor(screenSize.width);
179
- screenSize.height = Math.floor(screenSize.height);
180
- bootAd();
181
- }
182
- } else {
183
- handlePause();
184
- }
185
- }
186
- function fireResizeEvent(width, height) {
187
- handleResize(width, height);
188
- }
189
- function startMraidProtocol() {
190
- if ("mraid" !== AD_PROTOCOL) return;
191
- if (!isProtocolInitialized) {
192
- mraid.removeEventListener("ready", startMraidProtocol);
193
- mraid.addEventListener("viewableChange", function() {
194
- var isViewable = mraid.isViewable();
195
- mraidIsViewable(isViewable);
196
- });
197
- if (mraid.isViewable() || AD_NETWORK == "adcolony") {
198
- mraidIsViewable(true);
199
- }
200
- mraid.addEventListener("audioVolumeChange", function(newVolume) {
201
- if (newVolume !== null) {
202
- if (newVolume > 0) {
203
- changeVolume(sdk.volume);
204
- } else {
205
- changeVolume(0);
206
- }
207
- }
208
- });
209
- mraid.addEventListener("error", function(t, e) {
210
- console.log("mraid error: " + t + " action: " + e);
211
- });
212
- mraid.addEventListener("sizeChange", function() {
213
- var maxSize = mraid.getMaxSize();
214
- fireResizeEvent(maxSize.width, maxSize.height);
215
- });
216
- isProtocolInitialized = true;
217
- }
218
- }
219
- function startDapiProtocol() {
220
- if ("dapi" !== AD_PROTOCOL) return;
221
- if (!isProtocolInitialized) {
222
- dapi.removeEventListener("ready", startDapiProtocol);
223
- dapi.getAudioVolume();
224
- dapi.addEventListener("audioVolumeChange", function(volume) {
225
- var isAudioEnabled = !!volume;
226
- if (isAudioEnabled) {
227
- changeVolume(sdk.volume);
228
- } else {
229
- changeVolume(0);
230
- }
231
- });
232
- dapi.addEventListener("adResized", function(event) {
233
- var maxSize = dapi.getScreenSize();
234
- fireResizeEvent(event.width || maxSize.width, event.height || maxSize.height);
235
- });
236
- if (dapi.isViewable()) {
237
- dapiIsViewable({ isViewable: true });
238
- }
239
- dapi.addEventListener("viewableChange", dapiIsViewable);
240
- isProtocolInitialized = true;
241
- }
242
- }
243
- function startDefaultProtocol() {
244
- if ("none" !== AD_PROTOCOL) return;
245
- if (!isProtocolInitialized) {
246
- if ("mintegral" === AD_NETWORK) {
247
- window.mintGameStart = function() {
248
- handleResume();
249
- handleResize(sdk.maxWidth, sdk.maxHeight);
250
- };
251
- window.mintGameClose = function() {
252
- handlePause();
253
- };
254
- }
255
- document.addEventListener("visibilitychange", () => {
256
- if (document.visibilityState === "visible") {
257
- handleResume();
258
- } else {
259
- handlePause();
260
- }
261
- });
262
- if (document.readyState === "complete") {
263
- bootAd();
264
- } else {
265
- window.addEventListener("load", () => {
266
- bootAd();
267
- });
268
- }
269
- window.addEventListener("resize", function() {
270
- handleResize();
271
- });
272
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
273
- var tapjoyApi = {
274
- skipAd: function() {
275
- try {
276
- sdk.finish();
277
- } catch (e) {
278
- console.warn("Could not skip ad! | " + e);
279
- }
280
- }
281
- };
282
- window.TJ_API.setPlayableAPI && window.TJ_API.setPlayableAPI(tapjoyApi);
283
- }
284
- isProtocolInitialized = true;
285
- }
286
- }
287
- function finishTapjoy() {
288
- window.TJ_API.objectiveComplete && window.TJ_API.objectiveComplete();
289
- window.TJ_API.playableFinished && window.TJ_API.playableFinished();
290
- window.TJ_API.gameplayFinished && window.TJ_API.gameplayFinished();
291
- }
292
- function handleResize(width, height) {
293
- sdk.maxWidth = Math.floor(width || window.innerWidth);
294
- sdk.maxHeight = Math.floor(height || window.innerHeight);
295
- sdk.isLandscape = sdk.maxWidth > sdk.maxHeight;
296
- emitEvent("resize", sdk.maxWidth, sdk.maxHeight);
297
- }
298
- var isListeningToTouchEvents = false;
299
- var isTouchEventRegistered = false;
300
- function onUserInteraction(event) {
301
- if (typeof TouchEvent !== "undefined" && event instanceof TouchEvent) {
302
- isListeningToTouchEvents = true;
303
- }
304
- if (isListeningToTouchEvents && event instanceof MouseEvent) return;
305
- sdk.interactions += 1;
306
- emitEvent("interaction", sdk.interactions);
307
- }
308
- function registerTouchHandlers() {
309
- if (!isTouchEventRegistered) {
310
- document.addEventListener("mousedown", onUserInteraction);
311
- document.addEventListener("touchstart", onUserInteraction);
312
- isTouchEventRegistered = true;
313
- }
314
- }
315
- var _sdk = class _sdk {
316
- /**
317
- * Initializes the SDK and sets up protocol-specific handlers.
318
- * This must be called as earlier as possible.
319
- *
320
- * @param callback Optional function called when ad container is ready
321
- * @example
322
- * // Basic initialization
323
- * sdk.init();
324
- *
325
- * // Initialization with callback
326
- * sdk.init((width, height) => {
327
- * new App(width, height)
328
- * });
329
- *
330
- * @fires init When initialization starts
331
- * @fires boot When the ad begins booting
332
- * @fires ready When Ad Network is ready and playable ad can be initialized
333
- */
334
- static init(callback) {
335
- if (isSDKInitialized) return;
336
- ensureProtocol();
337
- if (callback) initCallback = callback;
338
- if ("mraid" === AD_PROTOCOL && isMraid()) {
339
- if (mraid.getState() !== "ready" && "adcolony" !== AD_NETWORK) {
340
- mraid.addEventListener("ready", startMraidProtocol);
341
- } else {
342
- startMraidProtocol();
343
- }
344
- } else if ("dapi" === AD_PROTOCOL && isDapi()) {
345
- window.addEventListener("load", function() {
346
- dapi.isReady() ? startDapiProtocol() : dapi.addEventListener("ready", startDapiProtocol);
347
- });
348
- } else {
349
- startDefaultProtocol();
350
- }
351
- emitEvent("init");
352
- isSDKInitialized = true;
353
- }
354
- /**
355
- * Starts the playable ad experience.
356
- * Should be called after all resources are loaded and first frame is rendered.
357
- *
358
- * @example
359
- * // Call just after all resources are preloaded and first frame is rendered
360
- * sdk.start();
361
- *
362
- * @fires start When the playable ad starts
363
- * @fires resize When the ad container is initially sized
364
- */
365
- static start() {
366
- if (_sdk.isStarted) return;
367
- _sdk.isStarted = true;
368
- emitEvent("start");
369
- registerTouchHandlers();
370
- if ("mintegral" === AD_NETWORK && isMintegral()) {
371
- _sdk.resize();
372
- handlePause();
373
- window.gameReady && window.gameReady();
374
- } else {
375
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
376
- window.TJ_API.setPlayableBuild({
377
- orientation: this.isLandscape ? "landscape" : "portrait",
378
- buildID: BUILD_HASH
379
- });
380
- }
381
- _sdk.resize();
382
- }
383
- }
384
- /**
385
- * Marks the playable ad as finished.
386
- * This triggers network-specific completion handlers.
387
- *
388
- * @example
389
- * // Call when game/experience is complete
390
- * sdk.finish();
391
- *
392
- * @fires finish When the playable ad is marked as finished
393
- */
394
- static finish() {
395
- _sdk.isFinished = true;
396
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
397
- finishTapjoy();
398
- } else if ("mintegral" === AD_NETWORK && isMintegral()) {
399
- window.gameEnd && window.gameEnd();
400
- } else if ("vungle" === AD_NETWORK) {
401
- parent.postMessage("complete", "*");
402
- }
403
- emitEvent("finish");
404
- }
405
- /**
406
- * Triggers a retry/restart of the playable ad.
407
- * Behavior varies by ad network.
408
- *
409
- * @example
410
- * // Allow user to try again
411
- * retryButton.onclick = () => sdk.retry();
412
- *
413
- * @fires retry When a retry is triggered
414
- */
415
- static retry() {
416
- if ("mintegral" === AD_NETWORK && isMintegral()) {
417
- window.gameRetry && window.gameRetry();
418
- } else if ("nucleo" === AD_PROTOCOL && isNucleo()) {
419
- NUC.trigger.tryAgain();
420
- }
421
- emitEvent("retry");
422
- }
423
- /**
424
- * Triggers the install/download action for the advertised app.
425
- * Handles different store opening methods across ad networks.
426
- *
427
- * @example
428
- * // Call when user wants to install
429
- * installButton.onclick = () => sdk.install();
430
- *
431
- * @fires finish If the ad hasn't been marked as finished
432
- * @fires install When the install action is triggered
433
- */
434
- static install() {
435
- if (!_sdk.isFinished) {
436
- _sdk.isFinished = true;
437
- let timeout = 0;
438
- if ("tapjoy" === AD_NETWORK && isTapjoy()) {
439
- finishTapjoy();
440
- timeout = 300;
441
- }
442
- emitEvent("finish");
443
- setTimeout(function() {
444
- _sdk.install();
445
- }, timeout);
446
- return;
447
- }
448
- if (isInstallClicked) return;
449
- isInstallClicked = true;
450
- setTimeout(function() {
451
- isInstallClicked = false;
452
- }, 500);
453
- emitEvent("install");
454
- if ("mraid" === AD_PROTOCOL && isMraid()) {
455
- mraid.open(destinationUrl);
456
- } else if ("dapi" === AD_PROTOCOL && isDapi()) {
457
- dapi.openStoreUrl();
458
- } else if ("nucleo" === AD_PROTOCOL && isNucleo()) {
459
- NUC.trigger.convert(destinationUrl);
460
- } else if ("facebook" == AD_NETWORK && isFacebook()) {
461
- FbPlayableAd.onCTAClick();
462
- } else if ("vungle" == AD_NETWORK) {
463
- parent.postMessage("download", "*");
464
- } else if ("google" == AD_NETWORK && isGoogle()) {
465
- ExitApi.exit();
466
- } else if ("mintegral" === AD_NETWORK && isMintegral()) {
467
- window.install && window.install();
468
- } else if ("tapjoy" === AD_NETWORK && isTapjoy()) {
469
- window.TJ_API.click();
470
- } else if ("tiktok" === AD_NETWORK && isTikTok()) {
471
- window.openAppStore();
472
- } else {
473
- window.open(destinationUrl);
474
- }
475
- }
476
- /**
477
- * Trigger force resize event
478
- * Useful when container size changes need to be manually propagated.
479
- *
480
- * @example
481
- * sdk.resize();
482
- *
483
- * @fires resize With current maxWidth and maxHeight
484
- */
485
- static resize() {
486
- handleResize(_sdk.maxWidth, _sdk.maxHeight);
487
- }
488
- /**
489
- * Forces the playable ad into a paused state.
490
- *
491
- * @example
492
- * // Pause the experience
493
- * pauseButton.onclick = () => sdk.pause();
494
- *
495
- * @fires pause When the ad enters paused state
496
- */
497
- static pause() {
498
- if (!isForcePaused) {
499
- isForcePaused = true;
500
- handlePause();
501
- }
502
- }
503
- /**
504
- * Resumes the playable ad from a forced pause state.
505
- * Only works if the ad was paused via sdk.pause().
506
- *
507
- * @example
508
- * // Resume from pause
509
- * resumeButton.onclick = () => sdk.resume();
510
- *
511
- * @fires resume When the ad resumes from pause
512
- */
513
- static resume() {
514
- if (isForcePaused) {
515
- isForcePaused = false;
516
- handleResume();
517
- }
518
- }
519
- /**
520
- * Registers an event listener.
521
- *
522
- * @param event Name of the event to listen for
523
- * @param fn Callback function to execute when event occurs
524
- * @param context Optional 'this' context for the callback
525
- *
526
- * @example
527
- * // Listen for user interactions
528
- * sdk.on('interaction', (count) => {
529
- * console.log(`User interaction #${count}`);
530
- * });
531
- *
532
- * // Listen for resize with context
533
- * sdk.on('resize', function(width, height) {
534
- * this.updateLayout(width, height);
535
- * }, gameInstance);
536
- */
537
- static on(event, fn, context) {
538
- onEvent(event, fn, context);
539
- }
540
- /**
541
- * Registers a one-time event listener that removes itself after execution.
542
- *
543
- * @param event Name of the event to listen for
544
- * @param fn Callback function to execute when event occurs
545
- * @param context Optional 'this' context for the callback
546
- *
547
- * @example
548
- * // Listen for first interaction only
549
- * sdk.once('interaction', () => {
550
- * console.log('First user interaction occurred!');
551
- * });
552
- */
553
- static once(event, fn, context) {
554
- onEvent(event, fn, context, true);
555
- }
556
- /**
557
- * Removes an event listener.
558
- *
559
- * @param event Name of the event to stop listening for
560
- * @param fn Optional callback function to remove (if not provided, removes all listeners for the event)
561
- * @param context Optional 'this' context to match when removing
562
- *
563
- * @example
564
- * // Remove specific listener
565
- * const handler = () => console.log('Interaction');
566
- * sdk.off('interaction', handler);
567
- *
568
- * // Remove all listeners for an event
569
- * sdk.off('interaction');
570
- */
571
- static off(event, fn, context) {
572
- offEvent(event, fn, context);
573
- }
574
- };
575
- /** Current version of the SDK */
576
- _sdk.version = "1.0.1";
577
- /** Current maximum width of the playable ad container in pixels */
578
- _sdk.maxWidth = Math.floor(window.innerWidth);
579
- /** Current maximum height of the playable ad container in pixels */
580
- _sdk.maxHeight = Math.floor(window.innerHeight);
581
- /** Indicates if the current orientation is landscape (width > height) */
582
- _sdk.isLandscape = window.innerWidth > window.innerHeight;
583
- /** Indicates if the Ad Network is ready and playable ad can be initialized */
584
- _sdk.isReady = false;
585
- /** Indicates if all playable ad resources are loaded and gameplay has started */
586
- _sdk.isStarted = false;
587
- /** Indicates if the playable ad is currently paused */
588
- _sdk.isPaused = false;
589
- /** Indicates if the playable ad has finished */
590
- _sdk.isFinished = false;
591
- /** Current volume level (0-1) */
592
- _sdk.volume = 1;
593
- /** Number of user interactions with the playable ad */
594
- _sdk.interactions = 0;
595
- var sdk = _sdk;
596
- window.PlayableSDK = sdk;
597
- export {
598
- sdk as default,
599
- sdk
600
- };
1
+ export { sdk as default } from './core';
2
+ export { sdk } from './core';
@@ -0,0 +1,9 @@
1
+ export declare function isMraid(): boolean;
2
+ export declare function isDapi(): boolean;
3
+ export declare function isNucleo(): boolean;
4
+ export declare function isFacebook(): boolean;
5
+ export declare function isGoogle(): boolean;
6
+ export declare function isMintegral(): boolean;
7
+ export declare function isTapjoy(): boolean;
8
+ export declare function isTikTok(): boolean;
9
+ export declare function ensureProtocol(): void;
@@ -0,0 +1,77 @@
1
+ let uid = 0;
2
+ const NONE = uid++;
3
+ const MRAID = uid++;
4
+ const DAPI = uid++;
5
+ const NUCLEO = uid++;
6
+ const FACEBOOK = uid++;
7
+ const GOOGLE = uid++;
8
+ const MINTEGRAL = uid++;
9
+ const TAPJOY = uid++;
10
+ const TIKTOK = uid++;
11
+ let actualProtocol = NONE;
12
+ export function isMraid() {
13
+ return actualProtocol === MRAID;
14
+ }
15
+ export function isDapi() {
16
+ return actualProtocol === DAPI;
17
+ }
18
+ export function isNucleo() {
19
+ return actualProtocol === NUCLEO;
20
+ }
21
+ export function isFacebook() {
22
+ return actualProtocol === FACEBOOK;
23
+ }
24
+ export function isGoogle() {
25
+ return actualProtocol === GOOGLE;
26
+ }
27
+ export function isMintegral() {
28
+ return actualProtocol === MINTEGRAL;
29
+ }
30
+ export function isTapjoy() {
31
+ return actualProtocol === TAPJOY;
32
+ }
33
+ export function isTikTok() {
34
+ return actualProtocol === TIKTOK;
35
+ }
36
+ export function ensureProtocol() {
37
+ if ('mraid' === AD_PROTOCOL) {
38
+ try {
39
+ mraid.getState();
40
+ actualProtocol = MRAID;
41
+ }
42
+ catch (error) { }
43
+ }
44
+ else if ('dapi' === AD_PROTOCOL) {
45
+ try {
46
+ dapi.isReady();
47
+ actualProtocol = DAPI;
48
+ }
49
+ catch (error) { }
50
+ }
51
+ else if ('facebook' === AD_NETWORK) {
52
+ try {
53
+ if (FbPlayableAd)
54
+ actualProtocol = FACEBOOK;
55
+ }
56
+ catch (error) { }
57
+ }
58
+ else if ('google' === AD_NETWORK) {
59
+ try {
60
+ if (ExitApi)
61
+ actualProtocol = GOOGLE;
62
+ }
63
+ catch (error) { }
64
+ }
65
+ else if ('mintegral' === AD_NETWORK) {
66
+ if (window.gameReady)
67
+ actualProtocol = MINTEGRAL;
68
+ }
69
+ else if ('tapjoy' === AD_NETWORK) {
70
+ if (window.TJ_API)
71
+ actualProtocol = TAPJOY;
72
+ }
73
+ else if ('tiktok' === AD_NETWORK) {
74
+ if (window.openAppStore)
75
+ actualProtocol = TIKTOK;
76
+ }
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoud/playable-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "It's unified Playable SDK that supports MRAID, Google, Facebook, Vungle, and many more Ad Networks, simplifying playable ad development with a standardized interface for seamless cross-network compatibility.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -16,7 +16,7 @@
16
16
  "defines.d.ts"
17
17
  ],
18
18
  "scripts": {
19
- "build": "npx tsup src/index.ts --format esm,cjs,iife --out-dir dist --legacy-output --clean && npx tsup src/index.ts --dts-only --out-dir dist/esm",
19
+ "build": "npx tsup src/index.ts --format esm,cjs,iife --out-dir dist --legacy-output --clean && tsc",
20
20
  "test": "jest",
21
21
  "deploy": "npm run test && npm run build && npm publish --access public"
22
22
  },