@vknext/shared 1.3.7 → 1.4.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../utils/parseSvg.js";import{waitHTMLBody as e}from"../../../utils/waitHTMLBody.js";import{waitHTMLHead as t}from"../../../utils/waitHTMLHead.js";const o=(o,n,i={})=>{const{checkInterval:d=100,timeout:r=null,waitForPageLoad:s=!1,once:l=!1}=i;let a=!0,c=null,u=null,m=null;const w=()=>{a=!1,c&&c.disconnect(),u&&clearInterval(u),m&&clearTimeout(m)}
|
|
1
|
+
import"../../../utils/parseSvg.js";import{waitHTMLBody as e}from"../../../utils/waitHTMLBody.js";import{waitHTMLHead as t}from"../../../utils/waitHTMLHead.js";const o=(o,n,i={})=>{const{checkInterval:d=100,timeout:r=null,waitForPageLoad:s=!1,once:l=!1}=i;let a=!0,c=null,u=null,m=null;const w=()=>{a=!1,c&&c.disconnect(),u&&clearInterval(u),m&&clearTimeout(m)};let f;const v=()=>{if(!a)return;const e=window[o];void 0!==e&&e!==f&&(f=e,n(e),l&&w())},L=()=>{v(),a&&(c=new MutationObserver((e=>{if(a)for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)if(e.nodeType===Node.ELEMENT_NODE){const t=e;"SCRIPT"===t.tagName&&setTimeout(v,0);t.querySelectorAll("script").length>0&&setTimeout(v,0)}})),t().then((()=>{a&&c&&c.observe(document.head,{childList:!0,subtree:!0})})),e().then((()=>{a&&c&&c.observe(document.body,{childList:!0})})),u=window.setInterval(v,d),null!==r&&(m=window.setTimeout((()=>{w(),console.warn(`[watchGlobalProperty] Timeout waiting for variable: ${String(o)}`)}),r)))};if(s)if("complete"===document.readyState)L();else{const e=()=>{L(),window.removeEventListener("load",e)};window.addEventListener("load",e)}else if("loading"===document.readyState){const e=()=>{L(),document.removeEventListener("DOMContentLoaded",e)};document.addEventListener("DOMContentLoaded",e)}else L();return w};export{o as default};
|
package/dist/vkcom/types.d.ts
CHANGED
|
@@ -817,6 +817,9 @@ interface IVKApi {
|
|
|
817
817
|
params: Record<string, any>,
|
|
818
818
|
m?: {
|
|
819
819
|
grouping?: boolean;
|
|
820
|
+
accessToken?: string;
|
|
821
|
+
version?: string;
|
|
822
|
+
appId?: string;
|
|
820
823
|
},
|
|
821
824
|
signal?: {
|
|
822
825
|
signal?: AbortSignal;
|
|
@@ -837,10 +840,6 @@ interface IStories {
|
|
|
837
840
|
}
|
|
838
841
|
|
|
839
842
|
declare global {
|
|
840
|
-
/**
|
|
841
|
-
* !!! internal !!!
|
|
842
|
-
*/
|
|
843
|
-
var __callbacksGlobals: Map<any, Set<Callback<any>>> | undefined;
|
|
844
843
|
var Hls: typeof HlsJs | undefined;
|
|
845
844
|
var TopNotifier: ITopNotifier;
|
|
846
845
|
var Wall: IWall;
|