@whitesev/pops 2.3.5 → 2.3.6
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/index.amd.js +26 -4
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +26 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +26 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +26 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +26 -4
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +26 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/PopsCore.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.system.js
CHANGED
|
@@ -185,9 +185,19 @@ System.register('pops', [], (function (exports) {
|
|
|
185
185
|
window: window,
|
|
186
186
|
globalThis: globalThis,
|
|
187
187
|
self: self,
|
|
188
|
+
setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
189
|
+
setInterval: globalThis.setInterval.bind(globalThis),
|
|
190
|
+
clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
191
|
+
clearInterval: globalThis.clearInterval.bind(globalThis),
|
|
188
192
|
};
|
|
189
193
|
const PopsCoreEnv = Object.assign({}, PopsCoreDefaultEnv);
|
|
190
194
|
const PopsCore = {
|
|
195
|
+
init(option) {
|
|
196
|
+
if (!option) {
|
|
197
|
+
option = Object.assign({}, PopsCoreDefaultEnv);
|
|
198
|
+
}
|
|
199
|
+
Object.assign(PopsCoreEnv, option);
|
|
200
|
+
},
|
|
191
201
|
get document() {
|
|
192
202
|
return PopsCoreEnv.document;
|
|
193
203
|
},
|
|
@@ -200,6 +210,18 @@ System.register('pops', [], (function (exports) {
|
|
|
200
210
|
get self() {
|
|
201
211
|
return PopsCoreEnv.self;
|
|
202
212
|
},
|
|
213
|
+
get setTimeout() {
|
|
214
|
+
return PopsCoreEnv.setTimeout;
|
|
215
|
+
},
|
|
216
|
+
get setInterval() {
|
|
217
|
+
return PopsCoreEnv.setInterval;
|
|
218
|
+
},
|
|
219
|
+
get clearTimeout() {
|
|
220
|
+
return PopsCoreEnv.clearTimeout;
|
|
221
|
+
},
|
|
222
|
+
get clearInterval() {
|
|
223
|
+
return PopsCoreEnv.clearInterval;
|
|
224
|
+
},
|
|
203
225
|
};
|
|
204
226
|
const OriginPrototype = {
|
|
205
227
|
Object: {
|
|
@@ -718,7 +740,7 @@ System.register('pops', [], (function (exports) {
|
|
|
718
740
|
return setTimeout$1(callback, timeout);
|
|
719
741
|
}
|
|
720
742
|
catch (error) {
|
|
721
|
-
return
|
|
743
|
+
return PopsCore.setTimeout(callback, timeout);
|
|
722
744
|
}
|
|
723
745
|
}
|
|
724
746
|
/**
|
|
@@ -733,7 +755,7 @@ System.register('pops', [], (function (exports) {
|
|
|
733
755
|
catch (error) {
|
|
734
756
|
}
|
|
735
757
|
finally {
|
|
736
|
-
|
|
758
|
+
PopsCore.clearTimeout(timeId);
|
|
737
759
|
}
|
|
738
760
|
}
|
|
739
761
|
/**
|
|
@@ -744,7 +766,7 @@ System.register('pops', [], (function (exports) {
|
|
|
744
766
|
return setInterval$1(callback, timeout);
|
|
745
767
|
}
|
|
746
768
|
catch (error) {
|
|
747
|
-
return
|
|
769
|
+
return PopsCore.setInterval(callback, timeout);
|
|
748
770
|
}
|
|
749
771
|
}
|
|
750
772
|
/**
|
|
@@ -759,7 +781,7 @@ System.register('pops', [], (function (exports) {
|
|
|
759
781
|
catch (error) {
|
|
760
782
|
}
|
|
761
783
|
finally {
|
|
762
|
-
|
|
784
|
+
PopsCore.clearInterval(timeId);
|
|
763
785
|
}
|
|
764
786
|
}
|
|
765
787
|
}
|