@sanity/cli 6.0.0-alpha.9 → 6.1.0

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.
Files changed (613) hide show
  1. package/README.md +602 -291
  2. package/bin/run.js +2 -0
  3. package/dist/SanityHelp.js +51 -23
  4. package/dist/SanityHelp.js.map +1 -1
  5. package/dist/actions/auth/authServer.js +28 -22
  6. package/dist/actions/auth/authServer.js.map +1 -1
  7. package/dist/actions/auth/login/getProvider.js +49 -38
  8. package/dist/actions/auth/login/getProvider.js.map +1 -1
  9. package/dist/actions/auth/login/getSSOProvider.js +25 -19
  10. package/dist/actions/auth/login/getSSOProvider.js.map +1 -1
  11. package/dist/actions/auth/login/login.js +12 -33
  12. package/dist/actions/auth/login/login.js.map +1 -1
  13. package/dist/actions/auth/types.js.map +1 -1
  14. package/dist/actions/backup/downloadAsset.js +9 -9
  15. package/dist/actions/backup/downloadAsset.js.map +1 -1
  16. package/dist/actions/backup/downloadDocument.js +8 -8
  17. package/dist/actions/backup/downloadDocument.js.map +1 -1
  18. package/dist/actions/build/buildApp.js +55 -18
  19. package/dist/actions/build/buildApp.js.map +1 -1
  20. package/dist/actions/build/buildStaticFiles.js +3 -2
  21. package/dist/actions/build/buildStaticFiles.js.map +1 -1
  22. package/dist/actions/build/buildStudio.js +72 -44
  23. package/dist/actions/build/buildStudio.js.map +1 -1
  24. package/dist/actions/build/buildVendorDependencies.js +18 -52
  25. package/dist/actions/build/buildVendorDependencies.js.map +1 -1
  26. package/dist/actions/build/checkRequiredDependencies.js +13 -8
  27. package/dist/actions/build/checkRequiredDependencies.js.map +1 -1
  28. package/dist/actions/build/checkStudioDependencyVersions.js +19 -17
  29. package/dist/actions/build/checkStudioDependencyVersions.js.map +1 -1
  30. package/dist/actions/build/createExternalFromImportMap.js +1 -1
  31. package/dist/actions/build/createExternalFromImportMap.js.map +1 -1
  32. package/dist/actions/build/determineBasePath.js +5 -2
  33. package/dist/actions/build/determineBasePath.js.map +1 -1
  34. package/dist/actions/build/getViteConfig.js +47 -4
  35. package/dist/actions/build/getViteConfig.js.map +1 -1
  36. package/dist/actions/build/handlePrereleaseVersions.js +44 -0
  37. package/dist/actions/build/handlePrereleaseVersions.js.map +1 -0
  38. package/dist/actions/build/renderDocument.js +6 -10
  39. package/dist/actions/build/renderDocument.js.map +1 -1
  40. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js +4 -4
  41. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js.map +1 -1
  42. package/dist/actions/build/renderDocumentWorker/components/DefaultDocument.js +3 -3
  43. package/dist/actions/build/renderDocumentWorker/components/DefaultDocument.js.map +1 -1
  44. package/dist/actions/build/renderDocumentWorker/components/GlobalErrorHandler.js +1 -0
  45. package/dist/actions/build/renderDocumentWorker/components/GlobalErrorHandler.js.map +1 -1
  46. package/dist/actions/build/renderDocumentWorker/getDocumentComponent.js +2 -2
  47. package/dist/actions/build/renderDocumentWorker/getDocumentComponent.js.map +1 -1
  48. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js +1 -1
  49. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js.map +1 -1
  50. package/dist/actions/build/shouldAutoUpdate.js +2 -0
  51. package/dist/actions/build/shouldAutoUpdate.js.map +1 -1
  52. package/dist/actions/build/types.js.map +1 -1
  53. package/dist/actions/build/writeFavicons.js +3 -5
  54. package/dist/actions/build/writeFavicons.js.map +1 -1
  55. package/dist/actions/build/writeSanityRuntime.js +4 -3
  56. package/dist/actions/build/writeSanityRuntime.js.map +1 -1
  57. package/dist/actions/codemods/reactIconsV3.js +2 -2
  58. package/dist/actions/codemods/reactIconsV3.js.map +1 -1
  59. package/dist/actions/dataset/create.js +7 -1
  60. package/dist/actions/dataset/create.js.map +1 -1
  61. package/dist/actions/dataset/determineDatasetAclMode.js.map +1 -1
  62. package/dist/actions/dataset/resolveDataset.js +26 -0
  63. package/dist/actions/dataset/resolveDataset.js.map +1 -0
  64. package/dist/actions/debug/formatters.js +22 -0
  65. package/dist/actions/debug/formatters.js.map +1 -0
  66. package/dist/actions/deploy/createStudioUserApplication.js +17 -4
  67. package/dist/actions/deploy/createStudioUserApplication.js.map +1 -1
  68. package/dist/actions/deploy/deployApp.js +41 -15
  69. package/dist/actions/deploy/deployApp.js.map +1 -1
  70. package/dist/actions/deploy/deployStudio.js +92 -44
  71. package/dist/actions/deploy/deployStudio.js.map +1 -1
  72. package/dist/actions/deploy/deployStudioSchemasAndManifests.js +55 -0
  73. package/dist/actions/deploy/deployStudioSchemasAndManifests.js.map +1 -0
  74. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js +120 -0
  75. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js.map +1 -0
  76. package/dist/actions/deploy/findUserApplicationForStudio.js +35 -12
  77. package/dist/actions/deploy/findUserApplicationForStudio.js.map +1 -1
  78. package/dist/actions/deploy/types.js +10 -1
  79. package/dist/actions/deploy/types.js.map +1 -1
  80. package/dist/actions/deploy/urlUtils.js +21 -0
  81. package/dist/actions/deploy/urlUtils.js.map +1 -0
  82. package/dist/actions/dev/getDashboardAppUrl.js +48 -0
  83. package/dist/actions/dev/getDashboardAppUrl.js.map +1 -0
  84. package/dist/actions/dev/getDevServerConfig.js +7 -3
  85. package/dist/actions/dev/getDevServerConfig.js.map +1 -1
  86. package/dist/actions/dev/startAppDevServer.js +3 -3
  87. package/dist/actions/dev/startAppDevServer.js.map +1 -1
  88. package/dist/actions/dev/startStudioDevServer.js +14 -14
  89. package/dist/actions/dev/startStudioDevServer.js.map +1 -1
  90. package/dist/actions/doctor/checks/cliInstallation.js +56 -0
  91. package/dist/actions/doctor/checks/cliInstallation.js.map +1 -0
  92. package/dist/actions/doctor/checks/index.js +16 -0
  93. package/dist/actions/doctor/checks/index.js.map +1 -0
  94. package/dist/actions/doctor/runDoctorChecks.js +56 -0
  95. package/dist/actions/doctor/runDoctorChecks.js.map +1 -0
  96. package/dist/actions/doctor/types.js +3 -0
  97. package/dist/actions/doctor/types.js.map +1 -0
  98. package/dist/actions/documents/types.js.map +1 -1
  99. package/dist/actions/documents/validate.js +11 -2
  100. package/dist/actions/documents/validate.js.map +1 -1
  101. package/dist/actions/documents/validateDocuments.worker.js +4 -4
  102. package/dist/actions/documents/validateDocuments.worker.js.map +1 -1
  103. package/dist/actions/documents/validation/reporters/jsonReporter.js +1 -1
  104. package/dist/actions/documents/validation/reporters/jsonReporter.js.map +1 -1
  105. package/dist/actions/documents/validation/reporters/ndjsonReporter.js +1 -1
  106. package/dist/actions/documents/validation/reporters/ndjsonReporter.js.map +1 -1
  107. package/dist/actions/documents/validation/reporters/prettyReporter/formatDocumentValidation.js +1 -1
  108. package/dist/actions/documents/validation/reporters/prettyReporter/formatDocumentValidation.js.map +1 -1
  109. package/dist/actions/documents/validation/reporters/prettyReporter/tree.js +108 -0
  110. package/dist/actions/documents/validation/reporters/prettyReporter/tree.js.map +1 -0
  111. package/dist/actions/graphql/SchemaError.js +4 -26
  112. package/dist/actions/graphql/SchemaError.js.map +1 -1
  113. package/dist/actions/graphql/__tests__/fixtures/many-self-refs.js +540 -0
  114. package/dist/actions/graphql/__tests__/fixtures/many-self-refs.js.map +1 -0
  115. package/dist/actions/graphql/__tests__/fixtures/test-studio.js +1143 -0
  116. package/dist/actions/graphql/__tests__/fixtures/test-studio.js.map +1 -0
  117. package/dist/actions/graphql/__tests__/fixtures/union-refs.js +591 -0
  118. package/dist/actions/graphql/__tests__/fixtures/union-refs.js.map +1 -0
  119. package/dist/actions/graphql/__tests__/helpers.js +23 -0
  120. package/dist/actions/graphql/__tests__/helpers.js.map +1 -0
  121. package/dist/actions/graphql/extractFromSanitySchema.js +5 -5
  122. package/dist/actions/graphql/extractFromSanitySchema.js.map +1 -1
  123. package/dist/actions/graphql/extractGraphQLAPIs.js +150 -0
  124. package/dist/actions/graphql/extractGraphQLAPIs.js.map +1 -0
  125. package/dist/actions/graphql/extractGraphQLAPIs.worker.js +12 -0
  126. package/dist/actions/graphql/extractGraphQLAPIs.worker.js.map +1 -0
  127. package/dist/actions/graphql/gen1/generateTypeFilters.js +1 -1
  128. package/dist/actions/graphql/gen1/generateTypeFilters.js.map +1 -1
  129. package/dist/actions/graphql/gen1/generateTypeQueries.js +2 -1
  130. package/dist/actions/graphql/gen1/generateTypeQueries.js.map +1 -1
  131. package/dist/actions/graphql/gen1/index.js +5 -5
  132. package/dist/actions/graphql/gen1/index.js.map +1 -1
  133. package/dist/actions/graphql/gen2/generateTypeQueries.js +1 -1
  134. package/dist/actions/graphql/gen2/generateTypeQueries.js.map +1 -1
  135. package/dist/actions/graphql/gen2/index.js +6 -6
  136. package/dist/actions/graphql/gen2/index.js.map +1 -1
  137. package/dist/actions/graphql/gen3/generateTypeQueries.js +3 -4
  138. package/dist/actions/graphql/gen3/generateTypeQueries.js.map +1 -1
  139. package/dist/actions/graphql/gen3/index.js +6 -7
  140. package/dist/actions/graphql/gen3/index.js.map +1 -1
  141. package/dist/actions/graphql/getGraphQLAPIs.js +15 -57
  142. package/dist/actions/graphql/getGraphQLAPIs.js.map +1 -1
  143. package/dist/actions/graphql/getGraphQLAPIs.worker.js +75 -106
  144. package/dist/actions/graphql/getGraphQLAPIs.worker.js.map +1 -1
  145. package/dist/actions/graphql/helpers.js +13 -0
  146. package/dist/actions/graphql/helpers.js.map +1 -1
  147. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js +187 -0
  148. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js.map +1 -0
  149. package/dist/actions/graphql/types.js +1 -1
  150. package/dist/actions/graphql/types.js.map +1 -1
  151. package/dist/actions/init/bootstrapLocalTemplate.js +10 -8
  152. package/dist/actions/init/bootstrapLocalTemplate.js.map +1 -1
  153. package/dist/actions/init/bootstrapRemoteTemplate.js +6 -5
  154. package/dist/actions/init/bootstrapRemoteTemplate.js.map +1 -1
  155. package/dist/actions/init/bootstrapTemplate.js.map +1 -1
  156. package/dist/actions/init/checkNextJsReactCompatibility.js +1 -1
  157. package/dist/actions/init/checkNextJsReactCompatibility.js.map +1 -1
  158. package/dist/actions/init/createAppCliConfig.js.map +1 -1
  159. package/dist/actions/init/createCliConfig.js.map +1 -1
  160. package/dist/actions/init/createPackageManifest.js +21 -9
  161. package/dist/actions/init/createPackageManifest.js.map +1 -1
  162. package/dist/actions/init/remoteTemplate.js +1 -2
  163. package/dist/actions/init/remoteTemplate.js.map +1 -1
  164. package/dist/actions/init/sdkAppDependencies.js +19 -0
  165. package/dist/actions/init/sdkAppDependencies.js.map +1 -0
  166. package/dist/actions/init/studioDependencies.js.map +1 -0
  167. package/dist/actions/init/templates/appQuickstart.js +1 -22
  168. package/dist/actions/init/templates/appQuickstart.js.map +1 -1
  169. package/dist/actions/init/templates/appSanityUi.js +3 -22
  170. package/dist/actions/init/templates/appSanityUi.js.map +1 -1
  171. package/dist/actions/init/types.js.map +1 -1
  172. package/dist/actions/manifest/SchemaIcon.js +6 -4
  173. package/dist/actions/manifest/SchemaIcon.js.map +1 -1
  174. package/dist/actions/manifest/blockTypeTransformer.js +67 -0
  175. package/dist/actions/manifest/blockTypeTransformer.js.map +1 -0
  176. package/dist/actions/manifest/debug.js +4 -0
  177. package/dist/actions/manifest/debug.js.map +1 -0
  178. package/dist/actions/manifest/extractAppManifest.js +39 -22
  179. package/dist/actions/manifest/extractAppManifest.js.map +1 -1
  180. package/dist/actions/manifest/extractManifest.js +27 -78
  181. package/dist/actions/manifest/extractManifest.js.map +1 -1
  182. package/dist/actions/manifest/extractManifest.worker.js +30 -0
  183. package/dist/actions/manifest/extractManifest.worker.js.map +1 -0
  184. package/dist/actions/manifest/extractWorkspaceManifest.js +31 -372
  185. package/dist/actions/manifest/extractWorkspaceManifest.js.map +1 -1
  186. package/dist/actions/manifest/iconResolver.js +30 -0
  187. package/dist/actions/manifest/iconResolver.js.map +1 -0
  188. package/dist/actions/manifest/referenceTransformer.js +51 -0
  189. package/dist/actions/manifest/referenceTransformer.js.map +1 -0
  190. package/dist/actions/manifest/schemaTypeHelpers.js +2 -2
  191. package/dist/actions/manifest/schemaTypeHelpers.js.map +1 -1
  192. package/dist/actions/manifest/schemaTypeTransformer.js +168 -0
  193. package/dist/actions/manifest/schemaTypeTransformer.js.map +1 -0
  194. package/dist/actions/manifest/transformerUtils.js +40 -0
  195. package/dist/actions/manifest/transformerUtils.js.map +1 -0
  196. package/dist/actions/manifest/types.js +5 -0
  197. package/dist/actions/manifest/types.js.map +1 -1
  198. package/dist/actions/manifest/validationTransformer.js +84 -0
  199. package/dist/actions/manifest/validationTransformer.js.map +1 -0
  200. package/dist/actions/manifest/writeManifestFile.js +30 -0
  201. package/dist/actions/manifest/writeManifestFile.js.map +1 -0
  202. package/dist/actions/manifest/writeWorkspaceFiles.js +30 -0
  203. package/dist/actions/manifest/writeWorkspaceFiles.js.map +1 -0
  204. package/dist/actions/mcp/detectAvailableEditors.js +34 -13
  205. package/dist/actions/mcp/detectAvailableEditors.js.map +1 -1
  206. package/dist/actions/mcp/editorConfigs.js +231 -109
  207. package/dist/actions/mcp/editorConfigs.js.map +1 -1
  208. package/dist/actions/mcp/promptForMCPSetup.js +16 -7
  209. package/dist/actions/mcp/promptForMCPSetup.js.map +1 -1
  210. package/dist/actions/mcp/setupMCP.js +62 -23
  211. package/dist/actions/mcp/setupMCP.js.map +1 -1
  212. package/dist/actions/mcp/types.js.map +1 -1
  213. package/dist/actions/mcp/validateEditorTokens.js +56 -0
  214. package/dist/actions/mcp/validateEditorTokens.js.map +1 -0
  215. package/dist/actions/mcp/writeMCPConfig.js +27 -15
  216. package/dist/actions/mcp/writeMCPConfig.js.map +1 -1
  217. package/dist/actions/media/buildNdjsonIndex.js +32 -0
  218. package/dist/actions/media/buildNdjsonIndex.js.map +1 -0
  219. package/dist/actions/media/importAspects.js +2 -11
  220. package/dist/actions/media/importAspects.js.map +1 -1
  221. package/dist/actions/media/importMedia.js +22 -18
  222. package/dist/actions/media/importMedia.js.map +1 -1
  223. package/dist/actions/organizations/findOrganizationByUserName.js +5 -0
  224. package/dist/actions/organizations/findOrganizationByUserName.js.map +1 -0
  225. package/dist/actions/organizations/getOrganization.js +3 -2
  226. package/dist/actions/organizations/getOrganization.js.map +1 -1
  227. package/dist/actions/organizations/getOrganizationChoices.js +27 -19
  228. package/dist/actions/organizations/getOrganizationChoices.js.map +1 -1
  229. package/dist/actions/organizations/types.js +3 -0
  230. package/dist/actions/organizations/types.js.map +1 -0
  231. package/dist/actions/projects/getManageUrl.js +1 -2
  232. package/dist/actions/projects/getManageUrl.js.map +1 -1
  233. package/dist/actions/schema/deleteSchemaAction.js +14 -30
  234. package/dist/actions/schema/deleteSchemaAction.js.map +1 -1
  235. package/dist/actions/schema/deploySchemas.js +22 -91
  236. package/dist/actions/schema/deploySchemas.js.map +1 -1
  237. package/dist/actions/schema/extractSanitySchema.worker.js +0 -5
  238. package/dist/actions/schema/extractSanitySchema.worker.js.map +1 -1
  239. package/dist/actions/schema/extractSanityWorkspace.worker.js +24 -0
  240. package/dist/actions/schema/extractSanityWorkspace.worker.js.map +1 -0
  241. package/dist/actions/schema/extractSchema.js +8 -40
  242. package/dist/actions/schema/extractSchema.js.map +1 -1
  243. package/dist/actions/schema/extractSchemaWatcher.js +128 -0
  244. package/dist/actions/schema/extractSchemaWatcher.js.map +1 -0
  245. package/dist/actions/schema/formatSchemaValidation.js +5 -1
  246. package/dist/actions/schema/formatSchemaValidation.js.map +1 -1
  247. package/dist/actions/schema/getExtractOptions.js +16 -0
  248. package/dist/actions/schema/getExtractOptions.js.map +1 -0
  249. package/dist/actions/schema/listSchemas.js +53 -56
  250. package/dist/actions/schema/listSchemas.js.map +1 -1
  251. package/dist/actions/schema/matchSchemaPattern.js +22 -0
  252. package/dist/actions/schema/matchSchemaPattern.js.map +1 -0
  253. package/dist/actions/schema/runSchemaExtraction.js +39 -0
  254. package/dist/actions/schema/runSchemaExtraction.js.map +1 -0
  255. package/dist/actions/schema/types.js +8 -0
  256. package/dist/actions/schema/types.js.map +1 -1
  257. package/dist/actions/schema/uniqueWorkspaces.worker.js +24 -0
  258. package/dist/actions/schema/uniqueWorkspaces.worker.js.map +1 -0
  259. package/dist/actions/schema/updateWorkspaceSchema.js +63 -0
  260. package/dist/actions/schema/updateWorkspaceSchema.js.map +1 -0
  261. package/dist/actions/schema/uploadSchemaToLexicon.js +87 -0
  262. package/dist/actions/schema/uploadSchemaToLexicon.js.map +1 -0
  263. package/dist/actions/schema/utils/SchemaExtractionError.js +10 -0
  264. package/dist/actions/schema/utils/SchemaExtractionError.js.map +1 -0
  265. package/dist/actions/schema/utils/schemaStoreValidation.js +1 -15
  266. package/dist/actions/schema/utils/schemaStoreValidation.js.map +1 -1
  267. package/dist/actions/schema/utils/uniqByProjectIdDataset.js +1 -1
  268. package/dist/actions/schema/utils/uniqByProjectIdDataset.js.map +1 -1
  269. package/dist/actions/schema/validateSchema.worker.js +1 -8
  270. package/dist/actions/schema/validateSchema.worker.js.map +1 -1
  271. package/dist/actions/schema/watchExtractSchema.js +72 -0
  272. package/dist/actions/schema/watchExtractSchema.js.map +1 -0
  273. package/dist/actions/telemetry/isTrueish.js +10 -0
  274. package/dist/actions/telemetry/isTrueish.js.map +1 -0
  275. package/dist/actions/telemetry/resolveConsent.js +2 -1
  276. package/dist/actions/telemetry/resolveConsent.js.map +1 -1
  277. package/dist/actions/telemetry/setConsent.js +2 -1
  278. package/dist/actions/telemetry/setConsent.js.map +1 -1
  279. package/dist/actions/telemetry/telemetryDebug.js +2 -2
  280. package/dist/actions/telemetry/telemetryDebug.js.map +1 -1
  281. package/dist/actions/users/getMembersForProject.js.map +1 -1
  282. package/dist/actions/users/getPendingInvitations.js +1 -1
  283. package/dist/actions/users/getPendingInvitations.js.map +1 -1
  284. package/dist/actions/users/types.js.map +1 -1
  285. package/dist/actions/versions/filterSanityModules.js.map +1 -1
  286. package/dist/actions/versions/findSanityModulesVersions.js +2 -3
  287. package/dist/actions/versions/findSanityModulesVersions.js.map +1 -1
  288. package/dist/actions/versions/getFormatters.js +1 -1
  289. package/dist/actions/versions/getFormatters.js.map +1 -1
  290. package/dist/actions/versions/tryFindLatestVersion.js +1 -1
  291. package/dist/actions/versions/tryFindLatestVersion.js.map +1 -1
  292. package/dist/commands/backup/disable.js +22 -7
  293. package/dist/commands/backup/disable.js.map +1 -1
  294. package/dist/commands/backup/download.js +19 -10
  295. package/dist/commands/backup/download.js.map +1 -1
  296. package/dist/commands/backup/enable.js +22 -7
  297. package/dist/commands/backup/enable.js.map +1 -1
  298. package/dist/commands/backup/list.js +20 -8
  299. package/dist/commands/backup/list.js.map +1 -1
  300. package/dist/commands/build.js +2 -5
  301. package/dist/commands/build.js.map +1 -1
  302. package/dist/commands/cors/add.js +20 -7
  303. package/dist/commands/cors/add.js.map +1 -1
  304. package/dist/commands/cors/delete.js +22 -7
  305. package/dist/commands/cors/delete.js.map +1 -1
  306. package/dist/commands/cors/list.js +22 -7
  307. package/dist/commands/cors/list.js.map +1 -1
  308. package/dist/commands/dataset/alias/create.js +26 -7
  309. package/dist/commands/dataset/alias/create.js.map +1 -1
  310. package/dist/commands/dataset/alias/delete.js +20 -7
  311. package/dist/commands/dataset/alias/delete.js.map +1 -1
  312. package/dist/commands/dataset/alias/link.js +20 -7
  313. package/dist/commands/dataset/alias/link.js.map +1 -1
  314. package/dist/commands/dataset/alias/unlink.js +20 -7
  315. package/dist/commands/dataset/alias/unlink.js.map +1 -1
  316. package/dist/commands/dataset/copy.js +45 -30
  317. package/dist/commands/dataset/copy.js.map +1 -1
  318. package/dist/commands/dataset/create.js +32 -7
  319. package/dist/commands/dataset/create.js.map +1 -1
  320. package/dist/commands/dataset/delete.js +16 -7
  321. package/dist/commands/dataset/delete.js.map +1 -1
  322. package/dist/commands/dataset/embeddings/disable.js +77 -0
  323. package/dist/commands/dataset/embeddings/disable.js.map +1 -0
  324. package/dist/commands/dataset/embeddings/enable.js +141 -0
  325. package/dist/commands/dataset/embeddings/enable.js.map +1 -0
  326. package/dist/commands/dataset/embeddings/status.js +72 -0
  327. package/dist/commands/dataset/embeddings/status.js.map +1 -0
  328. package/dist/commands/dataset/export.js +25 -16
  329. package/dist/commands/dataset/export.js.map +1 -1
  330. package/dist/commands/dataset/import.js +306 -1
  331. package/dist/commands/dataset/import.js.map +1 -1
  332. package/dist/commands/dataset/list.js +22 -7
  333. package/dist/commands/dataset/list.js.map +1 -1
  334. package/dist/commands/dataset/visibility/get.js +18 -7
  335. package/dist/commands/dataset/visibility/get.js.map +1 -1
  336. package/dist/commands/dataset/visibility/set.js +22 -7
  337. package/dist/commands/dataset/visibility/set.js.map +1 -1
  338. package/dist/commands/debug.js +4 -2
  339. package/dist/commands/debug.js.map +1 -1
  340. package/dist/commands/deploy.js +22 -11
  341. package/dist/commands/deploy.js.map +1 -1
  342. package/dist/commands/dev.js +2 -4
  343. package/dist/commands/dev.js.map +1 -1
  344. package/dist/commands/doctor.js +125 -0
  345. package/dist/commands/doctor.js.map +1 -0
  346. package/dist/commands/documents/create.js +19 -12
  347. package/dist/commands/documents/create.js.map +1 -1
  348. package/dist/commands/documents/delete.js +19 -12
  349. package/dist/commands/documents/delete.js.map +1 -1
  350. package/dist/commands/documents/get.js +17 -12
  351. package/dist/commands/documents/get.js.map +1 -1
  352. package/dist/commands/documents/query.js +26 -18
  353. package/dist/commands/documents/query.js.map +1 -1
  354. package/dist/commands/documents/validate.js +32 -10
  355. package/dist/commands/documents/validate.js.map +1 -1
  356. package/dist/commands/graphql/deploy.js +58 -30
  357. package/dist/commands/graphql/deploy.js.map +1 -1
  358. package/dist/commands/graphql/list.js +15 -7
  359. package/dist/commands/graphql/list.js.map +1 -1
  360. package/dist/commands/graphql/undeploy.js +37 -19
  361. package/dist/commands/graphql/undeploy.js.map +1 -1
  362. package/dist/commands/hook/attempt.js +22 -7
  363. package/dist/commands/hook/attempt.js.map +1 -1
  364. package/dist/commands/hook/create.js +23 -8
  365. package/dist/commands/hook/create.js.map +1 -1
  366. package/dist/commands/hook/delete.js +22 -7
  367. package/dist/commands/hook/delete.js.map +1 -1
  368. package/dist/commands/hook/list.js +22 -7
  369. package/dist/commands/hook/list.js.map +1 -1
  370. package/dist/commands/hook/logs.js +21 -8
  371. package/dist/commands/hook/logs.js.map +1 -1
  372. package/dist/commands/init.js +55 -32
  373. package/dist/commands/init.js.map +1 -1
  374. package/dist/commands/login.js +19 -6
  375. package/dist/commands/login.js.map +1 -1
  376. package/dist/commands/logout.js +8 -6
  377. package/dist/commands/logout.js.map +1 -1
  378. package/dist/commands/manage.js +0 -1
  379. package/dist/commands/manage.js.map +1 -1
  380. package/dist/commands/manifest/extract.js +14 -10
  381. package/dist/commands/manifest/extract.js.map +1 -1
  382. package/dist/commands/mcp/configure.js +4 -2
  383. package/dist/commands/mcp/configure.js.map +1 -1
  384. package/dist/commands/media/create-aspect.js +4 -4
  385. package/dist/commands/media/create-aspect.js.map +1 -1
  386. package/dist/commands/media/delete-aspect.js +9 -7
  387. package/dist/commands/media/delete-aspect.js.map +1 -1
  388. package/dist/commands/media/deploy-aspect.js +22 -9
  389. package/dist/commands/media/deploy-aspect.js.map +1 -1
  390. package/dist/commands/media/export.js +9 -7
  391. package/dist/commands/media/export.js.map +1 -1
  392. package/dist/commands/media/import.js +10 -8
  393. package/dist/commands/media/import.js.map +1 -1
  394. package/dist/commands/preview.js +5 -8
  395. package/dist/commands/preview.js.map +1 -1
  396. package/dist/commands/projects/list.js +2 -1
  397. package/dist/commands/projects/list.js.map +1 -1
  398. package/dist/commands/schema/delete.js +33 -34
  399. package/dist/commands/schema/delete.js.map +1 -1
  400. package/dist/commands/schema/deploy.js +19 -30
  401. package/dist/commands/schema/deploy.js.map +1 -1
  402. package/dist/commands/schema/extract.js +32 -4
  403. package/dist/commands/schema/extract.js.map +1 -1
  404. package/dist/commands/schema/list.js +10 -31
  405. package/dist/commands/schema/list.js.map +1 -1
  406. package/dist/commands/tokens/add.js +24 -7
  407. package/dist/commands/tokens/add.js.map +1 -1
  408. package/dist/commands/tokens/delete.js +20 -7
  409. package/dist/commands/tokens/delete.js.map +1 -1
  410. package/dist/commands/tokens/list.js +20 -7
  411. package/dist/commands/tokens/list.js.map +1 -1
  412. package/dist/commands/users/invite.js +24 -7
  413. package/dist/commands/users/invite.js.map +1 -1
  414. package/dist/commands/users/list.js +76 -33
  415. package/dist/commands/users/list.js.map +1 -1
  416. package/dist/commands/versions.js +1 -1
  417. package/dist/commands/versions.js.map +1 -1
  418. package/dist/config/createCliConfig.js +1 -2
  419. package/dist/config/createCliConfig.js.map +1 -1
  420. package/dist/exports/_internal.d.ts +132 -0
  421. package/dist/exports/_internal.js +4 -0
  422. package/dist/exports/_internal.js.map +1 -0
  423. package/dist/exports/index.d.ts +113 -0
  424. package/dist/exports/index.js +6 -0
  425. package/dist/exports/index.js.map +1 -0
  426. package/dist/hooks/init/checkForUpdates.js +14 -0
  427. package/dist/hooks/init/checkForUpdates.js.map +1 -0
  428. package/dist/hooks/prerun/flushTelemetry.worker.js +1 -1
  429. package/dist/hooks/prerun/flushTelemetry.worker.js.map +1 -1
  430. package/dist/hooks/prerun/injectEnvVariables.js +9 -1
  431. package/dist/hooks/prerun/injectEnvVariables.js.map +1 -1
  432. package/dist/hooks/prerun/setupTelemetry.js +16 -10
  433. package/dist/hooks/prerun/setupTelemetry.js.map +1 -1
  434. package/dist/prompts/promptForProject.js +64 -0
  435. package/dist/prompts/promptForProject.js.map +1 -0
  436. package/dist/{actions/auth/login/promptProviders.js → prompts/promptForProviders.js} +3 -3
  437. package/dist/prompts/promptForProviders.js.map +1 -0
  438. package/dist/prompts/selectMediaLibrary.js +1 -1
  439. package/dist/prompts/selectMediaLibrary.js.map +1 -1
  440. package/dist/server/devServer.js +4 -2
  441. package/dist/server/devServer.js.map +1 -1
  442. package/dist/server/previewServer.js +2 -2
  443. package/dist/server/previewServer.js.map +1 -1
  444. package/dist/server/vite/plugin-schema-extraction.js +201 -0
  445. package/dist/server/vite/plugin-schema-extraction.js.map +1 -0
  446. package/dist/server/vite/plugin-typegen.js +217 -0
  447. package/dist/server/vite/plugin-typegen.js.map +1 -0
  448. package/dist/services/auth.js +42 -3
  449. package/dist/services/auth.js.map +1 -1
  450. package/dist/services/datasets.js +7 -5
  451. package/dist/services/datasets.js.map +1 -1
  452. package/dist/services/docs.js +2 -2
  453. package/dist/services/docs.js.map +1 -1
  454. package/dist/services/embeddings.js +25 -0
  455. package/dist/services/embeddings.js.map +1 -0
  456. package/dist/services/getUrlHeaders.js +7 -18
  457. package/dist/services/getUrlHeaders.js.map +1 -1
  458. package/dist/services/grants.js +13 -0
  459. package/dist/services/grants.js.map +1 -0
  460. package/dist/services/graphql.js +1 -1
  461. package/dist/services/graphql.js.map +1 -1
  462. package/dist/services/mcp.js +55 -1
  463. package/dist/services/mcp.js.map +1 -1
  464. package/dist/services/projects.js +4 -2
  465. package/dist/services/projects.js.map +1 -1
  466. package/dist/services/schemas.js +1 -1
  467. package/dist/services/schemas.js.map +1 -1
  468. package/dist/services/telemetry.js +2 -1
  469. package/dist/services/telemetry.js.map +1 -1
  470. package/dist/services/userApplications.js +21 -6
  471. package/dist/services/userApplications.js.map +1 -1
  472. package/dist/telemetry/extractSchema.telemetry.js +10 -0
  473. package/dist/telemetry/extractSchema.telemetry.js.map +1 -1
  474. package/dist/types/grants.js +3 -0
  475. package/dist/types/grants.js.map +1 -0
  476. package/dist/types.js +3 -0
  477. package/dist/types.js.map +1 -1
  478. package/dist/util/checkProjectPermissions.js +21 -0
  479. package/dist/util/checkProjectPermissions.js.map +1 -0
  480. package/dist/util/cliClient.js +5 -3
  481. package/dist/util/cliClient.js.map +1 -1
  482. package/dist/util/compareDependencyVersions.js +74 -38
  483. package/dist/util/compareDependencyVersions.js.map +1 -1
  484. package/dist/util/createExpiringConfig.js +64 -0
  485. package/dist/util/createExpiringConfig.js.map +1 -0
  486. package/dist/util/detectFramework.js +135 -0
  487. package/dist/util/detectFramework.js.map +1 -0
  488. package/dist/util/errorMessages.js +0 -1
  489. package/dist/util/errorMessages.js.map +1 -1
  490. package/dist/util/extractDocumentsFromNdjsonOrTarball.js +1 -2
  491. package/dist/util/extractDocumentsFromNdjsonOrTarball.js.map +1 -1
  492. package/dist/util/getCliVersion.js +1 -1
  493. package/dist/util/getCliVersion.js.map +1 -1
  494. package/dist/util/getLocalPackageVersion.js +33 -23
  495. package/dist/util/getLocalPackageVersion.js.map +1 -1
  496. package/dist/util/getProjectDefaults.js +22 -28
  497. package/dist/util/getProjectDefaults.js.map +1 -1
  498. package/dist/util/getSharedServerConfig.js +1 -0
  499. package/dist/util/getSharedServerConfig.js.map +1 -1
  500. package/dist/util/getWorkspace.js +1 -1
  501. package/dist/util/getWorkspace.js.map +1 -1
  502. package/dist/util/gitConfig.js +45 -0
  503. package/dist/util/gitConfig.js.map +1 -0
  504. package/dist/util/isSchemaError.js +11 -0
  505. package/dist/util/isSchemaError.js.map +1 -0
  506. package/dist/util/isTar.js +8 -0
  507. package/dist/util/isTar.js.map +1 -0
  508. package/dist/util/packageManager/getPeerDependencies.js +44 -0
  509. package/dist/util/packageManager/getPeerDependencies.js.map +1 -0
  510. package/dist/util/packageManager/installationInfo/analyzeIssues.js +225 -0
  511. package/dist/util/packageManager/installationInfo/analyzeIssues.js.map +1 -0
  512. package/dist/util/packageManager/installationInfo/commands.js +73 -0
  513. package/dist/util/packageManager/installationInfo/commands.js.map +1 -0
  514. package/dist/util/packageManager/installationInfo/detectCliInstallation.js +66 -0
  515. package/dist/util/packageManager/installationInfo/detectCliInstallation.js.map +1 -0
  516. package/dist/util/packageManager/installationInfo/detectGlobals.js +295 -0
  517. package/dist/util/packageManager/installationInfo/detectGlobals.js.map +1 -0
  518. package/dist/util/packageManager/installationInfo/detectPackages.js +190 -0
  519. package/dist/util/packageManager/installationInfo/detectPackages.js.map +1 -0
  520. package/dist/util/packageManager/installationInfo/detectWorkspace.js +192 -0
  521. package/dist/util/packageManager/installationInfo/detectWorkspace.js.map +1 -0
  522. package/dist/util/packageManager/installationInfo/index.js +4 -0
  523. package/dist/util/packageManager/installationInfo/index.js.map +1 -0
  524. package/dist/util/packageManager/installationInfo/readJsonFile.js +14 -0
  525. package/dist/util/packageManager/installationInfo/readJsonFile.js.map +1 -0
  526. package/dist/util/packageManager/installationInfo/resolveVersionRange.js +42 -0
  527. package/dist/util/packageManager/installationInfo/resolveVersionRange.js.map +1 -0
  528. package/dist/util/packageManager/installationInfo/types.js +3 -0
  529. package/dist/util/packageManager/installationInfo/types.js.map +1 -0
  530. package/dist/util/packageManager/packageManagerChoice.js +1 -20
  531. package/dist/util/packageManager/packageManagerChoice.js.map +1 -1
  532. package/dist/util/packageManager/upgradePackages.js +4 -1
  533. package/dist/util/packageManager/upgradePackages.js.map +1 -1
  534. package/dist/util/promiseRaceWithTimeout.js +28 -0
  535. package/dist/util/promiseRaceWithTimeout.js.map +1 -0
  536. package/dist/util/readdirRecursive.js.map +1 -1
  537. package/dist/util/resolveLatestVersions.js +2 -2
  538. package/dist/util/resolveLatestVersions.js.map +1 -1
  539. package/dist/util/sharedFlags.js +54 -0
  540. package/dist/util/sharedFlags.js.map +1 -0
  541. package/dist/util/telemetry/cleanupOldTelemetryFiles.js +30 -0
  542. package/dist/util/telemetry/cleanupOldTelemetryFiles.js.map +1 -0
  543. package/dist/util/telemetry/createTelemetryStore.js +95 -0
  544. package/dist/util/telemetry/createTelemetryStore.js.map +1 -0
  545. package/dist/util/telemetry/createTraceId.js +10 -0
  546. package/dist/util/telemetry/createTraceId.js.map +1 -0
  547. package/dist/util/telemetry/findTelemetryFiles.js +35 -0
  548. package/dist/util/telemetry/findTelemetryFiles.js.map +1 -0
  549. package/dist/util/telemetry/flushTelemetryFiles.js +118 -0
  550. package/dist/util/telemetry/flushTelemetryFiles.js.map +1 -0
  551. package/dist/util/telemetry/generateTelemetryFilePath.js +30 -0
  552. package/dist/util/telemetry/generateTelemetryFilePath.js.map +1 -0
  553. package/dist/util/telemetry/logger.js +59 -0
  554. package/dist/util/telemetry/logger.js.map +1 -0
  555. package/dist/util/telemetry/readNDJSON.js +28 -0
  556. package/dist/util/telemetry/readNDJSON.js.map +1 -0
  557. package/dist/util/telemetry/telemetryStoreDebug.js +7 -0
  558. package/dist/util/telemetry/telemetryStoreDebug.js.map +1 -0
  559. package/dist/util/telemetry/trace.js +150 -0
  560. package/dist/util/telemetry/trace.js.map +1 -0
  561. package/dist/util/toForwardSlashes.js +8 -0
  562. package/dist/util/toForwardSlashes.js.map +1 -0
  563. package/dist/util/update/fetchLatestVersion.js +21 -0
  564. package/dist/util/update/fetchLatestVersion.js.map +1 -0
  565. package/dist/util/update/getUpdateCommand.js +20 -0
  566. package/dist/util/update/getUpdateCommand.js.map +1 -0
  567. package/dist/util/update/isInstalledUsingYarn.js +17 -0
  568. package/dist/util/update/isInstalledUsingYarn.js.map +1 -0
  569. package/dist/util/update/showNotificationUpdate.js +31 -0
  570. package/dist/util/update/showNotificationUpdate.js.map +1 -0
  571. package/dist/util/update/updateChecker.js +60 -0
  572. package/dist/util/update/updateChecker.js.map +1 -0
  573. package/dist/util/update/updateCheckerDebug.js +4 -0
  574. package/dist/util/update/updateCheckerDebug.js.map +1 -0
  575. package/oclif.config.js +1 -0
  576. package/oclif.manifest.json +1285 -492
  577. package/package.json +72 -73
  578. package/static/favicons/apple-touch-icon.png +0 -0
  579. package/static/favicons/favicon-192.png +0 -0
  580. package/static/favicons/favicon-512.png +0 -0
  581. package/static/favicons/favicon-96.png +0 -0
  582. package/static/favicons/favicon.ico +0 -0
  583. package/static/favicons/favicon.svg +12 -0
  584. package/dist/actions/auth/login/promptProviders.js.map +0 -1
  585. package/dist/actions/dev/getCoreAppUrl.js +0 -10
  586. package/dist/actions/dev/getCoreAppUrl.js.map +0 -1
  587. package/dist/actions/schema/schemaStoreTypes.js +0 -19
  588. package/dist/actions/schema/schemaStoreTypes.js.map +0 -1
  589. package/dist/actions/schema/utils/manifestExtractor.js +0 -33
  590. package/dist/actions/schema/utils/manifestExtractor.js.map +0 -1
  591. package/dist/actions/schema/utils/manifestReader.js +0 -71
  592. package/dist/actions/schema/utils/manifestReader.js.map +0 -1
  593. package/dist/index.d.ts +0 -2326
  594. package/dist/index.js +0 -6
  595. package/dist/index.js.map +0 -1
  596. package/dist/studioDependencies.js.map +0 -1
  597. package/dist/typings/deepSortObject.d.js +0 -2
  598. package/dist/typings/deepSortObject.d.js.map +0 -1
  599. package/dist/util/findNdjsonEntry.js +0 -21
  600. package/dist/util/findNdjsonEntry.js.map +0 -1
  601. package/dist/util/importStudioConfig.js +0 -40
  602. package/dist/util/importStudioConfig.js.map +0 -1
  603. package/dist/util/readModuleVersion.js +0 -15
  604. package/dist/util/readModuleVersion.js.map +0 -1
  605. package/dist/util/readPackageJson.js +0 -44
  606. package/dist/util/readPackageJson.js.map +0 -1
  607. package/dist/util/readPackageManifest.js +0 -46
  608. package/dist/util/readPackageManifest.js.map +0 -1
  609. package/dist/util/uniqBy.js +0 -14
  610. package/dist/util/uniqBy.js.map +0 -1
  611. package/dist/util/workerChannels.js +0 -172
  612. package/dist/util/workerChannels.js.map +0 -1
  613. /package/dist/{studioDependencies.js → actions/init/studioDependencies.js} +0 -0
