@knapsack/types 4.69.9--canary.4739.3a8c6f1.0 → 4.69.9--canary.4768.997c53b.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -1648,81 +1648,13 @@ var rendererIds = {
1648
1648
  angular: "angular",
1649
1649
  html: "html"
1650
1650
  };
1651
- function isKsJsImports(imports) {
1652
- if (!Array.isArray(imports)) return false;
1653
- if (imports.length === 0) return true;
1654
- const [anImport] = imports;
1655
- if (anImport.type === "pattern-template" && typeof anImport.patternId !== "string")
1656
- return false;
1657
- if (anImport.type === "pattern-template-demo" && typeof anImport.patternId !== "string")
1658
- return false;
1659
- if (anImport.type === "pattern-template-demo" && typeof anImport.templateId !== "string")
1660
- return false;
1661
- if (anImport.type === "pattern-template-demo" && typeof anImport.demoId !== "string")
1662
- return false;
1663
- if (anImport.type === "extra" && typeof anImport.importInfo !== "object")
1664
- return false;
1665
- if (anImport.type === "extra" && typeof anImport.importInfo.type !== "string")
1666
- return false;
1667
- if (anImport.type === "extra" && typeof anImport.importInfo.name !== "string")
1668
- return false;
1669
- if (anImport.type === "extra" && typeof anImport.importInfo.path !== "string")
1670
- return false;
1671
- if (anImport.type === "extra" && typeof anImport.importInfo.names !== "undefined") {
1672
- if (!Array.isArray(anImport.importInfo.names)) return false;
1673
- if (anImport.importInfo.names.some((name) => typeof name !== "string"))
1674
- return false;
1675
- }
1676
- return true;
1677
- }
1678
- __name(isKsJsImports, "isKsJsImports");
1679
- function isKsRendererClientGlobalImportedModules(mods) {
1680
- if (!isObject(mods)) return false;
1681
- for (const key in mods) {
1682
- if (typeof mods[key] !== "function") return false;
1683
- }
1684
- return true;
1685
- }
1686
- __name(isKsRendererClientGlobalImportedModules, "isKsRendererClientGlobalImportedModules");
1687
- function isKsRendererClientGlobal(knapsack) {
1688
- if (!isObject(knapsack)) return false;
1689
- if (knapsack.typeName !== "KsRendererClientGlobal") return false;
1690
- if (typeof knapsack.getImport !== "function") return false;
1691
- if (!Array.isArray(knapsack.allAvailableImports)) return false;
1692
- if (!isKsRendererClientGlobalImportedModules(knapsack.importedModules)) {
1693
- return false;
1694
- }
1695
- return isKsJsImports(knapsack.allAvailableImports);
1696
- }
1697
- __name(isKsRendererClientGlobal, "isKsRendererClientGlobal");
1698
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
1699
- function getKsRendererClientGlobal() {
1700
- if (!isBrowser) {
1701
- throw new Error(
1702
- "Cannot get KsRendererClientGlobal in a non-browser environment"
1703
- );
1704
- }
1705
- const { knapsack } = window;
1706
- if (!knapsack) {
1707
- throw new Error(
1708
- 'Cannot get KsRendererClientGlobal: "knapsack" is not defined on the window'
1709
- );
1710
- }
1711
- if (!isKsRendererClientGlobal(knapsack)) {
1712
- console.log(`Object found at "window.knapsack":`, knapsack);
1713
- throw new Error(
1714
- `Cannot get KsRendererClientGlobal: knapsack is not the correct type`
1715
- );
1716
- }
1717
- return knapsack;
1718
- }
1719
- __name(getKsRendererClientGlobal, "getKsRendererClientGlobal");
1720
1651
 
1721
1652
  // src/renderer-client-types.ts
1722
1653
  var KsRendererClientEvents = /* @__PURE__ */ ((KsRendererClientEvents2) => {
1723
1654
  KsRendererClientEvents2["ready"] = "ready";
1724
1655
  return KsRendererClientEvents2;
1725
1656
  })(KsRendererClientEvents || {});
1657
+ var ksRendererClientMetaId = "ks-meta";
1726
1658
 
1727
1659
  // src/web-sockets.ts
1728
1660
  var WS_EVENTS = {
@@ -1854,7 +1786,6 @@ export {
1854
1786
  WS_EVENTS,
1855
1787
  assertTokenData,
1856
1788
  customizableNavElements,
1857
- getKsRendererClientGlobal,
1858
1789
  getPrimitiveValue,
1859
1790
  hasTokenReferences,
1860
1791
  isArrayOfObjectsProp,
@@ -1868,13 +1799,10 @@ export {
1868
1799
  isKsAppClientDataAndMetaV3,
1869
1800
  isKsAppClientDataNoMeta,
1870
1801
  isKsAppClientDataNoMetaV3,
1871
- isKsJsImports,
1872
1802
  isKsMetaState,
1873
1803
  isKsMetaStateV3,
1874
1804
  isKsRemoteChange,
1875
1805
  isKsRemoteChanges,
1876
- isKsRendererClientGlobal,
1877
- isKsRendererClientGlobalImportedModules,
1878
1806
  isNotTokenReference,
1879
1807
  isNumberProp,
1880
1808
  isObjKey,
@@ -1905,6 +1833,7 @@ export {
1905
1833
  isTokenValueFontWeight,
1906
1834
  isTokenValueShadow,
1907
1835
  isTokenValueTransition,
1836
+ ksRendererClientMetaId,
1908
1837
  migrations,
1909
1838
  pageElements,
1910
1839
  pageElementsV2,