package/dist/index.d.ts DELETED
@@ -1,2326 +0,0 @@
1
- import {CliConfig} from '@sanity/cli-core'
2
- import {loadEnv} from 'vite'
3
- import {NodePath} from '@babel/core'
4
- import {NodePath as NodePath_2} from '@babel/traverse'
5
- import {SanityClient} from '@sanity/client'
6
- import {Scope} from '@babel/traverse'
7
- import * as t from '@babel/types'
8
- import {UserViteConfig} from '@sanity/cli-core'
9
- import {z} from 'zod'
10
-
11
- declare type AliasingEffect =
12
- | {
13
- kind: 'Freeze'
14
- value: Place
15
- reason: ValueReason
16
- }
17
- | {
18
- kind: 'Mutate'
19
- value: Place
20
- reason?: MutationReason | null
21
- }
22
- | {
23
- kind: 'MutateConditionally'
24
- value: Place
25
- }
26
- | {
27
- kind: 'MutateTransitive'
28
- value: Place
29
- }
30
- | {
31
- kind: 'MutateTransitiveConditionally'
32
- value: Place
33
- }
34
- | {
35
- kind: 'Capture'
36
- from: Place
37
- into: Place
38
- }
39
- | {
40
- kind: 'Alias'
41
- from: Place
42
- into: Place
43
- }
44
- | {
45
- kind: 'MaybeAlias'
46
- from: Place
47
- into: Place
48
- }
49
- | {
50
- kind: 'Assign'
51
- from: Place
52
- into: Place
53
- }
54
- | {
55
- kind: 'Create'
56
- into: Place
57
- value: ValueKind
58
- reason: ValueReason
59
- }
60
- | {
61
- kind: 'CreateFrom'
62
- from: Place
63
- into: Place
64
- }
65
- | {
66
- kind: 'ImmutableCapture'
67
- from: Place
68
- into: Place
69
- }
70
- | {
71
- kind: 'Apply'
72
- receiver: Place
73
- function: Place
74
- mutatesFunction: boolean
75
- args: Array<Place | SpreadPattern | Hole>
76
- into: Place
77
- signature: FunctionSignature | null
78
- loc: SourceLocation
79
- }
80
- | {
81
- kind: 'CreateFunction'
82
- captures: Array<Place>
83
- function: FunctionExpression | ObjectMethod
84
- into: Place
85
- }
86
- | {
87
- kind: 'MutateFrozen'
88
- place: Place
89
- error: CompilerDiagnostic
90
- }
91
- | {
92
- kind: 'MutateGlobal'
93
- place: Place
94
- error: CompilerDiagnostic
95
- }
96
- | {
97
- kind: 'Impure'
98
- place: Place
99
- error: CompilerDiagnostic
100
- }
101
- | {
102
- kind: 'Render'
103
- place: Place
104
- }
105
-
106
- declare type AliasingSignature = {
107
- receiver: IdentifierId
108
- params: Array<IdentifierId>
109
- rest: IdentifierId | null
110
- returns: IdentifierId
111
- effects: Array<AliasingEffect>
112
- temporaries: Array<Place>
113
- }
114
-
115
- declare type ArrayExpression = {
116
- kind: 'ArrayExpression'
117
- elements: Array<Place | SpreadPattern | Hole>
118
- loc: SourceLocation
119
- }
120
-
121
- declare type ArrayPattern = {
122
- kind: 'ArrayPattern'
123
- items: Array<Place | SpreadPattern | Hole>
124
- }
125
-
126
- declare type AutoDepsDecorationsEvent = {
127
- kind: 'AutoDepsDecorations'
128
- fnLoc: t.SourceLocation
129
- decorations: Array<t.SourceLocation>
130
- }
131
-
132
- declare type AutoDepsEligibleEvent = {
133
- kind: 'AutoDepsEligible'
134
- fnLoc: t.SourceLocation
135
- depArrayLoc: t.SourceLocation
136
- }
137
-
138
- declare type BabelFn =
139
- | NodePath<t.FunctionDeclaration>
140
- | NodePath<t.FunctionExpression>
141
- | NodePath<t.ArrowFunctionExpression>
142
-
143
- declare type BasicBlock = {
144
- kind: BlockKind
145
- id: BlockId
146
- instructions: Array<Instruction>
147
- terminal: Terminal
148
- preds: Set<BlockId>
149
- phis: Set<Phi>
150
- }
151
-
152
- declare type BlockId = number & {
153
- [opaqueBlockId]: 'BlockId'
154
- }
155
-
156
- declare type BlockKind = 'block' | 'value' | 'loop' | 'sequence' | 'catch'
157
-
158
- declare type BranchTerminal = {
159
- kind: 'branch'
160
- test: Place
161
- consequent: BlockId
162
- alternate: BlockId
163
- id: InstructionId
164
- loc: SourceLocation
165
- fallthrough: BlockId
166
- }
167
-
168
- declare type BuiltinTag = {
169
- kind: 'BuiltinTag'
170
- name: string
171
- loc: SourceLocation
172
- }
173
-
174
- declare type BuiltInType = PrimitiveType | FunctionType | ObjectType
175
-
176
- declare type CallExpression = {
177
- kind: 'CallExpression'
178
- callee: Place
179
- args: Array<Place | SpreadPattern>
180
- loc: SourceLocation
181
- typeArguments?: Array<t.FlowType>
182
- }
183
-
184
- declare type Case = {
185
- test: Place | null
186
- block: BlockId
187
- }
188
-
189
- declare type CliClientGetter = ((options?: CliClientOptions) => SanityClient) & {
190
- /**
191
- * @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules
192
- * @returns A token to use when constructing a client without a `token` explicitly defined, or undefined
193
- * @internal
194
- */
195
- __internal__getToken: () => string | undefined
196
- }
197
-
198
- /**
199
- * @public
200
- */
201
- export declare interface CliClientOptions {
202
- apiVersion?: string
203
- cwd?: string
204
- dataset?: string
205
- projectId?: string
206
- token?: string
207
- useCdn?: boolean
208
- }
209
-
210
- declare type CodegenFunction = {
211
- type: 'CodegenFunction'
212
- id: t.Identifier | null
213
- nameHint: string | null
214
- params: t.FunctionDeclaration['params']
215
- body: t.BlockStatement
216
- generator: boolean
217
- async: boolean
218
- loc: SourceLocation
219
- memoSlotsUsed: number
220
- memoBlocks: number
221
- memoValues: number
222
- prunedMemoBlocks: number
223
- prunedMemoValues: number
224
- outlined: Array<{
225
- fn: CodegenFunction
226
- type: ReactFunctionType | null
227
- }>
228
- hasInferredEffect: boolean
229
- inferredEffectLocations: Set<SourceLocation>
230
- hasFireRewrite: boolean
231
- }
232
-
233
- declare type CompilationMode = z.infer<typeof CompilationModeSchema>
234
-
235
- declare const CompilationModeSchema: z.ZodEnum<{
236
- syntax: 'syntax'
237
- infer: 'infer'
238
- annotation: 'annotation'
239
- all: 'all'
240
- }>
241
-
242
- declare type CompileDiagnosticEvent = {
243
- kind: 'CompileDiagnostic'
244
- fnLoc: t.SourceLocation | null
245
- detail: Omit<Omit<CompilerErrorDetailOptions, 'severity'>, 'suggestions'>
246
- }
247
-
248
- declare type CompileErrorEvent = {
249
- kind: 'CompileError'
250
- fnLoc: t.SourceLocation | null
251
- detail: CompilerErrorDetail | CompilerDiagnostic
252
- }
253
-
254
- declare class CompilerDiagnostic {
255
- options: CompilerDiagnosticOptions
256
- constructor(options: CompilerDiagnosticOptions)
257
- static create(options: Omit<CompilerDiagnosticOptions, 'details'>): CompilerDiagnostic
258
- get reason(): CompilerDiagnosticOptions['reason']
259
- get description(): CompilerDiagnosticOptions['description']
260
- get severity(): ErrorSeverity
261
- get suggestions(): CompilerDiagnosticOptions['suggestions']
262
- get category(): ErrorCategory
263
- withDetails(...details: Array<CompilerDiagnosticDetail>): CompilerDiagnostic
264
- primaryLocation(): SourceLocation | null
265
- printErrorMessage(source: string, options: PrintErrorMessageOptions): string
266
- toString(): string
267
- }
268
-
269
- declare type CompilerDiagnosticDetail =
270
- | {
271
- kind: 'error'
272
- loc: SourceLocation | null
273
- message: string | null
274
- }
275
- | {
276
- kind: 'hint'
277
- message: string
278
- }
279
-
280
- declare type CompilerDiagnosticOptions = {
281
- category: ErrorCategory
282
- reason: string
283
- description: string | null
284
- details: Array<CompilerDiagnosticDetail>
285
- suggestions?: Array<CompilerSuggestion> | null | undefined
286
- }
287
-
288
- declare class CompilerError extends Error {
289
- details: Array<CompilerErrorDetail | CompilerDiagnostic>
290
- disabledDetails: Array<CompilerErrorDetail | CompilerDiagnostic>
291
- printedMessage: string | null
292
- static invariant(
293
- condition: unknown,
294
- options: Omit<CompilerDiagnosticOptions, 'category'>,
295
- ): asserts condition
296
- static throwDiagnostic(options: CompilerDiagnosticOptions): never
297
- static throwTodo(options: Omit<CompilerErrorDetailOptions, 'category'>): never
298
- static throwInvalidJS(options: Omit<CompilerErrorDetailOptions, 'category'>): never
299
- static throwInvalidReact(options: CompilerErrorDetailOptions): never
300
- static throwInvalidConfig(options: Omit<CompilerErrorDetailOptions, 'category'>): never
301
- static throw(options: CompilerErrorDetailOptions): never
302
- constructor(...args: Array<any>)
303
- get message(): string
304
- set message(_message: string)
305
- toString(): string
306
- withPrintedMessage(source: string, options: PrintErrorMessageOptions): CompilerError
307
- printErrorMessage(source: string, options: PrintErrorMessageOptions): string
308
- merge(other: CompilerError): void
309
- pushDiagnostic(diagnostic: CompilerDiagnostic): void
310
- push(options: CompilerErrorDetailOptions): CompilerErrorDetail
311
- pushErrorDetail(detail: CompilerErrorDetail): CompilerErrorDetail
312
- hasAnyErrors(): boolean
313
- asResult(): Result<void, CompilerError>
314
- hasErrors(): boolean
315
- hasWarning(): boolean
316
- hasHints(): boolean
317
- }
318
-
319
- declare class CompilerErrorDetail {
320
- options: CompilerErrorDetailOptions
321
- constructor(options: CompilerErrorDetailOptions)
322
- get reason(): CompilerErrorDetailOptions['reason']
323
- get description(): CompilerErrorDetailOptions['description']
324
- get severity(): ErrorSeverity
325
- get loc(): CompilerErrorDetailOptions['loc']
326
- get suggestions(): CompilerErrorDetailOptions['suggestions']
327
- get category(): ErrorCategory
328
- primaryLocation(): SourceLocation | null
329
- printErrorMessage(source: string, options: PrintErrorMessageOptions): string
330
- toString(): string
331
- }
332
-
333
- declare type CompilerErrorDetailOptions = {
334
- category: ErrorCategory
335
- reason: string
336
- description?: string | null | undefined
337
- loc: SourceLocation | null
338
- suggestions?: Array<CompilerSuggestion> | null | undefined
339
- }
340
-
341
- declare type CompilerMode = 'all_features' | 'no_inferred_memo'
342
-
343
- declare type CompilerPipelineValue =
344
- | {
345
- kind: 'ast'
346
- name: string
347
- value: CodegenFunction
348
- }
349
- | {
350
- kind: 'hir'
351
- name: string
352
- value: HIRFunction
353
- }
354
- | {
355
- kind: 'reactive'
356
- name: string
357
- value: ReactiveFunction
358
- }
359
- | {
360
- kind: 'debug'
361
- name: string
362
- value: string
363
- }
364
-
365
- declare type CompilerReactTarget = z.infer<typeof CompilerReactTargetSchema>
366
-
367
- declare const CompilerReactTargetSchema: z.ZodUnion<
368
- readonly [
369
- z.ZodLiteral<'17'>,
370
- z.ZodLiteral<'18'>,
371
- z.ZodLiteral<'19'>,
372
- z.ZodObject<
373
- {
374
- kind: z.ZodLiteral<'donotuse_meta_internal'>
375
- runtimeModule: z.ZodDefault<z.ZodString>
376
- },
377
- z.core.$strip
378
- >,
379
- ]
380
- >
381
-
382
- declare type CompilerSuggestion =
383
- | {
384
- op:
385
- | CompilerSuggestionOperation.InsertAfter
386
- | CompilerSuggestionOperation.InsertBefore
387
- | CompilerSuggestionOperation.Replace
388
- range: [number, number]
389
- description: string
390
- text: string
391
- }
392
- | {
393
- op: CompilerSuggestionOperation.Remove
394
- range: [number, number]
395
- description: string
396
- }
397
-
398
- declare enum CompilerSuggestionOperation {
399
- InsertBefore = 0,
400
- InsertAfter = 1,
401
- Remove = 2,
402
- Replace = 3,
403
- }
404
-
405
- declare type CompileSkipEvent = {
406
- kind: 'CompileSkip'
407
- fnLoc: t.SourceLocation | null
408
- reason: string
409
- loc: t.SourceLocation | null
410
- }
411
-
412
- declare type CompileSuccessEvent = {
413
- kind: 'CompileSuccess'
414
- fnLoc: t.SourceLocation | null
415
- fnName: string | null
416
- memoSlots: number
417
- memoBlocks: number
418
- memoValues: number
419
- prunedMemoBlocks: number
420
- prunedMemoValues: number
421
- }
422
-
423
- declare type ComponentType<T> = {
424
- kind: 'Component'
425
- props: Map<string, T>
426
- children: null | T
427
- }
428
-
429
- declare type ConcreteType<T> =
430
- | {
431
- kind: 'Enum'
432
- }
433
- | {
434
- kind: 'Mixed'
435
- }
436
- | {
437
- kind: 'Number'
438
- }
439
- | {
440
- kind: 'String'
441
- }
442
- | {
443
- kind: 'Boolean'
444
- }
445
- | {
446
- kind: 'Void'
447
- }
448
- | {
449
- kind: 'Nullable'
450
- type: T
451
- }
452
- | {
453
- kind: 'Array'
454
- element: T
455
- }
456
- | {
457
- kind: 'Set'
458
- element: T
459
- }
460
- | {
461
- kind: 'Map'
462
- key: T
463
- value: T
464
- }
465
- | {
466
- kind: 'Function'
467
- typeParameters: null | Array<TypeParameter<T>>
468
- params: Array<T>
469
- returnType: T
470
- }
471
- | ComponentType<T>
472
- | {
473
- kind: 'Generic'
474
- id: TypeParameterId
475
- bound: T
476
- }
477
- | {
478
- kind: 'Object'
479
- id: NominalId
480
- members: Map<string, ResolvedType>
481
- }
482
- | {
483
- kind: 'Tuple'
484
- id: NominalId
485
- members: Array<T>
486
- }
487
- | {
488
- kind: 'Structural'
489
- id: LinearId
490
- }
491
- | {
492
- kind: 'Union'
493
- members: Array<T>
494
- }
495
- | {
496
- kind: 'Instance'
497
- name: string
498
- members: Map<string, ResolvedType>
499
- }
500
-
501
- /**
502
- * @deprecated Use `defineCliConfig` instead
503
- * @public
504
- */
505
- export declare function createCliConfig(config: CliConfig): {
506
- api?:
507
- | {
508
- dataset?: string | undefined
509
- projectId?: string | undefined
510
- }
511
- | undefined
512
- app?:
513
- | {
514
- entry?: string | undefined
515
- icon?: string | undefined
516
- id?: string | undefined
517
- organizationId?: string | undefined
518
- title?: string | undefined
519
- }
520
- | undefined
521
- autoUpdates?: boolean | undefined
522
- deployment?:
523
- | {
524
- appId?: string | undefined
525
- autoUpdates?: boolean | undefined
526
- }
527
- | undefined
528
- graphql?:
529
- | {
530
- filterSuffix?: string | undefined
531
- generation?: 'gen1' | 'gen2' | 'gen3' | undefined
532
- id?: string | undefined
533
- nonNullDocumentFields?: boolean | undefined
534
- playground?: boolean | undefined
535
- source?: string | undefined
536
- tag?: string | undefined
537
- workspace?: string | undefined
538
- }[]
539
- | undefined
540
- mediaLibrary?:
541
- | {
542
- aspectsPath?: string | undefined
543
- }
544
- | undefined
545
- project?:
546
- | {
547
- basePath?: string | undefined
548
- }
549
- | undefined
550
- reactCompiler?:
551
- | Partial<{
552
- environment: Partial<EnvironmentConfig>
553
- logger: Logger | null
554
- gating: ExternalFunction | null
555
- dynamicGating: {
556
- source: string
557
- } | null
558
- panicThreshold: 'none' | 'all_errors' | 'critical_errors'
559
- noEmit: boolean
560
- compilationMode: 'syntax' | 'infer' | 'annotation' | 'all'
561
- eslintSuppressionRules: Array<string> | null | undefined
562
- flowSuppressions: boolean
563
- ignoreUseNoForget: boolean
564
- customOptOutDirectives: string[] | null
565
- sources: Array<string> | ((filename: string) => boolean) | null
566
- enableReanimatedCheck: boolean
567
- target:
568
- | '17'
569
- | '18'
570
- | '19'
571
- | {
572
- kind: 'donotuse_meta_internal'
573
- runtimeModule: string
574
- }
575
- }>
576
- | undefined
577
- reactStrictMode?: boolean | undefined
578
- server?:
579
- | {
580
- hostname?: string | undefined
581
- port?: number | undefined
582
- }
583
- | undefined
584
- studioHost?: string | undefined
585
- vite?: UserViteConfig | undefined
586
- typegen?:
587
- | {
588
- formatGeneratedCode: boolean
589
- generates: string
590
- overloadClientMethods: boolean
591
- path: string | string[]
592
- schema: string
593
- }
594
- | undefined
595
- }
596
-
597
- declare type CustomOptOutDirective = z.infer<typeof CustomOptOutDirectiveSchema>
598
-
599
- declare const CustomOptOutDirectiveSchema: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>
600
-
601
- declare type DeclarationId = number & {
602
- [opageDeclarationId]: 'DeclarationId'
603
- }
604
-
605
- /** @beta */
606
- export declare function defineCliConfig(config: CliConfig): CliConfig
607
-
608
- declare type DependencyPath = Array<DependencyPathEntry>
609
-
610
- declare type DependencyPathEntry = {
611
- property: PropertyLiteral
612
- optional: boolean
613
- }
614
-
615
- declare type Destructure = {
616
- kind: 'Destructure'
617
- lvalue: LValuePattern
618
- value: Place
619
- loc: SourceLocation
620
- }
621
-
622
- declare type DoWhileTerminal = {
623
- kind: 'do-while'
624
- loop: BlockId
625
- test: BlockId
626
- fallthrough: BlockId
627
- id: InstructionId
628
- loc: SourceLocation
629
- }
630
-
631
- declare type DynamicGatingOptions = z.infer<typeof DynamicGatingOptionsSchema>
632
-
633
- declare const DynamicGatingOptionsSchema: z.ZodObject<
634
- {
635
- source: z.ZodString
636
- },
637
- z.core.$strip
638
- >
639
-
640
- declare enum Effect {
641
- Unknown = '<unknown>',
642
- Freeze = 'freeze',
643
- Read = 'read',
644
- Capture = 'capture',
645
- ConditionallyMutateIterator = 'mutate-iterator?',
646
- ConditionallyMutate = 'mutate?',
647
- Mutate = 'mutate',
648
- Store = 'store',
649
- }
650
-
651
- declare class Environment {
652
- #private
653
- logger: Logger | null
654
- filename: string | null
655
- code: string | null
656
- config: EnvironmentConfig
657
- fnType: ReactFunctionType
658
- compilerMode: CompilerMode
659
- programContext: ProgramContext
660
- hasFireRewrite: boolean
661
- hasInferredEffect: boolean
662
- inferredEffectLocations: Set<SourceLocation>
663
- parentFunction: NodePath_2<t.Function>
664
- constructor(
665
- scope: Scope,
666
- fnType: ReactFunctionType,
667
- compilerMode: CompilerMode,
668
- config: EnvironmentConfig,
669
- contextIdentifiers: Set<t.Identifier>,
670
- parentFunction: NodePath_2<t.Function>,
671
- logger: Logger | null,
672
- filename: string | null,
673
- code: string | null,
674
- programContext: ProgramContext,
675
- )
676
- get typeContext(): FlowTypeEnv
677
- get isInferredMemoEnabled(): boolean
678
- get nextIdentifierId(): IdentifierId
679
- get nextBlockId(): BlockId
680
- get nextScopeId(): ScopeId
681
- get scope(): Scope
682
- logErrors(errors: Result<void, CompilerError>): void
683
- isContextIdentifier(node: t.Identifier): boolean
684
- isHoistedIdentifier(node: t.Identifier): boolean
685
- generateGloballyUniqueIdentifierName(name: string | null): ValidatedIdentifier
686
- outlineFunction(fn: HIRFunction, type: ReactFunctionType | null): void
687
- getOutlinedFunctions(): Array<{
688
- fn: HIRFunction
689
- type: ReactFunctionType | null
690
- }>
691
- getGlobalDeclaration(binding: NonLocalBinding, loc: SourceLocation): Global_2 | null
692
- static knownReactModules: ReadonlyArray<string>
693
- getFallthroughPropertyType(receiver: Type, _property: Type): BuiltInType | PolyType | null
694
- getPropertyType(receiver: Type, property: string | number): BuiltInType | PolyType | null
695
- getFunctionSignature(type: FunctionType): FunctionSignature | null
696
- addHoistedIdentifier(node: t.Identifier): void
697
- }
698
-
699
- declare type EnvironmentConfig = z.infer<typeof EnvironmentConfigSchema>
700
-
701
- declare const EnvironmentConfigSchema: z.ZodObject<
702
- {
703
- customHooks: z.ZodDefault<
704
- z.ZodMap<
705
- z.ZodString,
706
- z.ZodObject<
707
- {
708
- effectKind: z.ZodEnum<typeof Effect>
709
- valueKind: z.ZodEnum<typeof ValueKind>
710
- noAlias: z.ZodDefault<z.ZodBoolean>
711
- transitiveMixedData: z.ZodDefault<z.ZodBoolean>
712
- },
713
- z.core.$strip
714
- >
715
- >
716
- >
717
- moduleTypeProvider: z.ZodDefault<z.ZodNullable<z.ZodAny>>
718
- customMacros: z.ZodDefault<
719
- z.ZodNullable<
720
- z.ZodArray<
721
- z.ZodUnion<
722
- readonly [
723
- z.ZodString,
724
- z.ZodTuple<
725
- [
726
- z.ZodString,
727
- z.ZodArray<
728
- z.ZodUnion<
729
- readonly [
730
- z.ZodObject<
731
- {
732
- type: z.ZodLiteral<'wildcard'>
733
- },
734
- z.core.$strip
735
- >,
736
- z.ZodObject<
737
- {
738
- type: z.ZodLiteral<'name'>
739
- name: z.ZodString
740
- },
741
- z.core.$strip
742
- >,
743
- ]
744
- >
745
- >,
746
- ],
747
- null
748
- >,
749
- ]
750
- >
751
- >
752
- >
753
- >
754
- enableResetCacheOnSourceFileChanges: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>
755
- enablePreserveExistingMemoizationGuarantees: z.ZodDefault<z.ZodBoolean>
756
- validatePreserveExistingMemoizationGuarantees: z.ZodDefault<z.ZodBoolean>
757
- enablePreserveExistingManualUseMemo: z.ZodDefault<z.ZodBoolean>
758
- enableForest: z.ZodDefault<z.ZodBoolean>
759
- enableUseTypeAnnotations: z.ZodDefault<z.ZodBoolean>
760
- flowTypeProvider: z.ZodDefault<z.ZodNullable<z.ZodAny>>
761
- enableOptionalDependencies: z.ZodDefault<z.ZodBoolean>
762
- enableFire: z.ZodDefault<z.ZodBoolean>
763
- enableNameAnonymousFunctions: z.ZodDefault<z.ZodBoolean>
764
- inferEffectDependencies: z.ZodDefault<
765
- z.ZodNullable<
766
- z.ZodArray<
767
- z.ZodObject<
768
- {
769
- function: z.ZodObject<
770
- {
771
- source: z.ZodString
772
- importSpecifierName: z.ZodString
773
- },
774
- z.core.$strip
775
- >
776
- autodepsIndex: z.ZodNumber
777
- },
778
- z.core.$strip
779
- >
780
- >
781
- >
782
- >
783
- inlineJsxTransform: z.ZodDefault<
784
- z.ZodNullable<
785
- z.ZodObject<
786
- {
787
- elementSymbol: z.ZodUnion<
788
- readonly [z.ZodLiteral<'react.element'>, z.ZodLiteral<'react.transitional.element'>]
789
- >
790
- globalDevVar: z.ZodString
791
- },
792
- z.core.$strip
793
- >
794
- >
795
- >
796
- validateHooksUsage: z.ZodDefault<z.ZodBoolean>
797
- validateRefAccessDuringRender: z.ZodDefault<z.ZodBoolean>
798
- validateNoSetStateInRender: z.ZodDefault<z.ZodBoolean>
799
- validateNoSetStateInEffects: z.ZodDefault<z.ZodBoolean>
800
- validateNoDerivedComputationsInEffects: z.ZodDefault<z.ZodBoolean>
801
- validateNoJSXInTryStatements: z.ZodDefault<z.ZodBoolean>
802
- validateStaticComponents: z.ZodDefault<z.ZodBoolean>
803
- validateMemoizedEffectDependencies: z.ZodDefault<z.ZodBoolean>
804
- validateNoCapitalizedCalls: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>
805
- validateBlocklistedImports: z.ZodDefault<z.ZodNullable<z.ZodArray<z.ZodString>>>
806
- validateNoImpureFunctionsInRender: z.ZodDefault<z.ZodBoolean>
807
- validateNoFreezingKnownMutableFunctions: z.ZodDefault<z.ZodBoolean>
808
- enableAssumeHooksFollowRulesOfReact: z.ZodDefault<z.ZodBoolean>
809
- enableTransitivelyFreezeFunctionExpressions: z.ZodDefault<z.ZodBoolean>
810
- enableEmitFreeze: z.ZodDefault<
811
- z.ZodNullable<
812
- z.ZodObject<
813
- {
814
- source: z.ZodString
815
- importSpecifierName: z.ZodString
816
- },
817
- z.core.$strip
818
- >
819
- >
820
- >
821
- enableEmitHookGuards: z.ZodDefault<
822
- z.ZodNullable<
823
- z.ZodObject<
824
- {
825
- source: z.ZodString
826
- importSpecifierName: z.ZodString
827
- },
828
- z.core.$strip
829
- >
830
- >
831
- >
832
- enableInstructionReordering: z.ZodDefault<z.ZodBoolean>
833
- enableFunctionOutlining: z.ZodDefault<z.ZodBoolean>
834
- enableJsxOutlining: z.ZodDefault<z.ZodBoolean>
835
- enableEmitInstrumentForget: z.ZodDefault<
836
- z.ZodNullable<
837
- z.ZodObject<
838
- {
839
- fn: z.ZodObject<
840
- {
841
- source: z.ZodString
842
- importSpecifierName: z.ZodString
843
- },
844
- z.core.$strip
845
- >
846
- gating: z.ZodNullable<
847
- z.ZodObject<
848
- {
849
- source: z.ZodString
850
- importSpecifierName: z.ZodString
851
- },
852
- z.core.$strip
853
- >
854
- >
855
- globalGating: z.ZodNullable<z.ZodString>
856
- },
857
- z.core.$strip
858
- >
859
- >
860
- >
861
- assertValidMutableRanges: z.ZodDefault<z.ZodBoolean>
862
- enableChangeVariableCodegen: z.ZodDefault<z.ZodBoolean>
863
- enableMemoizationComments: z.ZodDefault<z.ZodBoolean>
864
- throwUnknownException__testonly: z.ZodDefault<z.ZodBoolean>
865
- enableTreatFunctionDepsAsConditional: z.ZodDefault<z.ZodBoolean>
866
- disableMemoizationForDebugging: z.ZodDefault<z.ZodBoolean>
867
- enableChangeDetectionForDebugging: z.ZodDefault<
868
- z.ZodNullable<
869
- z.ZodObject<
870
- {
871
- source: z.ZodString
872
- importSpecifierName: z.ZodString
873
- },
874
- z.core.$strip
875
- >
876
- >
877
- >
878
- enableCustomTypeDefinitionForReanimated: z.ZodDefault<z.ZodBoolean>
879
- hookPattern: z.ZodDefault<z.ZodNullable<z.ZodString>>
880
- enableTreatRefLikeIdentifiersAsRefs: z.ZodDefault<z.ZodBoolean>
881
- enableTreatSetIdentifiersAsStateSetters: z.ZodDefault<z.ZodBoolean>
882
- lowerContextAccess: z.ZodDefault<
883
- z.ZodNullable<
884
- z.ZodObject<
885
- {
886
- source: z.ZodString
887
- importSpecifierName: z.ZodString
888
- },
889
- z.core.$strip
890
- >
891
- >
892
- >
893
- validateNoVoidUseMemo: z.ZodDefault<z.ZodBoolean>
894
- validateNoDynamicallyCreatedComponentsOrHooks: z.ZodDefault<z.ZodBoolean>
895
- enableAllowSetStateFromRefsInEffects: z.ZodDefault<z.ZodBoolean>
896
- },
897
- z.core.$strip
898
- >
899
-
900
- declare class ErrImpl<E> implements Result<never, E> {
901
- #private
902
- constructor(val: E)
903
- map<U>(_fn: (val: never) => U): Result<U, E>
904
- mapErr<F>(fn: (val: E) => F): Result<never, F>
905
- mapOr<U>(fallback: U, _fn: (val: never) => U): U
906
- mapOrElse<U>(fallback: () => U, _fn: (val: never) => U): U
907
- andThen<U>(_fn: (val: never) => Result<U, E>): Result<U, E>
908
- and<U>(_res: Result<U, E>): Result<U, E>
909
- or(res: Result<never, E>): Result<never, E>
910
- orElse<F>(fn: (val: E) => ErrImpl<F>): Result<never, F>
911
- isOk(): this is OkImpl<never>
912
- isErr(): this is ErrImpl<E>
913
- expect(msg: string): never
914
- expectErr(_msg: string): E
915
- unwrap(): never
916
- unwrapOr<T>(fallback: T): T
917
- unwrapOrElse<T>(fallback: (val: E) => T): T
918
- unwrapErr(): E
919
- }
920
-
921
- declare enum ErrorCategory {
922
- Hooks = 'Hooks',
923
- CapitalizedCalls = 'CapitalizedCalls',
924
- StaticComponents = 'StaticComponents',
925
- UseMemo = 'UseMemo',
926
- Factories = 'Factories',
927
- PreserveManualMemo = 'PreserveManualMemo',
928
- IncompatibleLibrary = 'IncompatibleLibrary',
929
- Immutability = 'Immutability',
930
- Globals = 'Globals',
931
- Refs = 'Refs',
932
- EffectDependencies = 'EffectDependencies',
933
- EffectSetState = 'EffectSetState',
934
- EffectDerivationsOfState = 'EffectDerivationsOfState',
935
- ErrorBoundaries = 'ErrorBoundaries',
936
- Purity = 'Purity',
937
- RenderSetState = 'RenderSetState',
938
- Invariant = 'Invariant',
939
- Todo = 'Todo',
940
- Syntax = 'Syntax',
941
- UnsupportedSyntax = 'UnsupportedSyntax',
942
- Config = 'Config',
943
- Gating = 'Gating',
944
- Suppression = 'Suppression',
945
- AutomaticEffectDependencies = 'AutomaticEffectDependencies',
946
- Fire = 'Fire',
947
- FBT = 'FBT',
948
- }
949
-
950
- declare enum ErrorSeverity {
951
- Error = 'Error',
952
- Warning = 'Warning',
953
- Hint = 'Hint',
954
- Off = 'Off',
955
- }
956
-
957
- declare type ExternalFunction = z.infer<typeof ExternalFunctionSchema>
958
-
959
- declare const ExternalFunctionSchema: z.ZodObject<
960
- {
961
- source: z.ZodString
962
- importSpecifierName: z.ZodString
963
- },
964
- z.core.$strip
965
- >
966
-
967
- declare type FinishMemoize = {
968
- kind: 'FinishMemoize'
969
- manualMemoId: number
970
- decl: Place
971
- pruned?: true
972
- loc: SourceLocation
973
- }
974
-
975
- declare class FlowTypeEnv implements ITypeEnv {
976
- #private
977
- moduleEnv: Map<string, ResolvedType>
978
- init(env: Environment, source: string): void
979
- setType(identifier: Identifier, type: ResolvedType): void
980
- getType(identifier: Identifier): ResolvedType
981
- getTypeOrNull(identifier: Identifier): ResolvedType | null
982
- getTypeByLoc(loc: SourceLocation): ResolvedType | null
983
- nextNominalId(): NominalId
984
- nextTypeParameterId(): TypeParameterId
985
- addBinding(bindingIdentifier: t.Identifier, type: ResolvedType): void
986
- resolveBinding(bindingIdentifier: t.Identifier): ResolvedType | null
987
- pushGeneric(name: string, generic: TypeParameter<ResolvedType>): void
988
- popGeneric(name: string): void
989
- getGeneric(name: string): null | TypeParameter<ResolvedType>
990
- }
991
-
992
- declare type ForInTerminal = {
993
- kind: 'for-in'
994
- loc: SourceLocation
995
- init: BlockId
996
- loop: BlockId
997
- fallthrough: BlockId
998
- id: InstructionId
999
- }
1000
-
1001
- declare type ForOfTerminal = {
1002
- kind: 'for-of'
1003
- loc: SourceLocation
1004
- init: BlockId
1005
- test: BlockId
1006
- loop: BlockId
1007
- fallthrough: BlockId
1008
- id: InstructionId
1009
- }
1010
-
1011
- declare type ForTerminal = {
1012
- kind: 'for'
1013
- loc: SourceLocation
1014
- init: BlockId
1015
- test: BlockId
1016
- update: BlockId | null
1017
- loop: BlockId
1018
- fallthrough: BlockId
1019
- id: InstructionId
1020
- }
1021
-
1022
- declare type FunctionExpression = {
1023
- kind: 'FunctionExpression'
1024
- name: ValidIdentifierName | null
1025
- nameHint: string | null
1026
- loweredFunc: LoweredFunction
1027
- type: 'ArrowFunctionExpression' | 'FunctionExpression' | 'FunctionDeclaration'
1028
- loc: SourceLocation
1029
- }
1030
-
1031
- declare type FunctionSignature = {
1032
- positionalParams: Array<Effect>
1033
- restParam: Effect | null
1034
- returnType: BuiltInType | PolyType
1035
- returnValueKind: ValueKind
1036
- returnValueReason?: ValueReason
1037
- calleeEffect: Effect
1038
- hookKind: HookKind | null
1039
- noAlias?: boolean
1040
- mutableOnlyIfOperandsAreMutable?: boolean
1041
- impure?: boolean
1042
- knownIncompatible?: string | null | undefined
1043
- canonicalName?: string
1044
- aliasing?: AliasingSignature | null | undefined
1045
- }
1046
-
1047
- declare type FunctionType = {
1048
- kind: 'Function'
1049
- shapeId: string | null
1050
- return: Type
1051
- isConstructor: boolean
1052
- }
1053
-
1054
- declare const GeneratedSource: unique symbol
1055
-
1056
- /**
1057
- * @public
1058
- *
1059
- * @param options - The options to use for the client.
1060
- * @returns A configured Sanity API client.
1061
- */
1062
- export declare const getCliClient: CliClientGetter
1063
-
1064
- declare type Global_2 = BuiltInType | PolyType
1065
-
1066
- declare type GotoTerminal = {
1067
- kind: 'goto'
1068
- block: BlockId
1069
- variant: GotoVariant
1070
- id: InstructionId
1071
- loc: SourceLocation
1072
- fallthrough?: never
1073
- }
1074
-
1075
- declare enum GotoVariant {
1076
- Break = 'Break',
1077
- Continue = 'Continue',
1078
- Try = 'Try',
1079
- }
1080
-
1081
- declare type HIR = {
1082
- entry: BlockId
1083
- blocks: Map<BlockId, BasicBlock>
1084
- }
1085
-
1086
- declare type HIRFunction = {
1087
- loc: SourceLocation
1088
- id: ValidIdentifierName | null
1089
- nameHint: string | null
1090
- fnType: ReactFunctionType
1091
- env: Environment
1092
- params: Array<Place | SpreadPattern>
1093
- returnTypeAnnotation: t.FlowType | t.TSType | null
1094
- returns: Place
1095
- context: Array<Place>
1096
- body: HIR
1097
- generator: boolean
1098
- async: boolean
1099
- directives: Array<string>
1100
- aliasingEffects: Array<AliasingEffect> | null
1101
- }
1102
-
1103
- declare type Hole = {
1104
- kind: 'Hole'
1105
- }
1106
-
1107
- declare type HookKind =
1108
- | 'useContext'
1109
- | 'useState'
1110
- | 'useActionState'
1111
- | 'useReducer'
1112
- | 'useRef'
1113
- | 'useEffect'
1114
- | 'useLayoutEffect'
1115
- | 'useInsertionEffect'
1116
- | 'useMemo'
1117
- | 'useCallback'
1118
- | 'useTransition'
1119
- | 'useImperativeHandle'
1120
- | 'useEffectEvent'
1121
- | 'Custom'
1122
-
1123
- declare type Identifier = {
1124
- id: IdentifierId
1125
- declarationId: DeclarationId
1126
- name: IdentifierName | null
1127
- mutableRange: MutableRange
1128
- scope: ReactiveScope | null
1129
- type: Type
1130
- loc: SourceLocation
1131
- }
1132
-
1133
- declare type IdentifierId = number & {
1134
- [opaqueIdentifierId]: 'IdentifierId'
1135
- }
1136
-
1137
- declare type IdentifierName = ValidatedIdentifier | PromotedIdentifier
1138
-
1139
- declare type IfTerminal = {
1140
- kind: 'if'
1141
- test: Place
1142
- consequent: BlockId
1143
- alternate: BlockId
1144
- fallthrough: BlockId
1145
- id: InstructionId
1146
- loc: SourceLocation
1147
- }
1148
-
1149
- declare type Instruction = {
1150
- id: InstructionId
1151
- lvalue: Place
1152
- value: InstructionValue
1153
- loc: SourceLocation
1154
- effects: Array<AliasingEffect> | null
1155
- }
1156
-
1157
- declare type InstructionId = number & {
1158
- [opaqueInstructionId]: 'IdentifierId'
1159
- }
1160
-
1161
- declare enum InstructionKind {
1162
- Const = 'Const',
1163
- Let = 'Let',
1164
- Reassign = 'Reassign',
1165
- Catch = 'Catch',
1166
- HoistedConst = 'HoistedConst',
1167
- HoistedLet = 'HoistedLet',
1168
- HoistedFunction = 'HoistedFunction',
1169
- Function = 'Function',
1170
- }
1171
-
1172
- declare type InstructionValue =
1173
- | LoadLocal
1174
- | LoadContext
1175
- | {
1176
- kind: 'DeclareLocal'
1177
- lvalue: LValue
1178
- type: t.FlowType | t.TSType | null
1179
- loc: SourceLocation
1180
- }
1181
- | {
1182
- kind: 'DeclareContext'
1183
- lvalue: {
1184
- kind:
1185
- | InstructionKind.Let
1186
- | InstructionKind.HoistedConst
1187
- | InstructionKind.HoistedLet
1188
- | InstructionKind.HoistedFunction
1189
- place: Place
1190
- }
1191
- loc: SourceLocation
1192
- }
1193
- | StoreLocal
1194
- | {
1195
- kind: 'StoreContext'
1196
- lvalue: {
1197
- kind:
1198
- | InstructionKind.Reassign
1199
- | InstructionKind.Const
1200
- | InstructionKind.Let
1201
- | InstructionKind.Function
1202
- place: Place
1203
- }
1204
- value: Place
1205
- loc: SourceLocation
1206
- }
1207
- | Destructure
1208
- | {
1209
- kind: 'Primitive'
1210
- value: number | boolean | string | null | undefined
1211
- loc: SourceLocation
1212
- }
1213
- | JSXText
1214
- | {
1215
- kind: 'BinaryExpression'
1216
- operator: Exclude<t.BinaryExpression['operator'], '|>'>
1217
- left: Place
1218
- right: Place
1219
- loc: SourceLocation
1220
- }
1221
- | NewExpression
1222
- | CallExpression
1223
- | MethodCall
1224
- | {
1225
- kind: 'UnaryExpression'
1226
- operator: Exclude<t.UnaryExpression['operator'], 'throw' | 'delete'>
1227
- value: Place
1228
- loc: SourceLocation
1229
- }
1230
- | ({
1231
- kind: 'TypeCastExpression'
1232
- value: Place
1233
- type: Type
1234
- loc: SourceLocation
1235
- } & (
1236
- | {
1237
- typeAnnotation: t.FlowType
1238
- typeAnnotationKind: 'cast'
1239
- }
1240
- | {
1241
- typeAnnotation: t.TSType
1242
- typeAnnotationKind: 'as' | 'satisfies'
1243
- }
1244
- ))
1245
- | JsxExpression
1246
- | {
1247
- kind: 'ObjectExpression'
1248
- properties: Array<ObjectProperty | SpreadPattern>
1249
- loc: SourceLocation
1250
- }
1251
- | ObjectMethod
1252
- | ArrayExpression
1253
- | {
1254
- kind: 'JsxFragment'
1255
- children: Array<Place>
1256
- loc: SourceLocation
1257
- }
1258
- | {
1259
- kind: 'RegExpLiteral'
1260
- pattern: string
1261
- flags: string
1262
- loc: SourceLocation
1263
- }
1264
- | {
1265
- kind: 'MetaProperty'
1266
- meta: string
1267
- property: string
1268
- loc: SourceLocation
1269
- }
1270
- | {
1271
- kind: 'PropertyStore'
1272
- object: Place
1273
- property: PropertyLiteral
1274
- value: Place
1275
- loc: SourceLocation
1276
- }
1277
- | PropertyLoad
1278
- | {
1279
- kind: 'PropertyDelete'
1280
- object: Place
1281
- property: PropertyLiteral
1282
- loc: SourceLocation
1283
- }
1284
- | {
1285
- kind: 'ComputedStore'
1286
- object: Place
1287
- property: Place
1288
- value: Place
1289
- loc: SourceLocation
1290
- }
1291
- | {
1292
- kind: 'ComputedLoad'
1293
- object: Place
1294
- property: Place
1295
- loc: SourceLocation
1296
- }
1297
- | {
1298
- kind: 'ComputedDelete'
1299
- object: Place
1300
- property: Place
1301
- loc: SourceLocation
1302
- }
1303
- | LoadGlobal
1304
- | StoreGlobal
1305
- | FunctionExpression
1306
- | {
1307
- kind: 'TaggedTemplateExpression'
1308
- tag: Place
1309
- value: {
1310
- raw: string
1311
- cooked?: string
1312
- }
1313
- loc: SourceLocation
1314
- }
1315
- | {
1316
- kind: 'TemplateLiteral'
1317
- subexprs: Array<Place>
1318
- quasis: Array<{
1319
- raw: string
1320
- cooked?: string
1321
- }>
1322
- loc: SourceLocation
1323
- }
1324
- | {
1325
- kind: 'Await'
1326
- value: Place
1327
- loc: SourceLocation
1328
- }
1329
- | {
1330
- kind: 'GetIterator'
1331
- collection: Place
1332
- loc: SourceLocation
1333
- }
1334
- | {
1335
- kind: 'IteratorNext'
1336
- iterator: Place
1337
- collection: Place
1338
- loc: SourceLocation
1339
- }
1340
- | {
1341
- kind: 'NextPropertyOf'
1342
- value: Place
1343
- loc: SourceLocation
1344
- }
1345
- | {
1346
- kind: 'PrefixUpdate'
1347
- lvalue: Place
1348
- operation: t.UpdateExpression['operator']
1349
- value: Place
1350
- loc: SourceLocation
1351
- }
1352
- | {
1353
- kind: 'PostfixUpdate'
1354
- lvalue: Place
1355
- operation: t.UpdateExpression['operator']
1356
- value: Place
1357
- loc: SourceLocation
1358
- }
1359
- | {
1360
- kind: 'Debugger'
1361
- loc: SourceLocation
1362
- }
1363
- | StartMemoize
1364
- | FinishMemoize
1365
- | {
1366
- kind: 'UnsupportedNode'
1367
- node: t.Node
1368
- loc: SourceLocation
1369
- }
1370
-
1371
- declare interface ITypeEnv {
1372
- popGeneric(name: string): void
1373
- getGeneric(name: string): null | TypeParameter<ResolvedType>
1374
- pushGeneric(
1375
- name: string,
1376
- binding: {
1377
- name: string
1378
- id: TypeParameterId
1379
- bound: ResolvedType
1380
- },
1381
- ): void
1382
- getType(id: Identifier): ResolvedType
1383
- getTypeOrNull(id: Identifier): ResolvedType | null
1384
- setType(id: Identifier, type: ResolvedType): void
1385
- nextNominalId(): NominalId
1386
- nextTypeParameterId(): TypeParameterId
1387
- moduleEnv: Map<string, ResolvedType>
1388
- addBinding(bindingIdentifier: t.Identifier, type: ResolvedType): void
1389
- resolveBinding(bindingIdentifier: t.Identifier): ResolvedType | null
1390
- }
1391
-
1392
- declare type JsxAttribute =
1393
- | {
1394
- kind: 'JsxSpreadAttribute'
1395
- argument: Place
1396
- }
1397
- | {
1398
- kind: 'JsxAttribute'
1399
- name: string
1400
- place: Place
1401
- }
1402
-
1403
- declare type JsxExpression = {
1404
- kind: 'JsxExpression'
1405
- tag: Place | BuiltinTag
1406
- props: Array<JsxAttribute>
1407
- children: Array<Place> | null
1408
- loc: SourceLocation
1409
- openingLoc: SourceLocation
1410
- closingLoc: SourceLocation
1411
- }
1412
-
1413
- declare type JSXText = {
1414
- kind: 'JSXText'
1415
- value: string
1416
- loc: SourceLocation
1417
- }
1418
-
1419
- declare type LabelTerminal = {
1420
- kind: 'label'
1421
- block: BlockId
1422
- fallthrough: BlockId
1423
- id: InstructionId
1424
- loc: SourceLocation
1425
- }
1426
-
1427
- declare type LinearId = number & {
1428
- [opaqueLinearId]: 'LinearId'
1429
- }
1430
-
1431
- declare type LoadContext = {
1432
- kind: 'LoadContext'
1433
- place: Place
1434
- loc: SourceLocation
1435
- }
1436
-
1437
- export {loadEnv}
1438
-
1439
- declare type LoadGlobal = {
1440
- kind: 'LoadGlobal'
1441
- binding: NonLocalBinding
1442
- loc: SourceLocation
1443
- }
1444
-
1445
- declare type LoadLocal = {
1446
- kind: 'LoadLocal'
1447
- place: Place
1448
- loc: SourceLocation
1449
- }
1450
-
1451
- declare type Logger = {
1452
- logEvent: (filename: string | null, event: LoggerEvent) => void
1453
- debugLogIRs?: (value: CompilerPipelineValue) => void
1454
- }
1455
-
1456
- declare type LoggerEvent =
1457
- | CompileSuccessEvent
1458
- | CompileErrorEvent
1459
- | CompileDiagnosticEvent
1460
- | CompileSkipEvent
1461
- | PipelineErrorEvent
1462
- | TimingEvent
1463
- | AutoDepsDecorationsEvent
1464
- | AutoDepsEligibleEvent
1465
-
1466
- declare type LogicalTerminal = {
1467
- kind: 'logical'
1468
- operator: t.LogicalExpression['operator']
1469
- test: BlockId
1470
- fallthrough: BlockId
1471
- id: InstructionId
1472
- loc: SourceLocation
1473
- }
1474
-
1475
- declare type LoweredFunction = {
1476
- func: HIRFunction
1477
- }
1478
-
1479
- declare type LValue = {
1480
- place: Place
1481
- kind: InstructionKind
1482
- }
1483
-
1484
- declare type LValuePattern = {
1485
- pattern: Pattern
1486
- kind: InstructionKind
1487
- }
1488
-
1489
- declare type ManualMemoDependency = {
1490
- root:
1491
- | {
1492
- kind: 'NamedLocal'
1493
- value: Place
1494
- }
1495
- | {
1496
- kind: 'Global'
1497
- identifierName: string
1498
- }
1499
- path: DependencyPath
1500
- }
1501
-
1502
- declare type MaybeThrowTerminal = {
1503
- kind: 'maybe-throw'
1504
- continuation: BlockId
1505
- handler: BlockId
1506
- id: InstructionId
1507
- loc: SourceLocation
1508
- fallthrough?: never
1509
- effects: Array<AliasingEffect> | null
1510
- }
1511
-
1512
- declare type MethodCall = {
1513
- kind: 'MethodCall'
1514
- receiver: Place
1515
- property: Place
1516
- args: Array<Place | SpreadPattern>
1517
- loc: SourceLocation
1518
- }
1519
-
1520
- declare type MutableRange = {
1521
- start: InstructionId
1522
- end: InstructionId
1523
- }
1524
-
1525
- declare type MutationReason = {
1526
- kind: 'AssignCurrentProperty'
1527
- }
1528
-
1529
- declare type NewExpression = {
1530
- kind: 'NewExpression'
1531
- callee: Place
1532
- args: Array<Place | SpreadPattern>
1533
- loc: SourceLocation
1534
- }
1535
-
1536
- declare type NominalId = number & {
1537
- [opaqueNominalId]: 'NominalId'
1538
- }
1539
-
1540
- declare type NonLocalBinding =
1541
- | {
1542
- kind: 'ImportDefault'
1543
- name: string
1544
- module: string
1545
- }
1546
- | {
1547
- kind: 'ImportNamespace'
1548
- name: string
1549
- module: string
1550
- }
1551
- | NonLocalImportSpecifier
1552
- | {
1553
- kind: 'ModuleLocal'
1554
- name: string
1555
- }
1556
- | {
1557
- kind: 'Global'
1558
- name: string
1559
- }
1560
-
1561
- declare type NonLocalImportSpecifier = {
1562
- kind: 'ImportSpecifier'
1563
- name: string
1564
- module: string
1565
- imported: string
1566
- }
1567
-
1568
- declare type ObjectMethod$1 = {
1569
- kind: 'ObjectMethod'
1570
- }
1571
-
1572
- declare type ObjectMethod = {
1573
- kind: 'ObjectMethod'
1574
- loc: SourceLocation
1575
- loweredFunc: LoweredFunction
1576
- }
1577
-
1578
- declare type ObjectPattern = {
1579
- kind: 'ObjectPattern'
1580
- properties: Array<ObjectProperty | SpreadPattern>
1581
- }
1582
-
1583
- declare type ObjectProperty = {
1584
- kind: 'ObjectProperty'
1585
- key: ObjectPropertyKey
1586
- type: 'property' | 'method'
1587
- place: Place
1588
- }
1589
-
1590
- declare type ObjectPropertyKey =
1591
- | {
1592
- kind: 'string'
1593
- name: string
1594
- }
1595
- | {
1596
- kind: 'identifier'
1597
- name: string
1598
- }
1599
- | {
1600
- kind: 'computed'
1601
- name: Place
1602
- }
1603
- | {
1604
- kind: 'number'
1605
- name: number
1606
- }
1607
-
1608
- declare type ObjectType = {
1609
- kind: 'Object'
1610
- shapeId: string | null
1611
- }
1612
-
1613
- declare class OkImpl<T> implements Result<T, never> {
1614
- #private
1615
- constructor(val: T)
1616
- map<U>(fn: (val: T) => U): Result<U, never>
1617
- mapErr<F>(_fn: (val: never) => F): Result<T, F>
1618
- mapOr<U>(_fallback: U, fn: (val: T) => U): U
1619
- mapOrElse<U>(_fallback: () => U, fn: (val: T) => U): U
1620
- andThen<U>(fn: (val: T) => Result<U, never>): Result<U, never>
1621
- and<U>(res: Result<U, never>): Result<U, never>
1622
- or(_res: Result<T, never>): Result<T, never>
1623
- orElse<F>(_fn: (val: never) => Result<T, F>): Result<T, F>
1624
- isOk(): this is OkImpl<T>
1625
- isErr(): this is ErrImpl<never>
1626
- expect(_msg: string): T
1627
- expectErr(msg: string): never
1628
- unwrap(): T
1629
- unwrapOr(_fallback: T): T
1630
- unwrapOrElse(_fallback: (val: never) => T): T
1631
- unwrapErr(): never
1632
- }
1633
-
1634
- declare const opageDeclarationId: unique symbol
1635
-
1636
- declare const opaqueBlockId: unique symbol
1637
-
1638
- declare const opaqueIdentifierId: unique symbol
1639
-
1640
- declare const opaqueInstructionId: unique symbol
1641
-
1642
- declare const opaqueLinearId: unique symbol
1643
-
1644
- declare const opaqueNominalId: unique symbol
1645
-
1646
- declare const opaquePropertyLiteral: unique symbol
1647
-
1648
- declare const opaqueScopeId: unique symbol
1649
-
1650
- declare const opaqueTypeId: unique symbol
1651
-
1652
- declare const opaqueTypeParameterId: unique symbol
1653
-
1654
- declare const opaqueValidIdentifierName: unique symbol
1655
-
1656
- declare type OptionalTerminal = {
1657
- kind: 'optional'
1658
- optional: boolean
1659
- test: BlockId
1660
- fallthrough: BlockId
1661
- id: InstructionId
1662
- loc: SourceLocation
1663
- }
1664
-
1665
- /**
1666
- * @public
1667
- */
1668
- export declare interface PackageJson {
1669
- name: string
1670
- version: string
1671
- author?: string
1672
- dependencies?: Record<string, string>
1673
- description?: string
1674
- devDependencies?: Record<string, string>
1675
- engines?: Record<string, string>
1676
- license?: string
1677
- peerDependencies?: Record<string, string>
1678
- private?: boolean
1679
- repository?: {
1680
- type: string
1681
- url: string
1682
- }
1683
- scripts?: Record<string, string>
1684
- }
1685
-
1686
- declare type PanicThresholdOptions = z.infer<typeof PanicThresholdOptionsSchema>
1687
-
1688
- declare const PanicThresholdOptionsSchema: z.ZodEnum<{
1689
- none: 'none'
1690
- all_errors: 'all_errors'
1691
- critical_errors: 'critical_errors'
1692
- }>
1693
-
1694
- declare type ParsedPluginOptions = Required<Omit<PluginOptions, 'environment'>> & {
1695
- environment: EnvironmentConfig
1696
- }
1697
-
1698
- declare type Pattern = ArrayPattern | ObjectPattern
1699
-
1700
- declare type Phi = {
1701
- kind: 'Phi'
1702
- place: Place
1703
- operands: Map<BlockId, Place>
1704
- }
1705
-
1706
- declare type PhiType = {
1707
- kind: 'Phi'
1708
- operands: Array<Type>
1709
- }
1710
-
1711
- declare type PipelineErrorEvent = {
1712
- kind: 'PipelineError'
1713
- fnLoc: t.SourceLocation | null
1714
- data: string
1715
- }
1716
-
1717
- declare type Place = {
1718
- kind: 'Identifier'
1719
- identifier: Identifier
1720
- effect: Effect
1721
- reactive: boolean
1722
- loc: SourceLocation
1723
- }
1724
-
1725
- declare type Platform = 'client' | 'server' | 'shared'
1726
-
1727
- declare type PluginOptions = Partial<{
1728
- environment: Partial<EnvironmentConfig>
1729
- logger: Logger | null
1730
- gating: ExternalFunction | null
1731
- dynamicGating: DynamicGatingOptions | null
1732
- panicThreshold: PanicThresholdOptions
1733
- noEmit: boolean
1734
- compilationMode: CompilationMode
1735
- eslintSuppressionRules: Array<string> | null | undefined
1736
- flowSuppressions: boolean
1737
- ignoreUseNoForget: boolean
1738
- customOptOutDirectives: CustomOptOutDirective
1739
- sources: Array<string> | ((filename: string) => boolean) | null
1740
- enableReanimatedCheck: boolean
1741
- target: CompilerReactTarget
1742
- }>
1743
-
1744
- declare type PolyType = {
1745
- kind: 'Poly'
1746
- }
1747
-
1748
- declare type PrimitiveType = {
1749
- kind: 'Primitive'
1750
- }
1751
-
1752
- declare type PrintErrorMessageOptions = {
1753
- eslint: boolean
1754
- }
1755
-
1756
- declare class ProgramContext {
1757
- scope: Scope
1758
- opts: ParsedPluginOptions
1759
- filename: string | null
1760
- code: string | null
1761
- reactRuntimeModule: string
1762
- suppressions: Array<SuppressionRange>
1763
- hasModuleScopeOptOut: boolean
1764
- alreadyCompiled: WeakSet<object> | Set<object>
1765
- knownReferencedNames: Set<string>
1766
- imports: Map<string, Map<string, NonLocalImportSpecifier>>
1767
- retryErrors: Array<{
1768
- fn: BabelFn
1769
- error: CompilerError
1770
- }>
1771
- inferredEffectLocations: Set<t.SourceLocation>
1772
- constructor({
1773
- program,
1774
- suppressions,
1775
- opts,
1776
- filename,
1777
- code,
1778
- hasModuleScopeOptOut,
1779
- }: ProgramContextOptions)
1780
- isHookName(name: string): boolean
1781
- hasReference(name: string): boolean
1782
- newUid(name: string): string
1783
- addMemoCacheImport(): NonLocalImportSpecifier
1784
- addImportSpecifier(
1785
- {source: module, importSpecifierName: specifier}: ExternalFunction,
1786
- nameHint?: string,
1787
- ): NonLocalImportSpecifier
1788
- addNewReference(name: string): void
1789
- assertGlobalBinding(name: string, localScope?: Scope): Result<void, CompilerError>
1790
- logEvent(event: LoggerEvent): void
1791
- }
1792
-
1793
- declare type ProgramContextOptions = {
1794
- program: NodePath<t.Program>
1795
- suppressions: Array<SuppressionRange>
1796
- opts: ParsedPluginOptions
1797
- filename: string | null
1798
- code: string | null
1799
- hasModuleScopeOptOut: boolean
1800
- }
1801
-
1802
- declare type PromotedIdentifier = {
1803
- kind: 'promoted'
1804
- value: string
1805
- }
1806
-
1807
- declare type PropertyLiteral = (string | number) & {
1808
- [opaquePropertyLiteral]: 'PropertyLiteral'
1809
- }
1810
-
1811
- declare type PropertyLoad = {
1812
- kind: 'PropertyLoad'
1813
- object: Place
1814
- property: PropertyLiteral
1815
- loc: SourceLocation
1816
- }
1817
-
1818
- declare type PropType = {
1819
- kind: 'Property'
1820
- objectType: Type
1821
- objectName: string
1822
- propertyName:
1823
- | {
1824
- kind: 'literal'
1825
- value: PropertyLiteral
1826
- }
1827
- | {
1828
- kind: 'computed'
1829
- value: Type
1830
- }
1831
- }
1832
-
1833
- declare type PrunedReactiveScopeBlock = {
1834
- kind: 'pruned-scope'
1835
- scope: ReactiveScope
1836
- instructions: ReactiveBlock
1837
- }
1838
-
1839
- declare type PrunedScopeTerminal = {
1840
- kind: 'pruned-scope'
1841
- fallthrough: BlockId
1842
- block: BlockId
1843
- scope: ReactiveScope
1844
- id: InstructionId
1845
- loc: SourceLocation
1846
- }
1847
-
1848
- declare type ReactFunctionType = 'Component' | 'Hook' | 'Other'
1849
-
1850
- declare type ReactiveBlock = Array<ReactiveStatement>
1851
-
1852
- declare type ReactiveBreakTerminal = {
1853
- kind: 'break'
1854
- target: BlockId
1855
- id: InstructionId
1856
- targetKind: ReactiveTerminalTargetKind
1857
- loc: SourceLocation
1858
- }
1859
-
1860
- declare type ReactiveContinueTerminal = {
1861
- kind: 'continue'
1862
- target: BlockId
1863
- id: InstructionId
1864
- targetKind: ReactiveTerminalTargetKind
1865
- loc: SourceLocation
1866
- }
1867
-
1868
- declare type ReactiveDoWhileTerminal = {
1869
- kind: 'do-while'
1870
- loop: ReactiveBlock
1871
- test: ReactiveValue
1872
- id: InstructionId
1873
- loc: SourceLocation
1874
- }
1875
-
1876
- declare type ReactiveForInTerminal = {
1877
- kind: 'for-in'
1878
- init: ReactiveValue
1879
- loop: ReactiveBlock
1880
- id: InstructionId
1881
- loc: SourceLocation
1882
- }
1883
-
1884
- declare type ReactiveForOfTerminal = {
1885
- kind: 'for-of'
1886
- init: ReactiveValue
1887
- test: ReactiveValue
1888
- loop: ReactiveBlock
1889
- id: InstructionId
1890
- loc: SourceLocation
1891
- }
1892
-
1893
- declare type ReactiveForTerminal = {
1894
- kind: 'for'
1895
- init: ReactiveValue
1896
- test: ReactiveValue
1897
- update: ReactiveValue | null
1898
- loop: ReactiveBlock
1899
- id: InstructionId
1900
- loc: SourceLocation
1901
- }
1902
-
1903
- declare type ReactiveFunction = {
1904
- loc: SourceLocation
1905
- id: ValidIdentifierName | null
1906
- nameHint: string | null
1907
- params: Array<Place | SpreadPattern>
1908
- generator: boolean
1909
- async: boolean
1910
- body: ReactiveBlock
1911
- env: Environment
1912
- directives: Array<string>
1913
- }
1914
-
1915
- declare type ReactiveIfTerminal = {
1916
- kind: 'if'
1917
- test: Place
1918
- consequent: ReactiveBlock
1919
- alternate: ReactiveBlock | null
1920
- id: InstructionId
1921
- loc: SourceLocation
1922
- }
1923
-
1924
- declare type ReactiveInstruction = {
1925
- id: InstructionId
1926
- lvalue: Place | null
1927
- value: ReactiveValue
1928
- effects?: Array<AliasingEffect> | null
1929
- loc: SourceLocation
1930
- }
1931
-
1932
- declare type ReactiveInstructionStatement = {
1933
- kind: 'instruction'
1934
- instruction: ReactiveInstruction
1935
- }
1936
-
1937
- declare type ReactiveLabelTerminal = {
1938
- kind: 'label'
1939
- block: ReactiveBlock
1940
- id: InstructionId
1941
- loc: SourceLocation
1942
- }
1943
-
1944
- declare type ReactiveLogicalValue = {
1945
- kind: 'LogicalExpression'
1946
- operator: t.LogicalExpression['operator']
1947
- left: ReactiveValue
1948
- right: ReactiveValue
1949
- loc: SourceLocation
1950
- }
1951
-
1952
- declare type ReactiveOptionalCallValue = {
1953
- kind: 'OptionalExpression'
1954
- id: InstructionId
1955
- value: ReactiveValue
1956
- optional: boolean
1957
- loc: SourceLocation
1958
- }
1959
-
1960
- declare type ReactiveReturnTerminal = {
1961
- kind: 'return'
1962
- value: Place
1963
- id: InstructionId
1964
- loc: SourceLocation
1965
- }
1966
-
1967
- declare type ReactiveScope = {
1968
- id: ScopeId
1969
- range: MutableRange
1970
- dependencies: ReactiveScopeDependencies
1971
- declarations: Map<IdentifierId, ReactiveScopeDeclaration>
1972
- reassignments: Set<Identifier>
1973
- earlyReturnValue: {
1974
- value: Identifier
1975
- loc: SourceLocation
1976
- label: BlockId
1977
- } | null
1978
- merged: Set<ScopeId>
1979
- loc: SourceLocation
1980
- }
1981
-
1982
- declare type ReactiveScopeBlock = {
1983
- kind: 'scope'
1984
- scope: ReactiveScope
1985
- instructions: ReactiveBlock
1986
- }
1987
-
1988
- declare type ReactiveScopeDeclaration = {
1989
- identifier: Identifier
1990
- scope: ReactiveScope
1991
- }
1992
-
1993
- declare type ReactiveScopeDependencies = Set<ReactiveScopeDependency>
1994
-
1995
- declare type ReactiveScopeDependency = {
1996
- identifier: Identifier
1997
- reactive: boolean
1998
- path: DependencyPath
1999
- }
2000
-
2001
- declare type ReactiveScopeTerminal = {
2002
- kind: 'scope'
2003
- fallthrough: BlockId
2004
- block: BlockId
2005
- scope: ReactiveScope
2006
- id: InstructionId
2007
- loc: SourceLocation
2008
- }
2009
-
2010
- declare type ReactiveSequenceValue = {
2011
- kind: 'SequenceExpression'
2012
- instructions: Array<ReactiveInstruction>
2013
- id: InstructionId
2014
- value: ReactiveValue
2015
- loc: SourceLocation
2016
- }
2017
-
2018
- declare type ReactiveStatement =
2019
- | ReactiveInstructionStatement
2020
- | ReactiveTerminalStatement
2021
- | ReactiveScopeBlock
2022
- | PrunedReactiveScopeBlock
2023
-
2024
- declare type ReactiveSwitchTerminal = {
2025
- kind: 'switch'
2026
- test: Place
2027
- cases: Array<{
2028
- test: Place | null
2029
- block: ReactiveBlock | void
2030
- }>
2031
- id: InstructionId
2032
- loc: SourceLocation
2033
- }
2034
-
2035
- declare type ReactiveTerminal =
2036
- | ReactiveBreakTerminal
2037
- | ReactiveContinueTerminal
2038
- | ReactiveReturnTerminal
2039
- | ReactiveThrowTerminal
2040
- | ReactiveSwitchTerminal
2041
- | ReactiveDoWhileTerminal
2042
- | ReactiveWhileTerminal
2043
- | ReactiveForTerminal
2044
- | ReactiveForOfTerminal
2045
- | ReactiveForInTerminal
2046
- | ReactiveIfTerminal
2047
- | ReactiveLabelTerminal
2048
- | ReactiveTryTerminal
2049
-
2050
- declare type ReactiveTerminalStatement<Tterminal extends ReactiveTerminal = ReactiveTerminal> = {
2051
- kind: 'terminal'
2052
- terminal: Tterminal
2053
- label: {
2054
- id: BlockId
2055
- implicit: boolean
2056
- } | null
2057
- }
2058
-
2059
- declare type ReactiveTerminalTargetKind = 'implicit' | 'labeled' | 'unlabeled'
2060
-
2061
- declare type ReactiveTernaryValue = {
2062
- kind: 'ConditionalExpression'
2063
- test: ReactiveValue
2064
- consequent: ReactiveValue
2065
- alternate: ReactiveValue
2066
- loc: SourceLocation
2067
- }
2068
-
2069
- declare type ReactiveThrowTerminal = {
2070
- kind: 'throw'
2071
- value: Place
2072
- id: InstructionId
2073
- loc: SourceLocation
2074
- }
2075
-
2076
- declare type ReactiveTryTerminal = {
2077
- kind: 'try'
2078
- block: ReactiveBlock
2079
- handlerBinding: Place | null
2080
- handler: ReactiveBlock
2081
- id: InstructionId
2082
- loc: SourceLocation
2083
- }
2084
-
2085
- declare type ReactiveValue =
2086
- | InstructionValue
2087
- | ReactiveLogicalValue
2088
- | ReactiveSequenceValue
2089
- | ReactiveTernaryValue
2090
- | ReactiveOptionalCallValue
2091
-
2092
- declare type ReactiveWhileTerminal = {
2093
- kind: 'while'
2094
- test: ReactiveValue
2095
- loop: ReactiveBlock
2096
- id: InstructionId
2097
- loc: SourceLocation
2098
- }
2099
-
2100
- declare type ResolvedType = {
2101
- kind: 'Concrete'
2102
- type: ConcreteType<ResolvedType>
2103
- platform: Platform
2104
- }
2105
-
2106
- declare interface Result<T, E> {
2107
- map<U>(fn: (val: T) => U): Result<U, E>
2108
- mapErr<F>(fn: (val: E) => F): Result<T, F>
2109
- mapOr<U>(fallback: U, fn: (val: T) => U): U
2110
- mapOrElse<U>(fallback: () => U, fn: (val: T) => U): U
2111
- andThen<U>(fn: (val: T) => Result<U, E>): Result<U, E>
2112
- and<U>(res: Result<U, E>): Result<U, E>
2113
- or(res: Result<T, E>): Result<T, E>
2114
- orElse<F>(fn: (val: E) => Result<T, F>): Result<T, F>
2115
- isOk(): this is OkImpl<T>
2116
- isErr(): this is ErrImpl<E>
2117
- expect(msg: string): T
2118
- expectErr(msg: string): E
2119
- unwrap(): T
2120
- unwrapOr(fallback: T): T
2121
- unwrapOrElse(fallback: (val: E) => T): T
2122
- unwrapErr(): E
2123
- }
2124
-
2125
- declare type ReturnTerminal = {
2126
- kind: 'return'
2127
- returnVariant: ReturnVariant
2128
- loc: SourceLocation
2129
- value: Place
2130
- id: InstructionId
2131
- fallthrough?: never
2132
- effects: Array<AliasingEffect> | null
2133
- }
2134
-
2135
- declare type ReturnVariant = 'Void' | 'Implicit' | 'Explicit'
2136
-
2137
- declare type ScopeId = number & {
2138
- [opaqueScopeId]: 'ScopeId'
2139
- }
2140
-
2141
- declare type SequenceTerminal = {
2142
- kind: 'sequence'
2143
- block: BlockId
2144
- fallthrough: BlockId
2145
- id: InstructionId
2146
- loc: SourceLocation
2147
- }
2148
-
2149
- declare type SourceLocation = t.SourceLocation | typeof GeneratedSource
2150
-
2151
- declare type SpreadPattern = {
2152
- kind: 'Spread'
2153
- place: Place
2154
- }
2155
-
2156
- declare type StartMemoize = {
2157
- kind: 'StartMemoize'
2158
- manualMemoId: number
2159
- deps: Array<ManualMemoDependency> | null
2160
- loc: SourceLocation
2161
- }
2162
-
2163
- declare type StoreGlobal = {
2164
- kind: 'StoreGlobal'
2165
- name: string
2166
- value: Place
2167
- loc: SourceLocation
2168
- }
2169
-
2170
- declare type StoreLocal = {
2171
- kind: 'StoreLocal'
2172
- lvalue: LValue
2173
- value: Place
2174
- type: t.FlowType | t.TSType | null
2175
- loc: SourceLocation
2176
- }
2177
-
2178
- declare type SuppressionRange = {
2179
- disableComment: t.Comment
2180
- enableComment: t.Comment | null
2181
- source: SuppressionSource
2182
- }
2183
-
2184
- declare type SuppressionSource = 'Eslint' | 'Flow'
2185
-
2186
- declare type SwitchTerminal = {
2187
- kind: 'switch'
2188
- test: Place
2189
- cases: Array<Case>
2190
- fallthrough: BlockId
2191
- id: InstructionId
2192
- loc: SourceLocation
2193
- }
2194
-
2195
- declare type Terminal =
2196
- | UnsupportedTerminal
2197
- | UnreachableTerminal
2198
- | ThrowTerminal
2199
- | ReturnTerminal
2200
- | GotoTerminal
2201
- | IfTerminal
2202
- | BranchTerminal
2203
- | SwitchTerminal
2204
- | ForTerminal
2205
- | ForOfTerminal
2206
- | ForInTerminal
2207
- | DoWhileTerminal
2208
- | WhileTerminal
2209
- | LogicalTerminal
2210
- | TernaryTerminal
2211
- | OptionalTerminal
2212
- | LabelTerminal
2213
- | SequenceTerminal
2214
- | MaybeThrowTerminal
2215
- | TryTerminal
2216
- | ReactiveScopeTerminal
2217
- | PrunedScopeTerminal
2218
-
2219
- declare type TernaryTerminal = {
2220
- kind: 'ternary'
2221
- test: BlockId
2222
- fallthrough: BlockId
2223
- id: InstructionId
2224
- loc: SourceLocation
2225
- }
2226
-
2227
- declare type ThrowTerminal = {
2228
- kind: 'throw'
2229
- value: Place
2230
- id: InstructionId
2231
- loc: SourceLocation
2232
- fallthrough?: never
2233
- }
2234
-
2235
- declare type TimingEvent = {
2236
- kind: 'Timing'
2237
- measurement: PerformanceMeasure
2238
- }
2239
-
2240
- declare type TryTerminal = {
2241
- kind: 'try'
2242
- block: BlockId
2243
- handlerBinding: Place | null
2244
- handler: BlockId
2245
- fallthrough: BlockId
2246
- id: InstructionId
2247
- loc: SourceLocation
2248
- }
2249
-
2250
- declare type Type = BuiltInType | PhiType | TypeVar | PolyType | PropType | ObjectMethod$1
2251
-
2252
- declare type TypeId = number & {
2253
- [opaqueTypeId]: 'IdentifierId'
2254
- }
2255
-
2256
- declare type TypeParameter<T> = {
2257
- name: string
2258
- id: TypeParameterId
2259
- bound: T
2260
- }
2261
-
2262
- declare type TypeParameterId = number & {
2263
- [opaqueTypeParameterId]: 'TypeParameterId'
2264
- }
2265
-
2266
- declare type TypeVar = {
2267
- kind: 'Type'
2268
- id: TypeId
2269
- }
2270
-
2271
- declare type UnreachableTerminal = {
2272
- kind: 'unreachable'
2273
- id: InstructionId
2274
- loc: SourceLocation
2275
- fallthrough?: never
2276
- }
2277
-
2278
- declare type UnsupportedTerminal = {
2279
- kind: 'unsupported'
2280
- id: InstructionId
2281
- loc: SourceLocation
2282
- fallthrough?: never
2283
- }
2284
-
2285
- declare type ValidatedIdentifier = {
2286
- kind: 'named'
2287
- value: ValidIdentifierName
2288
- }
2289
-
2290
- declare type ValidIdentifierName = string & {
2291
- [opaqueValidIdentifierName]: 'ValidIdentifierName'
2292
- }
2293
-
2294
- declare enum ValueKind {
2295
- MaybeFrozen = 'maybefrozen',
2296
- Frozen = 'frozen',
2297
- Primitive = 'primitive',
2298
- Global = 'global',
2299
- Mutable = 'mutable',
2300
- Context = 'context',
2301
- }
2302
-
2303
- declare enum ValueReason {
2304
- Global = 'global',
2305
- JsxCaptured = 'jsx-captured',
2306
- HookCaptured = 'hook-captured',
2307
- HookReturn = 'hook-return',
2308
- Effect = 'effect',
2309
- KnownReturnSignature = 'known-return-signature',
2310
- Context = 'context',
2311
- State = 'state',
2312
- ReducerState = 'reducer-state',
2313
- ReactiveFunctionArgument = 'reactive-function-argument',
2314
- Other = 'other',
2315
- }
2316
-
2317
- declare type WhileTerminal = {
2318
- kind: 'while'
2319
- loc: SourceLocation
2320
- test: BlockId
2321
- loop: BlockId
2322
- fallthrough: BlockId
2323
- id: InstructionId
2324
- }
2325
-
2326
- export {}