@powerlines/plugin-env 0.15.13 → 0.15.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +4 -0
- package/dist/_virtual/rolldown_runtime.mjs +33 -0
- package/dist/babel/plugin.cjs +16 -16
- package/dist/babel/plugin.d.mts +2 -2
- package/dist/babel/plugin.mjs +7 -7
- package/dist/components/docs.cjs +8 -8
- package/dist/components/docs.mjs +5 -5
- package/dist/components/env.cjs +38 -39
- package/dist/components/env.d.mts +2 -2
- package/dist/components/env.mjs +11 -11
- package/dist/helpers/automd-generator.cjs +4 -4
- package/dist/helpers/automd-generator.d.mts +1 -1
- package/dist/helpers/automd-generator.mjs +3 -3
- package/dist/helpers/load.cjs +12 -13
- package/dist/helpers/load.d.mts +2 -2
- package/dist/helpers/load.mjs +10 -10
- package/dist/helpers/persistence.cjs +23 -23
- package/dist/helpers/persistence.d.mts +1 -1
- package/dist/helpers/persistence.mjs +7 -7
- package/dist/helpers/reflect.cjs +9 -9
- package/dist/helpers/reflect.mjs +5 -5
- package/dist/helpers/source-file-env.cjs +1 -1
- package/dist/helpers/source-file-env.mjs +1 -1
- package/dist/index.cjs +28 -26
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +25 -25
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/parse-type-definition.cjs +31 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/parse-type-definition.mjs +31 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/to-array.cjs +8 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/to-array.mjs +7 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +6 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +5 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +5 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +6 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +6 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +1 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +3 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +11 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +11 -0
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.30/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +12 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-parent-path.cjs +10 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-parent-path.mjs +10 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-type.cjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/is-type.mjs +13 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/join-paths.cjs +49 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/join-paths.mjs +49 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/regex.cjs +9 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/regex.mjs +5 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/slash.cjs +8 -0
- package/dist/node_modules/.pnpm/@stryke_path@0.24.1/node_modules/@stryke/path/dist/slash.mjs +7 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.cjs +346 -0
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.1/node_modules/c12/dist/index.mjs +346 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.cjs +786 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/json5.mjs +786 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.cjs +3 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/jsonc.mjs +3 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.cjs +23 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DA7CpUDY.mjs +22 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.cjs +405 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/shared/confbox.DnMsyigM.mjs +404 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.cjs +657 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/toml.mjs +657 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.cjs +1054 -0
- package/dist/node_modules/.pnpm/confbox@0.2.2/node_modules/confbox/dist/yaml.mjs +1054 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +43 -0
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +42 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.cjs +46 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +45 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.cjs +288 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.mjs +285 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.cjs +71 -0
- package/dist/node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/package.mjs +68 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +1013 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +1007 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +23 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +13 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +2698 -0
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +2685 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +4457 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +4454 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +29 -0
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +29 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +181 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +176 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +22 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +17 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +3967 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +3962 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +11768 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +11763 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +25 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +20 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +20 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +17 -0
- package/dist/node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.cjs +174 -0
- package/dist/node_modules/.pnpm/nypm@0.6.2/node_modules/nypm/dist/shared/nypm.CLjaS_sz.mjs +172 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +13 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs +12 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.cjs +3 -0
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/index.mjs +3 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.cjs +145 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +138 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +127 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +125 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +138 -0
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +136 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +629 -0
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +627 -0
- package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/components.d.mts +1 -1
- package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/typescript-file.d.mts +1 -1
- package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/typescript-interface.d.mts +1 -1
- package/dist/{powerlines → packages/powerlines}/src/types/build.d.mts +6 -6
- package/dist/{powerlines → packages/powerlines}/src/types/config.d.mts +1 -2
- package/dist/{powerlines → packages/powerlines}/src/types/tsconfig.d.mts +1 -1
- package/dist/types/plugin.cjs +19 -18
- package/dist/types/plugin.d.mts +6 -6
- package/dist/types/plugin.mjs +4 -4
- package/dist/types/runtime.cjs +3 -2
- package/dist/types/runtime.d.mts +1 -1
- package/dist/types/runtime.mjs +1 -1
- package/package.json +10 -10
- package/dist/deepkit/schemas/reflection.cjs +0 -5368
- package/dist/deepkit/schemas/reflection.mjs +0 -5365
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -1692
- package/dist/deepkit/src/capnp.mjs +0 -1690
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -99
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -98
- package/dist/deepkit/src/reflect-type.cjs +0 -40
- package/dist/deepkit/src/reflect-type.mjs +0 -38
- package/dist/deepkit/src/resolve-reflections.cjs +0 -23
- package/dist/deepkit/src/resolve-reflections.mjs +0 -22
- package/dist/deepkit/src/transformer.cjs +0 -92
- package/dist/deepkit/src/transformer.mjs +0 -89
- package/dist/deepkit/src/transpile.cjs +0 -39
- package/dist/deepkit/src/transpile.mjs +0 -37
- package/dist/deepkit/src/types.cjs +0 -22
- package/dist/deepkit/src/types.mjs +0 -21
- package/dist/deepkit/src/utilities.cjs +0 -182
- package/dist/deepkit/src/utilities.mjs +0 -181
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -136
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -128
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -110
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -101
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -23
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -22
- package/dist/plugin-alloy/src/index.cjs +0 -106
- package/dist/plugin-alloy/src/index.mjs +0 -104
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -72
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -71
- package/dist/plugin-alloy/src/types/components.cjs +0 -22
- package/dist/plugin-alloy/src/types/components.mjs +0 -21
- package/dist/plugin-alloy/src/types/plugin.cjs +0 -55
- package/dist/plugin-alloy/src/types/plugin.mjs +0 -52
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -212
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -209
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
- package/dist/plugin-automd/src/index.cjs +0 -127
- package/dist/plugin-automd/src/index.mjs +0 -124
- package/dist/plugin-automd/src/types/plugin.cjs +0 -47
- package/dist/plugin-automd/src/types/plugin.mjs +0 -47
- package/dist/plugin-automd/src/types/toc.cjs +0 -26
- package/dist/plugin-automd/src/types/toc.mjs +0 -25
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -74
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -70
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -71
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -69
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -158
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -154
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -200
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -192
- package/dist/plugin-babel/src/helpers/options.cjs +0 -74
- package/dist/plugin-babel/src/helpers/options.mjs +0 -71
- package/dist/plugin-babel/src/index.cjs +0 -131
- package/dist/plugin-babel/src/index.mjs +0 -129
- package/dist/plugin-babel/src/types/plugin.cjs +0 -42
- package/dist/plugin-babel/src/types/plugin.mjs +0 -39
- package/dist/powerlines/src/internal/helpers/hooks.cjs +0 -137
- package/dist/powerlines/src/internal/helpers/hooks.mjs +0 -135
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -161
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -159
- package/dist/powerlines/src/lib/entry.cjs +0 -203
- package/dist/powerlines/src/lib/entry.mjs +0 -201
- package/dist/powerlines/src/lib/logger.cjs +0 -108
- package/dist/powerlines/src/lib/logger.mjs +0 -106
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -67
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -66
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -49
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -48
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -46
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -45
- package/dist/powerlines/src/types/api.cjs +0 -62
- package/dist/powerlines/src/types/api.mjs +0 -62
- package/dist/powerlines/src/types/babel.cjs +0 -156
- package/dist/powerlines/src/types/babel.mjs +0 -147
- package/dist/powerlines/src/types/build.cjs +0 -127
- package/dist/powerlines/src/types/build.mjs +0 -121
- package/dist/powerlines/src/types/commands.cjs +0 -16
- package/dist/powerlines/src/types/commands.mjs +0 -15
- package/dist/powerlines/src/types/config.cjs +0 -413
- package/dist/powerlines/src/types/config.mjs +0 -391
- package/dist/powerlines/src/types/context.cjs +0 -381
- package/dist/powerlines/src/types/context.mjs +0 -364
- package/dist/powerlines/src/types/fs.cjs +0 -78
- package/dist/powerlines/src/types/fs.mjs +0 -75
- package/dist/powerlines/src/types/hooks.cjs +0 -71
- package/dist/powerlines/src/types/hooks.mjs +0 -68
- package/dist/powerlines/src/types/index.cjs +0 -11
- package/dist/powerlines/src/types/index.mjs +0 -13
- package/dist/powerlines/src/types/plugin.cjs +0 -184
- package/dist/powerlines/src/types/plugin.mjs +0 -178
- package/dist/powerlines/src/types/resolved.cjs +0 -153
- package/dist/powerlines/src/types/resolved.mjs +0 -148
- package/dist/powerlines/src/types/unplugin.cjs +0 -47
- package/dist/powerlines/src/types/unplugin.mjs +0 -46
- /package/dist/{deepkit → packages/deepkit}/schemas/reflection.d.mts +0 -0
- /package/dist/{deepkit → packages/deepkit}/src/types.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/core/components/source-file.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/index.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/types/plugin.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/builtin-file.d.mts +0 -0
- /package/dist/{plugin-alloy → packages/plugin-alloy}/src/typescript/components/tsdoc.d.mts +0 -0
- /package/dist/{plugin-automd → packages/plugin-automd}/src/types/plugin.d.mts +0 -0
- /package/dist/{plugin-automd → packages/plugin-automd}/src/types/toc.d.mts +0 -0
- /package/dist/{plugin-babel → packages/plugin-babel}/src/types/index.d.mts +0 -0
- /package/dist/{plugin-babel → packages/plugin-babel}/src/types/plugin.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/internal/helpers/hooks.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/babel.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/commands.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/context.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/index.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/plugin.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/resolved.d.mts +0 -0
- /package/dist/{powerlines → packages/powerlines}/src/types/unplugin.d.mts +0 -0
|
@@ -1,1690 +0,0 @@
|
|
|
1
|
-
import { ReflectionVisibility as ReflectionVisibility$1, SerializedType_Type } from "../schemas/reflection.mjs";
|
|
2
|
-
import { ReflectionKind, ReflectionVisibility, __ΩReflectionKind, __ΩSerializedType, __ΩSerializedTypeArray, __ΩSerializedTypeClassType, __ΩSerializedTypeEnum, __ΩSerializedTypeFunction, __ΩSerializedTypeInfer, __ΩSerializedTypeIntersection, __ΩSerializedTypeLiteral, __ΩSerializedTypeMethod, __ΩSerializedTypeMethodSignature, __ΩSerializedTypeObjectLiteral, __ΩSerializedTypeParameter, __ΩSerializedTypeProperty, __ΩSerializedTypePropertySignature, __ΩSerializedTypeReference, __ΩSerializedTypeTuple, __ΩSerializedTypeTupleMember, __ΩSerializedTypeUnion, __ΩSerializedTypes, __ΩSimpleSerializedType, __ΩTagsReflection } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
import { List } from "@stryke/capnp";
|
|
4
|
-
import { isInteger, isSetObject, isUndefined } from "@stryke/type-checks";
|
|
5
|
-
|
|
6
|
-
//#region ../deepkit/src/capnp.ts
|
|
7
|
-
function __assignType(fn, args) {
|
|
8
|
-
fn.__type = args;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
13
|
-
*
|
|
14
|
-
* @param serializedTypes - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
15
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
16
|
-
*/
|
|
17
|
-
function convertToCapnp(serializedTypes, result) {
|
|
18
|
-
if (!serializedTypes || !Array.isArray(serializedTypes) || serializedTypes.length === 0) throw new Error("Invalid serialized type provided for conversion.");
|
|
19
|
-
if (serializedTypes.length !== result.length) throw new Error(`Mismatch in length of serialized types: expected ${result.length}, got ${serializedTypes.length}.`);
|
|
20
|
-
serializedTypes.filter(__assignType((serializedType) => isSetObject(serializedType) && !isUndefined(serializedType.kind), [
|
|
21
|
-
"serializedType",
|
|
22
|
-
"",
|
|
23
|
-
"P\"2!\"/\""
|
|
24
|
-
])).forEach(__assignType((serializedType, index) => {
|
|
25
|
-
convertToCapnpBase(serializedType, result.get(index)._initType());
|
|
26
|
-
}, [
|
|
27
|
-
"serializedType",
|
|
28
|
-
"index",
|
|
29
|
-
"",
|
|
30
|
-
"P\"2!\"2\"\"/#"
|
|
31
|
-
]));
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
convertToCapnp.__type = [
|
|
35
|
-
() => __ΩSerializedTypes,
|
|
36
|
-
"serializedTypes",
|
|
37
|
-
() => List,
|
|
38
|
-
"result",
|
|
39
|
-
() => List,
|
|
40
|
-
"convertToCapnp",
|
|
41
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
42
|
-
"Pn!2\"P!7#2$P!7%/&?'"
|
|
43
|
-
];
|
|
44
|
-
/**
|
|
45
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
46
|
-
*
|
|
47
|
-
* @param serializedTypes - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema
|
|
48
|
-
* @returns The [Deepkit](https://deepkit.io/) {@link SerializedTypes | serialized types} converted from the Cap'n Proto serialized type
|
|
49
|
-
*/
|
|
50
|
-
function convertFromCapnp(serializedTypes) {
|
|
51
|
-
if (!serializedTypes) throw new Error("Invalid serialized type provided for conversion.");
|
|
52
|
-
const result = [];
|
|
53
|
-
serializedTypes.forEach(__assignType((serializedType) => {
|
|
54
|
-
const deserializedType = convertFromCapnpBase(serializedType.type);
|
|
55
|
-
result.push(deserializedType);
|
|
56
|
-
}, [
|
|
57
|
-
"serializedType",
|
|
58
|
-
"",
|
|
59
|
-
"P\"2!\"/\""
|
|
60
|
-
]));
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
convertFromCapnp.__type = [
|
|
64
|
-
() => List,
|
|
65
|
-
"serializedTypes",
|
|
66
|
-
() => __ΩSerializedTypes,
|
|
67
|
-
"convertFromCapnp",
|
|
68
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
69
|
-
"PP!7!2\"n#/$?%"
|
|
70
|
-
];
|
|
71
|
-
/**
|
|
72
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
73
|
-
*
|
|
74
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
75
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
76
|
-
*/
|
|
77
|
-
function convertToCapnpTagsReflection(result, serializedType) {
|
|
78
|
-
if (serializedType?.alias?.length) {
|
|
79
|
-
const alias = result._initAlias(serializedType.alias.length);
|
|
80
|
-
serializedType.alias.forEach(__assignType((a, index) => {
|
|
81
|
-
alias.set(index, a);
|
|
82
|
-
}, [
|
|
83
|
-
"a",
|
|
84
|
-
"index",
|
|
85
|
-
"",
|
|
86
|
-
"P\"2!\"2\"\"/#"
|
|
87
|
-
]));
|
|
88
|
-
}
|
|
89
|
-
result.hidden = serializedType?.hidden ?? false;
|
|
90
|
-
result.ignore = serializedType?.ignore ?? false;
|
|
91
|
-
result.internal = serializedType?.internal ?? false;
|
|
92
|
-
result.readonly = serializedType?.readonly ?? false;
|
|
93
|
-
if (serializedType?.title) result.title = serializedType?.title;
|
|
94
|
-
if (serializedType?.domain) result.domain = serializedType?.domain;
|
|
95
|
-
if (serializedType?.permission?.length) {
|
|
96
|
-
const permission = result._initPermission(serializedType.permission.length);
|
|
97
|
-
serializedType.permission?.forEach(__assignType((p, index) => {
|
|
98
|
-
permission.set(index, p);
|
|
99
|
-
}, [
|
|
100
|
-
"p",
|
|
101
|
-
"index",
|
|
102
|
-
"",
|
|
103
|
-
"P\"2!\"2\"\"/#"
|
|
104
|
-
]));
|
|
105
|
-
}
|
|
106
|
-
return result;
|
|
107
|
-
}
|
|
108
|
-
convertToCapnpTagsReflection.__type = [
|
|
109
|
-
"result",
|
|
110
|
-
() => __ΩTagsReflection,
|
|
111
|
-
"serializedType",
|
|
112
|
-
"convertToCapnpTagsReflection",
|
|
113
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
114
|
-
"P!2!n\"2#8!/$?%"
|
|
115
|
-
];
|
|
116
|
-
const __ΩWithTagsReflection = [
|
|
117
|
-
"",
|
|
118
|
-
"_hasTags",
|
|
119
|
-
"alias",
|
|
120
|
-
"hidden",
|
|
121
|
-
"domain",
|
|
122
|
-
"title",
|
|
123
|
-
"ignore",
|
|
124
|
-
"internal",
|
|
125
|
-
"readonly",
|
|
126
|
-
"permission",
|
|
127
|
-
"tags",
|
|
128
|
-
"WithTagsReflection",
|
|
129
|
-
"PP)/!4\"P&F4#)4$&4%&4&)4')4()4)&F4*M4+8Mw,y"
|
|
130
|
-
];
|
|
131
|
-
function convertFromCapnpTagsReflection(serializedType) {
|
|
132
|
-
return serializedType._hasTags() ? {
|
|
133
|
-
alias: serializedType.tags?.alias?.length ? serializedType.tags?.alias.map(__assignType((value) => value, [
|
|
134
|
-
"value",
|
|
135
|
-
"",
|
|
136
|
-
"P\"2!\"/\""
|
|
137
|
-
])) : void 0,
|
|
138
|
-
hidden: serializedType.tags?.hidden,
|
|
139
|
-
domain: serializedType.tags?.domain ? serializedType.tags.domain : void 0,
|
|
140
|
-
title: serializedType.tags?.title ? serializedType.tags.title : void 0,
|
|
141
|
-
ignore: serializedType.tags?.ignore,
|
|
142
|
-
internal: serializedType.tags?.internal,
|
|
143
|
-
readonly: serializedType.tags?.readonly,
|
|
144
|
-
permission: serializedType.tags?.permission?.length ? serializedType.tags?.permission?.map(__assignType((value) => value, [
|
|
145
|
-
"value",
|
|
146
|
-
"",
|
|
147
|
-
"P\"2!\"/\""
|
|
148
|
-
])) : void 0
|
|
149
|
-
} : void 0;
|
|
150
|
-
}
|
|
151
|
-
convertFromCapnpTagsReflection.__type = [
|
|
152
|
-
() => __ΩWithTagsReflection,
|
|
153
|
-
"serializedType",
|
|
154
|
-
"convertFromCapnpTagsReflection",
|
|
155
|
-
"Pn!2\"\"/#"
|
|
156
|
-
];
|
|
157
|
-
const __ΩCapnpIndexAccessOriginSerializedType = [
|
|
158
|
-
() => __ΩSerializedTypeReference,
|
|
159
|
-
"container",
|
|
160
|
-
() => __ΩSerializedTypeReference,
|
|
161
|
-
"index",
|
|
162
|
-
"CapnpIndexAccessOriginSerializedType",
|
|
163
|
-
"Pn!4\"n#4$Mw%y"
|
|
164
|
-
];
|
|
165
|
-
/**
|
|
166
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
167
|
-
*
|
|
168
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
169
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
170
|
-
*/
|
|
171
|
-
function convertToCapnpIndexAccessOrigin(result, serializedType) {
|
|
172
|
-
const indexAccessOriginIndex = result._initIndex();
|
|
173
|
-
indexAccessOriginIndex.id = serializedType?.index ?? 0;
|
|
174
|
-
const indexAccessOriginContainer = result._initContainer();
|
|
175
|
-
indexAccessOriginContainer.id = serializedType?.container ?? 0;
|
|
176
|
-
return result;
|
|
177
|
-
}
|
|
178
|
-
convertToCapnpIndexAccessOrigin.__type = [
|
|
179
|
-
"result",
|
|
180
|
-
() => __ΩCapnpIndexAccessOriginSerializedType,
|
|
181
|
-
"serializedType",
|
|
182
|
-
"convertToCapnpIndexAccessOrigin",
|
|
183
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
184
|
-
"P!2!n\"2#8!/$?%"
|
|
185
|
-
];
|
|
186
|
-
const __ΩWithIndexAccessOrigin = [
|
|
187
|
-
"",
|
|
188
|
-
"_hasIndexAccessOrigin",
|
|
189
|
-
"id",
|
|
190
|
-
"container",
|
|
191
|
-
"index",
|
|
192
|
-
"indexAccessOrigin",
|
|
193
|
-
"WithIndexAccessOrigin",
|
|
194
|
-
"PP)/!4\"PP'4#M4$P'4#M4%M4&8Mw'y"
|
|
195
|
-
];
|
|
196
|
-
function convertFromCapnpIndexAccessOrigin(serializedType) {
|
|
197
|
-
return serializedType._hasIndexAccessOrigin() ? {
|
|
198
|
-
container: Number(serializedType.indexAccessOrigin?.container.id),
|
|
199
|
-
index: Number(serializedType.indexAccessOrigin?.index.id)
|
|
200
|
-
} : void 0;
|
|
201
|
-
}
|
|
202
|
-
convertFromCapnpIndexAccessOrigin.__type = [
|
|
203
|
-
() => __ΩWithIndexAccessOrigin,
|
|
204
|
-
"serializedType",
|
|
205
|
-
"convertFromCapnpIndexAccessOrigin",
|
|
206
|
-
"Pn!2\"\"/#"
|
|
207
|
-
];
|
|
208
|
-
/**
|
|
209
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
210
|
-
*
|
|
211
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
212
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
213
|
-
*/
|
|
214
|
-
function convertToCapnpBase(serializedType, result) {
|
|
215
|
-
if (serializedType.kind === ReflectionKind.objectLiteral) convertToCapnpObjectLiteral(serializedType, result._initObjectLiteral());
|
|
216
|
-
else if (serializedType.kind === ReflectionKind.class) convertToCapnpClassType(serializedType, result._initClassType());
|
|
217
|
-
else if (serializedType.kind === ReflectionKind.parameter) convertToCapnpParameter(serializedType, result._initParameter());
|
|
218
|
-
else if (serializedType.kind === ReflectionKind.function) convertToCapnpFunction(serializedType, result._initFunction());
|
|
219
|
-
else if (serializedType.kind === ReflectionKind.method) convertToCapnpMethod(serializedType, result._initMethod());
|
|
220
|
-
else if (serializedType.kind === ReflectionKind.infer) convertToCapnpInfer(serializedType, result._initInfer());
|
|
221
|
-
else if (serializedType.kind === ReflectionKind.union) convertToCapnpUnion(serializedType, result._initUnion());
|
|
222
|
-
else if (serializedType.kind === ReflectionKind.array) convertToCapnpArray(serializedType, result._initArray());
|
|
223
|
-
else if (serializedType.kind === ReflectionKind.intersection) convertToCapnpIntersection(serializedType, result._initIntersection());
|
|
224
|
-
else if (serializedType.kind === ReflectionKind.enum) convertToCapnpEnum(serializedType, result._initEnum());
|
|
225
|
-
else if (serializedType.kind === ReflectionKind.property) convertToCapnpProperty(serializedType, result._initProperty());
|
|
226
|
-
else if (serializedType.kind === ReflectionKind.tuple) convertToCapnpTuple(serializedType, result._initTuple());
|
|
227
|
-
else if (serializedType.kind === ReflectionKind.tupleMember) convertToCapnpTupleMember(serializedType, result._initTupleMember());
|
|
228
|
-
else if (serializedType.kind === ReflectionKind.propertySignature) convertToCapnpPropertySignature(serializedType, result._initPropertySignature());
|
|
229
|
-
else if (serializedType.kind === ReflectionKind.methodSignature) convertToCapnpMethodSignature(serializedType, result._initMethodSignature());
|
|
230
|
-
else if (serializedType.kind === ReflectionKind.literal) convertToCapnpLiteral(serializedType, result._initLiteral());
|
|
231
|
-
else if (serializedType.kind === ReflectionKind.never || serializedType.kind === ReflectionKind.any || serializedType.kind === ReflectionKind.unknown || serializedType.kind === ReflectionKind.void || serializedType.kind === ReflectionKind.object || serializedType.kind === ReflectionKind.string || serializedType.kind === ReflectionKind.number || serializedType.kind === ReflectionKind.boolean || serializedType.kind === ReflectionKind.symbol || serializedType.kind === ReflectionKind.bigint || serializedType.kind === ReflectionKind.null || serializedType.kind === ReflectionKind.undefined || serializedType.kind === ReflectionKind.regexp) convertToCapnpSimple(serializedType, result._initSimple());
|
|
232
|
-
else convertToCapnpOther(serializedType, result._initOther());
|
|
233
|
-
return result;
|
|
234
|
-
}
|
|
235
|
-
convertToCapnpBase.__type = [
|
|
236
|
-
() => __ΩSerializedType,
|
|
237
|
-
"serializedType",
|
|
238
|
-
() => SerializedType_Type,
|
|
239
|
-
"result",
|
|
240
|
-
() => SerializedType_Type,
|
|
241
|
-
"convertToCapnpBase",
|
|
242
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
243
|
-
"Pn!2\"P7#2$P7%/&?'"
|
|
244
|
-
];
|
|
245
|
-
function convertFromCapnpBase(serializedType) {
|
|
246
|
-
if (serializedType._isObjectLiteral) return convertFromCapnpObjectLiteral(serializedType.objectLiteral);
|
|
247
|
-
else if (serializedType._isClassType) return convertFromCapnpClassType(serializedType.classType);
|
|
248
|
-
else if (serializedType._isParameter) return convertFromCapnpParameter(serializedType.parameter);
|
|
249
|
-
else if (serializedType._isFunction) return convertFromCapnpFunction(serializedType.function);
|
|
250
|
-
else if (serializedType._isInfer) return convertFromCapnpInfer(serializedType.infer);
|
|
251
|
-
else if (serializedType._isMethod) return convertFromCapnpMethod(serializedType.method);
|
|
252
|
-
else if (serializedType._isUnion) return convertFromCapnpUnion(serializedType.union);
|
|
253
|
-
else if (serializedType._isArray) return convertFromCapnpArray(serializedType.array);
|
|
254
|
-
else if (serializedType._isIntersection) return convertFromCapnpIntersection(serializedType.intersection);
|
|
255
|
-
else if (serializedType._isEnum) return convertFromCapnpEnum(serializedType.enum);
|
|
256
|
-
else if (serializedType._isProperty) return convertFromCapnpProperty(serializedType.property);
|
|
257
|
-
else if (serializedType._isTuple) return convertFromCapnpTuple(serializedType.tuple);
|
|
258
|
-
else if (serializedType._isTupleMember) return convertFromCapnpTupleMember(serializedType.tupleMember);
|
|
259
|
-
else if (serializedType._isPropertySignature) return convertFromCapnpPropertySignature(serializedType.propertySignature);
|
|
260
|
-
else if (serializedType._isMethodSignature) return convertFromCapnpMethodSignature(serializedType.methodSignature);
|
|
261
|
-
else if (serializedType._isLiteral) return convertFromCapnpLiteral(serializedType.literal);
|
|
262
|
-
else if (serializedType._isSimple) return convertFromCapnpSimple(serializedType.simple);
|
|
263
|
-
else if (serializedType._isOther) return convertFromCapnpOther(serializedType.other);
|
|
264
|
-
else throw new Error(`Unsupported serialized type kind: ${serializedType.toString()}`);
|
|
265
|
-
}
|
|
266
|
-
convertFromCapnpBase.__type = [
|
|
267
|
-
() => SerializedType_Type,
|
|
268
|
-
"serializedType",
|
|
269
|
-
() => __ΩSerializedType,
|
|
270
|
-
"convertFromCapnpBase",
|
|
271
|
-
"PP7!2\"n#/$"
|
|
272
|
-
];
|
|
273
|
-
function convertFromCapnpOther(serializedType) {
|
|
274
|
-
return {
|
|
275
|
-
kind: serializedType.kind,
|
|
276
|
-
typeName: serializedType.typeName || void 0
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
convertFromCapnpOther.__type = [
|
|
280
|
-
"serializedType",
|
|
281
|
-
() => __ΩSerializedType,
|
|
282
|
-
"convertFromCapnpOther",
|
|
283
|
-
"P!2!n\"/#"
|
|
284
|
-
];
|
|
285
|
-
function convertFromCapnpSimple(serializedType) {
|
|
286
|
-
const result = {
|
|
287
|
-
kind: serializedType.kind,
|
|
288
|
-
typeName: serializedType.typeName || void 0,
|
|
289
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
290
|
-
"d",
|
|
291
|
-
"",
|
|
292
|
-
"P\"2!\"/\""
|
|
293
|
-
])) : void 0,
|
|
294
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
295
|
-
"t",
|
|
296
|
-
"",
|
|
297
|
-
"P\"2!\"/\""
|
|
298
|
-
])) : void 0,
|
|
299
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
300
|
-
};
|
|
301
|
-
if (serializedType._hasOrigin()) result.origin = Number(serializedType.origin.id);
|
|
302
|
-
return result;
|
|
303
|
-
}
|
|
304
|
-
convertFromCapnpSimple.__type = [
|
|
305
|
-
"serializedType",
|
|
306
|
-
() => __ΩSimpleSerializedType,
|
|
307
|
-
"convertFromCapnpSimple",
|
|
308
|
-
"P!2!n\"/#"
|
|
309
|
-
];
|
|
310
|
-
function convertToCapnpOther(serializedType, result) {
|
|
311
|
-
result.kind = serializedType.kind;
|
|
312
|
-
result.typeName = serializedType.typeName || "";
|
|
313
|
-
return result;
|
|
314
|
-
}
|
|
315
|
-
convertToCapnpOther.__type = [
|
|
316
|
-
() => __ΩReflectionKind,
|
|
317
|
-
"kind",
|
|
318
|
-
"typeName",
|
|
319
|
-
"serializedType",
|
|
320
|
-
"result",
|
|
321
|
-
"convertToCapnpOther",
|
|
322
|
-
"PPn!4\"&4#8M2$!2%!/&"
|
|
323
|
-
];
|
|
324
|
-
function convertToCapnpSimple(serializedType, result) {
|
|
325
|
-
result.kind = serializedType.kind;
|
|
326
|
-
result.typeName = serializedType.typeName || "";
|
|
327
|
-
if (serializedType.origin) {
|
|
328
|
-
result._initOrigin();
|
|
329
|
-
result.origin.id = serializedType.origin ?? 0;
|
|
330
|
-
}
|
|
331
|
-
if (serializedType.decorators?.length) {
|
|
332
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
333
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
334
|
-
const decorator = decorators.get(index);
|
|
335
|
-
decorator.id = d;
|
|
336
|
-
}, [
|
|
337
|
-
"d",
|
|
338
|
-
"index",
|
|
339
|
-
"",
|
|
340
|
-
"P\"2!\"2\"\"/#"
|
|
341
|
-
]));
|
|
342
|
-
}
|
|
343
|
-
if (serializedType.typeArguments?.length) {
|
|
344
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
345
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
346
|
-
const typeArgument = typeArguments.get(index);
|
|
347
|
-
typeArgument.id = t;
|
|
348
|
-
}, [
|
|
349
|
-
"t",
|
|
350
|
-
"index",
|
|
351
|
-
"",
|
|
352
|
-
"P\"2!\"2\"\"/#"
|
|
353
|
-
]));
|
|
354
|
-
}
|
|
355
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
356
|
-
return result;
|
|
357
|
-
}
|
|
358
|
-
convertToCapnpSimple.__type = [
|
|
359
|
-
() => __ΩSimpleSerializedType,
|
|
360
|
-
"serializedType",
|
|
361
|
-
"result",
|
|
362
|
-
"convertToCapnpSimple",
|
|
363
|
-
"Pn!2\"!2#!/$"
|
|
364
|
-
];
|
|
365
|
-
function convertFromCapnpLiteral(serializedType) {
|
|
366
|
-
return {
|
|
367
|
-
kind: ReflectionKind.literal,
|
|
368
|
-
literal: serializedType.literal._isString ? serializedType.literal.string : serializedType.literal._isNumber ? serializedType.literal.number : serializedType.literal._isBoolean ? serializedType.literal.boolean : serializedType.literal._isBigint ? {
|
|
369
|
-
type: "bigint",
|
|
370
|
-
value: serializedType.literal.bigint.value
|
|
371
|
-
} : serializedType.literal._isSymbol ? {
|
|
372
|
-
type: "symbol",
|
|
373
|
-
name: serializedType.literal.symbol.name
|
|
374
|
-
} : {
|
|
375
|
-
type: "regex",
|
|
376
|
-
regex: serializedType.literal.regex.regex
|
|
377
|
-
},
|
|
378
|
-
typeName: serializedType.typeName || void 0,
|
|
379
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
380
|
-
"d",
|
|
381
|
-
"",
|
|
382
|
-
"P\"2!\"/\""
|
|
383
|
-
])) : void 0,
|
|
384
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
385
|
-
"t",
|
|
386
|
-
"",
|
|
387
|
-
"P\"2!\"/\""
|
|
388
|
-
])) : void 0,
|
|
389
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
convertFromCapnpLiteral.__type = [
|
|
393
|
-
"serializedType",
|
|
394
|
-
() => __ΩSerializedTypeLiteral,
|
|
395
|
-
"convertFromCapnpLiteral",
|
|
396
|
-
"P!2!n\"/#"
|
|
397
|
-
];
|
|
398
|
-
function convertToCapnpLiteral(serializedType, result) {
|
|
399
|
-
result.kind = serializedType.kind;
|
|
400
|
-
result.typeName = serializedType.typeName || "";
|
|
401
|
-
const literalType = result._initLiteral();
|
|
402
|
-
if (typeof serializedType.literal === "boolean") literalType.boolean = serializedType.literal;
|
|
403
|
-
else if (typeof serializedType.literal === "number") literalType.number = serializedType.literal;
|
|
404
|
-
else if (typeof serializedType.literal === "string") literalType.string = serializedType.literal;
|
|
405
|
-
else if (serializedType.literal.type === "bigint") {
|
|
406
|
-
const literalTypeBigint = literalType._initBigint();
|
|
407
|
-
literalTypeBigint.type = "bigint";
|
|
408
|
-
literalTypeBigint.value = serializedType.literal.value;
|
|
409
|
-
} else if (serializedType.literal.type === "symbol") {
|
|
410
|
-
const literalTypeSymbol = literalType._initSymbol();
|
|
411
|
-
literalTypeSymbol.type = "symbol";
|
|
412
|
-
literalTypeSymbol.name = serializedType.literal.name.toString().slice(7, -1);
|
|
413
|
-
} else if (serializedType.literal.type === "regex") {
|
|
414
|
-
const literalTypeRegex = literalType._initRegex();
|
|
415
|
-
literalTypeRegex.type = "regex";
|
|
416
|
-
literalTypeRegex.regex = serializedType.literal.regex;
|
|
417
|
-
}
|
|
418
|
-
if (serializedType.decorators?.length) {
|
|
419
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
420
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
421
|
-
const decorator = decorators.get(index);
|
|
422
|
-
decorator.id = d;
|
|
423
|
-
}, [
|
|
424
|
-
"d",
|
|
425
|
-
"index",
|
|
426
|
-
"",
|
|
427
|
-
"P\"2!\"2\"\"/#"
|
|
428
|
-
]));
|
|
429
|
-
}
|
|
430
|
-
if (serializedType.typeArguments?.length) {
|
|
431
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
432
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
433
|
-
const typeArgument = typeArguments.get(index);
|
|
434
|
-
typeArgument.id = t;
|
|
435
|
-
}, [
|
|
436
|
-
"t",
|
|
437
|
-
"index",
|
|
438
|
-
"",
|
|
439
|
-
"P\"2!\"2\"\"/#"
|
|
440
|
-
]));
|
|
441
|
-
}
|
|
442
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
443
|
-
return result;
|
|
444
|
-
}
|
|
445
|
-
convertToCapnpLiteral.__type = [
|
|
446
|
-
() => __ΩSerializedTypeLiteral,
|
|
447
|
-
"serializedType",
|
|
448
|
-
"result",
|
|
449
|
-
"convertToCapnpLiteral",
|
|
450
|
-
"Pn!2\"!2#!/$"
|
|
451
|
-
];
|
|
452
|
-
function convertFromCapnpMethodSignature(serializedType) {
|
|
453
|
-
return {
|
|
454
|
-
kind: ReflectionKind.methodSignature,
|
|
455
|
-
name: serializedType.name,
|
|
456
|
-
typeName: serializedType.typeName || void 0,
|
|
457
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
458
|
-
"d",
|
|
459
|
-
"",
|
|
460
|
-
"P\"2!\"/\""
|
|
461
|
-
])) : void 0,
|
|
462
|
-
parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((p) => convertFromCapnpParameter(p), [
|
|
463
|
-
"p",
|
|
464
|
-
"",
|
|
465
|
-
"P\"2!\"/\""
|
|
466
|
-
])) : [],
|
|
467
|
-
return: serializedType.return.id,
|
|
468
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
convertFromCapnpMethodSignature.__type = [
|
|
472
|
-
"serializedType",
|
|
473
|
-
() => __ΩSerializedTypeMethodSignature,
|
|
474
|
-
"convertFromCapnpMethodSignature",
|
|
475
|
-
"P!2!n\"/#"
|
|
476
|
-
];
|
|
477
|
-
function convertToCapnpMethodSignature(serializedType, result) {
|
|
478
|
-
result.kind = serializedType.kind;
|
|
479
|
-
result.name = String(serializedType.name);
|
|
480
|
-
result.typeName = serializedType.typeName || "";
|
|
481
|
-
if (serializedType.decorators?.length) {
|
|
482
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
483
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
484
|
-
const decorator = decorators.get(index);
|
|
485
|
-
decorator.id = d;
|
|
486
|
-
}, [
|
|
487
|
-
"d",
|
|
488
|
-
"index",
|
|
489
|
-
"",
|
|
490
|
-
"P\"2!\"2\"\"/#"
|
|
491
|
-
]));
|
|
492
|
-
}
|
|
493
|
-
if (serializedType.typeArguments?.length) {
|
|
494
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
495
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
496
|
-
const typeArgument = typeArguments.get(index);
|
|
497
|
-
typeArgument.id = t;
|
|
498
|
-
}, [
|
|
499
|
-
"t",
|
|
500
|
-
"index",
|
|
501
|
-
"",
|
|
502
|
-
"P\"2!\"2\"\"/#"
|
|
503
|
-
]));
|
|
504
|
-
}
|
|
505
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
506
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
507
|
-
return result;
|
|
508
|
-
}
|
|
509
|
-
convertToCapnpMethodSignature.__type = [
|
|
510
|
-
() => __ΩSerializedTypeMethodSignature,
|
|
511
|
-
"serializedType",
|
|
512
|
-
"result",
|
|
513
|
-
"convertToCapnpMethodSignature",
|
|
514
|
-
"Pn!2\"!2#!/$"
|
|
515
|
-
];
|
|
516
|
-
function convertFromCapnpPropertySignature(serializedType) {
|
|
517
|
-
return {
|
|
518
|
-
kind: ReflectionKind.propertySignature,
|
|
519
|
-
name: serializedType.name,
|
|
520
|
-
typeName: serializedType.typeName || void 0,
|
|
521
|
-
description: serializedType.description,
|
|
522
|
-
default: convertFromCapnpDefault(serializedType.default),
|
|
523
|
-
optional: serializedType.optional ? true : void 0,
|
|
524
|
-
readonly: serializedType.readonly ? true : void 0,
|
|
525
|
-
type: serializedType.type.id,
|
|
526
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
527
|
-
"d",
|
|
528
|
-
"",
|
|
529
|
-
"P\"2!\"/\""
|
|
530
|
-
])) : void 0,
|
|
531
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
532
|
-
"t",
|
|
533
|
-
"",
|
|
534
|
-
"P\"2!\"/\""
|
|
535
|
-
])) : void 0,
|
|
536
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
537
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
convertFromCapnpPropertySignature.__type = [
|
|
541
|
-
"serializedType",
|
|
542
|
-
() => __ΩSerializedTypePropertySignature,
|
|
543
|
-
"convertFromCapnpPropertySignature",
|
|
544
|
-
"P!2!n\"/#"
|
|
545
|
-
];
|
|
546
|
-
function convertToCapnpDefault(defaultValue, result) {
|
|
547
|
-
if (typeof defaultValue !== "undefined" && defaultValue !== "") {
|
|
548
|
-
result._initValue();
|
|
549
|
-
if (typeof defaultValue === "string") result.value.string = defaultValue;
|
|
550
|
-
else if (typeof defaultValue === "number") if (isInteger(defaultValue)) result.value.integer = defaultValue;
|
|
551
|
-
else result.value.float = defaultValue;
|
|
552
|
-
else if (typeof defaultValue === "boolean") result.value.boolean = defaultValue;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
convertToCapnpDefault.__type = [
|
|
556
|
-
"defaultValue",
|
|
557
|
-
"result",
|
|
558
|
-
"convertToCapnpDefault",
|
|
559
|
-
"P\"2!!2\"\"/#"
|
|
560
|
-
];
|
|
561
|
-
function convertFromCapnpDefault(serializedType) {
|
|
562
|
-
if (typeof serializedType.value === "undefined") return;
|
|
563
|
-
else if (serializedType.value._isBoolean) return serializedType.value.boolean;
|
|
564
|
-
else if (serializedType.value._isInteger) return serializedType.value.integer;
|
|
565
|
-
else if (serializedType.value._isFloat) return serializedType.value.float;
|
|
566
|
-
else if (serializedType.value._isString) return serializedType.value.string;
|
|
567
|
-
}
|
|
568
|
-
convertFromCapnpDefault.__type = [
|
|
569
|
-
"serializedType",
|
|
570
|
-
"convertFromCapnpDefault",
|
|
571
|
-
"P!2!\"/\""
|
|
572
|
-
];
|
|
573
|
-
function convertToCapnpPropertySignature(serializedType, result) {
|
|
574
|
-
result.kind = serializedType.kind;
|
|
575
|
-
result.name = String(serializedType.name) || "";
|
|
576
|
-
result.typeName = serializedType.typeName || "";
|
|
577
|
-
result.description = serializedType.description || "";
|
|
578
|
-
result.optional = serializedType.optional ?? false;
|
|
579
|
-
result.readonly = serializedType.readonly ?? false;
|
|
580
|
-
if (typeof serializedType.default !== "undefined") {
|
|
581
|
-
const defaultValue = result._initDefault();
|
|
582
|
-
convertToCapnpDefault(serializedType.default, defaultValue);
|
|
583
|
-
}
|
|
584
|
-
const type = result._initType();
|
|
585
|
-
type.id = serializedType.type;
|
|
586
|
-
if (serializedType.decorators?.length) {
|
|
587
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
588
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
589
|
-
const decorator = decorators.get(index);
|
|
590
|
-
decorator.id = d;
|
|
591
|
-
}, [
|
|
592
|
-
"d",
|
|
593
|
-
"index",
|
|
594
|
-
"",
|
|
595
|
-
"P\"2!\"2\"\"/#"
|
|
596
|
-
]));
|
|
597
|
-
}
|
|
598
|
-
if (serializedType.typeArguments?.length) {
|
|
599
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
600
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
601
|
-
const typeArgument = typeArguments.get(index);
|
|
602
|
-
typeArgument.id = t;
|
|
603
|
-
}, [
|
|
604
|
-
"t",
|
|
605
|
-
"index",
|
|
606
|
-
"",
|
|
607
|
-
"P\"2!\"2\"\"/#"
|
|
608
|
-
]));
|
|
609
|
-
}
|
|
610
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
611
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
612
|
-
return result;
|
|
613
|
-
}
|
|
614
|
-
convertToCapnpPropertySignature.__type = [
|
|
615
|
-
() => __ΩSerializedTypePropertySignature,
|
|
616
|
-
"serializedType",
|
|
617
|
-
"result",
|
|
618
|
-
"convertToCapnpPropertySignature",
|
|
619
|
-
"Pn!2\"!2#!/$"
|
|
620
|
-
];
|
|
621
|
-
function convertToCapnpTupleMember(serializedType, result) {
|
|
622
|
-
result.kind = serializedType.kind;
|
|
623
|
-
result.typeName = serializedType.typeName || "";
|
|
624
|
-
const type = result._initType();
|
|
625
|
-
type.id = serializedType.type;
|
|
626
|
-
if (serializedType.decorators?.length) {
|
|
627
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
628
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
629
|
-
const decorator = decorators.get(index);
|
|
630
|
-
decorator.id = d;
|
|
631
|
-
}, [
|
|
632
|
-
"d",
|
|
633
|
-
"index",
|
|
634
|
-
"",
|
|
635
|
-
"P\"2!\"2\"\"/#"
|
|
636
|
-
]));
|
|
637
|
-
}
|
|
638
|
-
if (serializedType.typeArguments?.length) {
|
|
639
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
640
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
641
|
-
const typeArgument = typeArguments.get(index);
|
|
642
|
-
typeArgument.id = t;
|
|
643
|
-
}, [
|
|
644
|
-
"t",
|
|
645
|
-
"index",
|
|
646
|
-
"",
|
|
647
|
-
"P\"2!\"2\"\"/#"
|
|
648
|
-
]));
|
|
649
|
-
}
|
|
650
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
651
|
-
return result;
|
|
652
|
-
}
|
|
653
|
-
convertToCapnpTupleMember.__type = [
|
|
654
|
-
() => __ΩSerializedTypeTupleMember,
|
|
655
|
-
"serializedType",
|
|
656
|
-
"result",
|
|
657
|
-
"convertToCapnpTupleMember",
|
|
658
|
-
"Pn!2\"!2#!/$"
|
|
659
|
-
];
|
|
660
|
-
function convertFromCapnpTupleMember(serializedType) {
|
|
661
|
-
return {
|
|
662
|
-
kind: ReflectionKind.tupleMember,
|
|
663
|
-
type: serializedType.type.id,
|
|
664
|
-
typeName: serializedType.typeName || void 0,
|
|
665
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
666
|
-
"d",
|
|
667
|
-
"",
|
|
668
|
-
"P\"2!\"/\""
|
|
669
|
-
])) : void 0,
|
|
670
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
671
|
-
"t",
|
|
672
|
-
"",
|
|
673
|
-
"P\"2!\"/\""
|
|
674
|
-
])) : void 0,
|
|
675
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
convertFromCapnpTupleMember.__type = [
|
|
679
|
-
"serializedType",
|
|
680
|
-
() => __ΩSerializedTypeTupleMember,
|
|
681
|
-
"convertFromCapnpTupleMember",
|
|
682
|
-
"P!2!n\"/#"
|
|
683
|
-
];
|
|
684
|
-
function convertToCapnpTuple(serializedType, result) {
|
|
685
|
-
result.kind = serializedType.kind;
|
|
686
|
-
result.typeName = serializedType.typeName || "";
|
|
687
|
-
const types = result._initTypes(serializedType.types.length);
|
|
688
|
-
serializedType.types.forEach(__assignType((t, index) => {
|
|
689
|
-
convertToCapnpTupleMember(t, types.get(index));
|
|
690
|
-
}, [
|
|
691
|
-
"t",
|
|
692
|
-
"index",
|
|
693
|
-
"",
|
|
694
|
-
"P\"2!\"2\"\"/#"
|
|
695
|
-
]));
|
|
696
|
-
if (serializedType.decorators?.length) {
|
|
697
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
698
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
699
|
-
const decorator = decorators.get(index);
|
|
700
|
-
decorator.id = d;
|
|
701
|
-
}, [
|
|
702
|
-
"d",
|
|
703
|
-
"index",
|
|
704
|
-
"",
|
|
705
|
-
"P\"2!\"2\"\"/#"
|
|
706
|
-
]));
|
|
707
|
-
}
|
|
708
|
-
if (serializedType.typeArguments?.length) {
|
|
709
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
710
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
711
|
-
const typeArgument = typeArguments.get(index);
|
|
712
|
-
typeArgument.id = t;
|
|
713
|
-
}, [
|
|
714
|
-
"t",
|
|
715
|
-
"index",
|
|
716
|
-
"",
|
|
717
|
-
"P\"2!\"2\"\"/#"
|
|
718
|
-
]));
|
|
719
|
-
}
|
|
720
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
721
|
-
return result;
|
|
722
|
-
}
|
|
723
|
-
convertToCapnpTuple.__type = [
|
|
724
|
-
() => __ΩSerializedTypeTuple,
|
|
725
|
-
"serializedType",
|
|
726
|
-
"result",
|
|
727
|
-
"convertToCapnpTuple",
|
|
728
|
-
"Pn!2\"!2#!/$"
|
|
729
|
-
];
|
|
730
|
-
function convertFromCapnpTuple(serializedType) {
|
|
731
|
-
return {
|
|
732
|
-
kind: ReflectionKind.tuple,
|
|
733
|
-
typeName: serializedType.typeName || void 0,
|
|
734
|
-
types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => convertFromCapnpTupleMember(t), [
|
|
735
|
-
"t",
|
|
736
|
-
"",
|
|
737
|
-
"P\"2!\"/\""
|
|
738
|
-
])) : [],
|
|
739
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
740
|
-
"d",
|
|
741
|
-
"",
|
|
742
|
-
"P\"2!\"/\""
|
|
743
|
-
])) : void 0,
|
|
744
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
745
|
-
"t",
|
|
746
|
-
"",
|
|
747
|
-
"P\"2!\"/\""
|
|
748
|
-
])) : void 0,
|
|
749
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
convertFromCapnpTuple.__type = [
|
|
753
|
-
"serializedType",
|
|
754
|
-
() => __ΩSerializedTypeTuple,
|
|
755
|
-
"convertFromCapnpTuple",
|
|
756
|
-
"P!2!n\"/#"
|
|
757
|
-
];
|
|
758
|
-
function convertToCapnpProperty(serializedType, result) {
|
|
759
|
-
result.kind = serializedType.kind;
|
|
760
|
-
result.typeName = serializedType.typeName || "";
|
|
761
|
-
result.description = serializedType.description || "";
|
|
762
|
-
result.optional = serializedType.optional ?? false;
|
|
763
|
-
result.readonly = serializedType.readonly ?? false;
|
|
764
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ? ReflectionVisibility$1.PUBLIC : serializedType.visibility === ReflectionVisibility.protected ? ReflectionVisibility$1.PROTECTED : ReflectionVisibility$1.PRIVATE;
|
|
765
|
-
result.abstract = serializedType.abstract ?? false;
|
|
766
|
-
result.name = String(serializedType.name) || "";
|
|
767
|
-
if (typeof serializedType.default !== "undefined") {
|
|
768
|
-
const defaultValue = result._initDefault();
|
|
769
|
-
convertToCapnpDefault(serializedType.default, defaultValue);
|
|
770
|
-
}
|
|
771
|
-
const type = result._initType();
|
|
772
|
-
type.id = serializedType.type;
|
|
773
|
-
if (serializedType.decorators?.length) {
|
|
774
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
775
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
776
|
-
const decorator = decorators.get(index);
|
|
777
|
-
decorator.id = d;
|
|
778
|
-
}, [
|
|
779
|
-
"d",
|
|
780
|
-
"index",
|
|
781
|
-
"",
|
|
782
|
-
"P\"2!\"2\"\"/#"
|
|
783
|
-
]));
|
|
784
|
-
}
|
|
785
|
-
if (serializedType.typeArguments?.length) {
|
|
786
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
787
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
788
|
-
const typeArgument = typeArguments.get(index);
|
|
789
|
-
typeArgument.id = t;
|
|
790
|
-
}, [
|
|
791
|
-
"t",
|
|
792
|
-
"index",
|
|
793
|
-
"",
|
|
794
|
-
"P\"2!\"2\"\"/#"
|
|
795
|
-
]));
|
|
796
|
-
}
|
|
797
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
798
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
799
|
-
return result;
|
|
800
|
-
}
|
|
801
|
-
convertToCapnpProperty.__type = [
|
|
802
|
-
() => __ΩSerializedTypeProperty,
|
|
803
|
-
"serializedType",
|
|
804
|
-
"result",
|
|
805
|
-
"convertToCapnpProperty",
|
|
806
|
-
"Pn!2\"!2#!/$"
|
|
807
|
-
];
|
|
808
|
-
function convertFromCapnpProperty(serializedType) {
|
|
809
|
-
return {
|
|
810
|
-
kind: ReflectionKind.property,
|
|
811
|
-
typeName: serializedType.typeName || void 0,
|
|
812
|
-
description: serializedType.description,
|
|
813
|
-
default: convertFromCapnpDefault(serializedType.default),
|
|
814
|
-
optional: serializedType.optional ? true : void 0,
|
|
815
|
-
readonly: serializedType.readonly ? true : void 0,
|
|
816
|
-
visibility: serializedType.visibility === ReflectionVisibility$1.PUBLIC ? ReflectionVisibility.public : serializedType.visibility === ReflectionVisibility$1.PROTECTED ? ReflectionVisibility.protected : ReflectionVisibility.private,
|
|
817
|
-
abstract: serializedType.abstract ? true : void 0,
|
|
818
|
-
name: serializedType.name,
|
|
819
|
-
type: serializedType.type.id,
|
|
820
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
821
|
-
"d",
|
|
822
|
-
"",
|
|
823
|
-
"P\"2!\"/\""
|
|
824
|
-
])) : void 0,
|
|
825
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
826
|
-
"t",
|
|
827
|
-
"",
|
|
828
|
-
"P\"2!\"/\""
|
|
829
|
-
])) : void 0,
|
|
830
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
831
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
convertFromCapnpProperty.__type = [
|
|
835
|
-
"serializedType",
|
|
836
|
-
() => __ΩSerializedTypeProperty,
|
|
837
|
-
"convertFromCapnpProperty",
|
|
838
|
-
"P!2!n\"/#"
|
|
839
|
-
];
|
|
840
|
-
function convertToCapnpEnum(serializedType, result) {
|
|
841
|
-
result.kind = serializedType.kind;
|
|
842
|
-
result.typeName = serializedType.typeName || "";
|
|
843
|
-
const indexType = result._initIndexType();
|
|
844
|
-
indexType.id = serializedType.indexType;
|
|
845
|
-
if (serializedType.decorators?.length) {
|
|
846
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
847
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
848
|
-
const decorator = decorators.get(index);
|
|
849
|
-
decorator.id = d;
|
|
850
|
-
}, [
|
|
851
|
-
"d",
|
|
852
|
-
"index",
|
|
853
|
-
"",
|
|
854
|
-
"P\"2!\"2\"\"/#"
|
|
855
|
-
]));
|
|
856
|
-
}
|
|
857
|
-
if (serializedType.typeArguments?.length) {
|
|
858
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
859
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
860
|
-
const typeArgument = typeArguments.get(index);
|
|
861
|
-
typeArgument.id = t;
|
|
862
|
-
}, [
|
|
863
|
-
"t",
|
|
864
|
-
"index",
|
|
865
|
-
"",
|
|
866
|
-
"P\"2!\"2\"\"/#"
|
|
867
|
-
]));
|
|
868
|
-
}
|
|
869
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
870
|
-
if (serializedType.values?.length) {
|
|
871
|
-
const values = result._initValues(serializedType.values?.length);
|
|
872
|
-
serializedType.values.forEach(__assignType((value, index) => {
|
|
873
|
-
values.set(index, String(value));
|
|
874
|
-
}, [
|
|
875
|
-
"value",
|
|
876
|
-
"index",
|
|
877
|
-
"",
|
|
878
|
-
"P\"2!\"2\"\"/#"
|
|
879
|
-
]));
|
|
880
|
-
}
|
|
881
|
-
const enumEntries = result._initEnumEntries(Object.keys(serializedType.enum).length ?? 0);
|
|
882
|
-
Object.entries(serializedType.enum).forEach(__assignType(([key, value], index) => {
|
|
883
|
-
const enumEntry = enumEntries.get(index);
|
|
884
|
-
enumEntry.name = key;
|
|
885
|
-
enumEntry.value = String(value);
|
|
886
|
-
}, [
|
|
887
|
-
"param0",
|
|
888
|
-
"index",
|
|
889
|
-
"",
|
|
890
|
-
"P\"2!\"2\"\"/#"
|
|
891
|
-
]));
|
|
892
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
893
|
-
return result;
|
|
894
|
-
}
|
|
895
|
-
convertToCapnpEnum.__type = [
|
|
896
|
-
() => __ΩSerializedTypeEnum,
|
|
897
|
-
"serializedType",
|
|
898
|
-
"result",
|
|
899
|
-
"convertToCapnpEnum",
|
|
900
|
-
"Pn!2\"!2#!/$"
|
|
901
|
-
];
|
|
902
|
-
function convertFromCapnpEnum(serializedType) {
|
|
903
|
-
return {
|
|
904
|
-
kind: ReflectionKind.enum,
|
|
905
|
-
typeName: serializedType.typeName || void 0,
|
|
906
|
-
indexType: serializedType.indexType.id,
|
|
907
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
908
|
-
"d",
|
|
909
|
-
"",
|
|
910
|
-
"P\"2!\"/\""
|
|
911
|
-
])) : void 0,
|
|
912
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
913
|
-
"t",
|
|
914
|
-
"",
|
|
915
|
-
"P\"2!\"/\""
|
|
916
|
-
])) : void 0,
|
|
917
|
-
values: serializedType._hasValues() ? serializedType.values.map(__assignType((value) => value, [
|
|
918
|
-
"value",
|
|
919
|
-
"",
|
|
920
|
-
"P\"2!\"/\""
|
|
921
|
-
])) : [],
|
|
922
|
-
enum: serializedType._hasEnumEntries() ? Object.entries(serializedType.enumEntries).reduce(__assignType((ret, [key, value]) => {
|
|
923
|
-
ret[key] = value.value;
|
|
924
|
-
return ret;
|
|
925
|
-
}, [
|
|
926
|
-
"ret",
|
|
927
|
-
"param1",
|
|
928
|
-
"",
|
|
929
|
-
"P\"2!\"2\"\"/#"
|
|
930
|
-
]), {}) : {},
|
|
931
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
932
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
convertFromCapnpEnum.__type = [
|
|
936
|
-
"serializedType",
|
|
937
|
-
() => __ΩSerializedTypeEnum,
|
|
938
|
-
"convertFromCapnpEnum",
|
|
939
|
-
"P!2!n\"/#"
|
|
940
|
-
];
|
|
941
|
-
function convertToCapnpIntersection(serializedType, result) {
|
|
942
|
-
result.kind = serializedType.kind;
|
|
943
|
-
result.typeName = serializedType.typeName || "";
|
|
944
|
-
const types = result._initTypes(serializedType.types?.length ?? 0);
|
|
945
|
-
serializedType.types?.forEach(__assignType((t, index) => {
|
|
946
|
-
const serializedTypeType = types.get(index);
|
|
947
|
-
serializedTypeType.id = t;
|
|
948
|
-
}, [
|
|
949
|
-
"t",
|
|
950
|
-
"index",
|
|
951
|
-
"",
|
|
952
|
-
"P\"2!\"2\"\"/#"
|
|
953
|
-
]));
|
|
954
|
-
if (serializedType.decorators?.length) {
|
|
955
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
956
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
957
|
-
const decorator = decorators.get(index);
|
|
958
|
-
decorator.id = d;
|
|
959
|
-
}, [
|
|
960
|
-
"d",
|
|
961
|
-
"index",
|
|
962
|
-
"",
|
|
963
|
-
"P\"2!\"2\"\"/#"
|
|
964
|
-
]));
|
|
965
|
-
}
|
|
966
|
-
if (serializedType.typeArguments?.length) {
|
|
967
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
968
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
969
|
-
const typeArgument = typeArguments.get(index);
|
|
970
|
-
typeArgument.id = t;
|
|
971
|
-
}, [
|
|
972
|
-
"t",
|
|
973
|
-
"index",
|
|
974
|
-
"",
|
|
975
|
-
"P\"2!\"2\"\"/#"
|
|
976
|
-
]));
|
|
977
|
-
}
|
|
978
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
979
|
-
return result;
|
|
980
|
-
}
|
|
981
|
-
convertToCapnpIntersection.__type = [
|
|
982
|
-
() => __ΩSerializedTypeIntersection,
|
|
983
|
-
"serializedType",
|
|
984
|
-
"result",
|
|
985
|
-
"convertToCapnpIntersection",
|
|
986
|
-
"Pn!2\"!2#!/$"
|
|
987
|
-
];
|
|
988
|
-
function convertFromCapnpIntersection(serializedType) {
|
|
989
|
-
return {
|
|
990
|
-
kind: ReflectionKind.intersection,
|
|
991
|
-
typeName: serializedType.typeName || void 0,
|
|
992
|
-
types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
|
|
993
|
-
"t",
|
|
994
|
-
"",
|
|
995
|
-
"P\"2!\"/\""
|
|
996
|
-
])) : [],
|
|
997
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
998
|
-
"d",
|
|
999
|
-
"",
|
|
1000
|
-
"P\"2!\"/\""
|
|
1001
|
-
])) : void 0,
|
|
1002
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1003
|
-
"t",
|
|
1004
|
-
"",
|
|
1005
|
-
"P\"2!\"/\""
|
|
1006
|
-
])) : void 0,
|
|
1007
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
1008
|
-
};
|
|
1009
|
-
}
|
|
1010
|
-
convertFromCapnpIntersection.__type = [
|
|
1011
|
-
"serializedType",
|
|
1012
|
-
() => __ΩSerializedTypeIntersection,
|
|
1013
|
-
"convertFromCapnpIntersection",
|
|
1014
|
-
"P!2!n\"/#"
|
|
1015
|
-
];
|
|
1016
|
-
function convertToCapnpArray(serializedType, result) {
|
|
1017
|
-
result.kind = serializedType.kind;
|
|
1018
|
-
result.typeName = serializedType.typeName || "";
|
|
1019
|
-
const type = result._initType();
|
|
1020
|
-
type.id = serializedType.type;
|
|
1021
|
-
if (serializedType.decorators?.length) {
|
|
1022
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
1023
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
1024
|
-
const decorator = decorators.get(index);
|
|
1025
|
-
decorator.id = d;
|
|
1026
|
-
}, [
|
|
1027
|
-
"d",
|
|
1028
|
-
"index",
|
|
1029
|
-
"",
|
|
1030
|
-
"P\"2!\"2\"\"/#"
|
|
1031
|
-
]));
|
|
1032
|
-
}
|
|
1033
|
-
if (serializedType.typeArguments?.length) {
|
|
1034
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
1035
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
1036
|
-
const typeArgument = typeArguments.get(index);
|
|
1037
|
-
typeArgument.id = t;
|
|
1038
|
-
}, [
|
|
1039
|
-
"t",
|
|
1040
|
-
"index",
|
|
1041
|
-
"",
|
|
1042
|
-
"P\"2!\"2\"\"/#"
|
|
1043
|
-
]));
|
|
1044
|
-
}
|
|
1045
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1046
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1047
|
-
return result;
|
|
1048
|
-
}
|
|
1049
|
-
convertToCapnpArray.__type = [
|
|
1050
|
-
() => __ΩSerializedTypeArray,
|
|
1051
|
-
"serializedType",
|
|
1052
|
-
"result",
|
|
1053
|
-
"convertToCapnpArray",
|
|
1054
|
-
"Pn!2\"!2#!/$"
|
|
1055
|
-
];
|
|
1056
|
-
function convertFromCapnpArray(serializedType) {
|
|
1057
|
-
return {
|
|
1058
|
-
kind: ReflectionKind.array,
|
|
1059
|
-
typeName: serializedType.typeName || void 0,
|
|
1060
|
-
type: serializedType.type.id,
|
|
1061
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1062
|
-
"d",
|
|
1063
|
-
"",
|
|
1064
|
-
"P\"2!\"/\""
|
|
1065
|
-
])) : void 0,
|
|
1066
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1067
|
-
"t",
|
|
1068
|
-
"",
|
|
1069
|
-
"P\"2!\"/\""
|
|
1070
|
-
])) : void 0,
|
|
1071
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
1072
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
convertFromCapnpArray.__type = [
|
|
1076
|
-
"serializedType",
|
|
1077
|
-
() => __ΩSerializedTypeArray,
|
|
1078
|
-
"convertFromCapnpArray",
|
|
1079
|
-
"P!2!n\"/#"
|
|
1080
|
-
];
|
|
1081
|
-
/**
|
|
1082
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1083
|
-
*
|
|
1084
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1085
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1086
|
-
*/
|
|
1087
|
-
function convertToCapnpUnion(serializedType, result) {
|
|
1088
|
-
result.kind = serializedType.kind;
|
|
1089
|
-
result.typeName = serializedType.typeName || "";
|
|
1090
|
-
const types = result._initTypes(serializedType.types?.length ?? 0);
|
|
1091
|
-
serializedType.types?.forEach(__assignType((t, index) => {
|
|
1092
|
-
const serializedTypeType = types.get(index);
|
|
1093
|
-
serializedTypeType.id = t;
|
|
1094
|
-
}, [
|
|
1095
|
-
"t",
|
|
1096
|
-
"index",
|
|
1097
|
-
"",
|
|
1098
|
-
"P\"2!\"2\"\"/#"
|
|
1099
|
-
]));
|
|
1100
|
-
if (serializedType.decorators?.length) {
|
|
1101
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
1102
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
1103
|
-
const decorator = decorators.get(index);
|
|
1104
|
-
decorator.id = d;
|
|
1105
|
-
}, [
|
|
1106
|
-
"d",
|
|
1107
|
-
"index",
|
|
1108
|
-
"",
|
|
1109
|
-
"P\"2!\"2\"\"/#"
|
|
1110
|
-
]));
|
|
1111
|
-
}
|
|
1112
|
-
if (serializedType.typeArguments?.length) {
|
|
1113
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
1114
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
1115
|
-
const typeArgument = typeArguments.get(index);
|
|
1116
|
-
typeArgument.id = t;
|
|
1117
|
-
}, [
|
|
1118
|
-
"t",
|
|
1119
|
-
"index",
|
|
1120
|
-
"",
|
|
1121
|
-
"P\"2!\"2\"\"/#"
|
|
1122
|
-
]));
|
|
1123
|
-
}
|
|
1124
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1125
|
-
return result;
|
|
1126
|
-
}
|
|
1127
|
-
convertToCapnpUnion.__type = [
|
|
1128
|
-
() => __ΩSerializedTypeUnion,
|
|
1129
|
-
"serializedType",
|
|
1130
|
-
"result",
|
|
1131
|
-
"convertToCapnpUnion",
|
|
1132
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1133
|
-
"Pn!2\"!2#!/$?%"
|
|
1134
|
-
];
|
|
1135
|
-
function convertFromCapnpUnion(serializedType) {
|
|
1136
|
-
return {
|
|
1137
|
-
kind: ReflectionKind.union,
|
|
1138
|
-
typeName: serializedType.typeName || void 0,
|
|
1139
|
-
types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
|
|
1140
|
-
"t",
|
|
1141
|
-
"",
|
|
1142
|
-
"P\"2!\"/\""
|
|
1143
|
-
])) : [],
|
|
1144
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1145
|
-
"d",
|
|
1146
|
-
"",
|
|
1147
|
-
"P\"2!\"/\""
|
|
1148
|
-
])) : void 0,
|
|
1149
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1150
|
-
"t",
|
|
1151
|
-
"",
|
|
1152
|
-
"P\"2!\"/\""
|
|
1153
|
-
])) : void 0,
|
|
1154
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
1155
|
-
};
|
|
1156
|
-
}
|
|
1157
|
-
convertFromCapnpUnion.__type = [
|
|
1158
|
-
"serializedType",
|
|
1159
|
-
() => __ΩSerializedTypeUnion,
|
|
1160
|
-
"convertFromCapnpUnion",
|
|
1161
|
-
"P!2!n\"/#"
|
|
1162
|
-
];
|
|
1163
|
-
/**
|
|
1164
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1165
|
-
*
|
|
1166
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert.
|
|
1167
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1168
|
-
*/
|
|
1169
|
-
function convertToCapnpInfer(serializedType, result) {
|
|
1170
|
-
result.kind = serializedType.kind;
|
|
1171
|
-
result.typeName = serializedType.typeName || "";
|
|
1172
|
-
if (serializedType.decorators?.length) {
|
|
1173
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
1174
|
-
serializedType.decorators?.forEach(__assignType((d, index) => {
|
|
1175
|
-
const decorator = decorators.get(index);
|
|
1176
|
-
decorator.id = d;
|
|
1177
|
-
}, [
|
|
1178
|
-
"d",
|
|
1179
|
-
"index",
|
|
1180
|
-
"",
|
|
1181
|
-
"P\"2!\"2\"\"/#"
|
|
1182
|
-
]));
|
|
1183
|
-
}
|
|
1184
|
-
if (serializedType.typeArguments?.length) {
|
|
1185
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
|
|
1186
|
-
serializedType.typeArguments?.forEach(__assignType((t, index) => {
|
|
1187
|
-
const typeArgument = typeArguments.get(index);
|
|
1188
|
-
typeArgument.id = t;
|
|
1189
|
-
}, [
|
|
1190
|
-
"t",
|
|
1191
|
-
"index",
|
|
1192
|
-
"",
|
|
1193
|
-
"P\"2!\"2\"\"/#"
|
|
1194
|
-
]));
|
|
1195
|
-
}
|
|
1196
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1197
|
-
return result;
|
|
1198
|
-
}
|
|
1199
|
-
convertToCapnpInfer.__type = [
|
|
1200
|
-
() => __ΩSerializedTypeInfer,
|
|
1201
|
-
"serializedType",
|
|
1202
|
-
"result",
|
|
1203
|
-
"convertToCapnpInfer",
|
|
1204
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1205
|
-
"Pn!2\"!2#!/$?%"
|
|
1206
|
-
];
|
|
1207
|
-
function convertFromCapnpInfer(serializedType) {
|
|
1208
|
-
return {
|
|
1209
|
-
kind: ReflectionKind.infer,
|
|
1210
|
-
typeName: serializedType.typeName || void 0,
|
|
1211
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1212
|
-
"d",
|
|
1213
|
-
"",
|
|
1214
|
-
"P\"2!\"/\""
|
|
1215
|
-
])) : void 0,
|
|
1216
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1217
|
-
"t",
|
|
1218
|
-
"",
|
|
1219
|
-
"P\"2!\"/\""
|
|
1220
|
-
])) : void 0,
|
|
1221
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
|
|
1222
|
-
};
|
|
1223
|
-
}
|
|
1224
|
-
convertFromCapnpInfer.__type = [
|
|
1225
|
-
"serializedType",
|
|
1226
|
-
() => __ΩSerializedTypeInfer,
|
|
1227
|
-
"convertFromCapnpInfer",
|
|
1228
|
-
"P!2!n\"/#"
|
|
1229
|
-
];
|
|
1230
|
-
/**
|
|
1231
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1232
|
-
*
|
|
1233
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1234
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1235
|
-
*/
|
|
1236
|
-
function convertToCapnpFunction(serializedType, result) {
|
|
1237
|
-
result.name = String(serializedType.name) || "";
|
|
1238
|
-
result.kind = serializedType.kind;
|
|
1239
|
-
result.typeName = serializedType.typeName || "";
|
|
1240
|
-
if (serializedType.decorators?.length) {
|
|
1241
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
1242
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
1243
|
-
const decorator = decorators.get(index);
|
|
1244
|
-
decorator.id = d;
|
|
1245
|
-
}, [
|
|
1246
|
-
"d",
|
|
1247
|
-
"index",
|
|
1248
|
-
"",
|
|
1249
|
-
"P\"2!\"2\"\"/#"
|
|
1250
|
-
]));
|
|
1251
|
-
}
|
|
1252
|
-
if (serializedType.typeArguments?.length) {
|
|
1253
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
1254
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
1255
|
-
const typeArgument = typeArguments.get(index);
|
|
1256
|
-
typeArgument.id = t;
|
|
1257
|
-
}, [
|
|
1258
|
-
"t",
|
|
1259
|
-
"index",
|
|
1260
|
-
"",
|
|
1261
|
-
"P\"2!\"2\"\"/#"
|
|
1262
|
-
]));
|
|
1263
|
-
}
|
|
1264
|
-
if (serializedType.parameters?.length) {
|
|
1265
|
-
const parameters = result._initParameters(serializedType.parameters.length);
|
|
1266
|
-
serializedType.parameters.forEach(__assignType((p, index) => {
|
|
1267
|
-
convertToCapnpParameter(p, parameters.get(index));
|
|
1268
|
-
}, [
|
|
1269
|
-
"p",
|
|
1270
|
-
"index",
|
|
1271
|
-
"",
|
|
1272
|
-
"P\"2!\"2\"\"/#"
|
|
1273
|
-
]));
|
|
1274
|
-
}
|
|
1275
|
-
const returnType = result._initReturn();
|
|
1276
|
-
returnType.id = serializedType.return;
|
|
1277
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1278
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1279
|
-
return result;
|
|
1280
|
-
}
|
|
1281
|
-
convertToCapnpFunction.__type = [
|
|
1282
|
-
() => __ΩSerializedTypeFunction,
|
|
1283
|
-
"serializedType",
|
|
1284
|
-
"result",
|
|
1285
|
-
"convertToCapnpFunction",
|
|
1286
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1287
|
-
"Pn!2\"!2#!/$?%"
|
|
1288
|
-
];
|
|
1289
|
-
/**
|
|
1290
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1291
|
-
*
|
|
1292
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1293
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1294
|
-
*/
|
|
1295
|
-
function convertToCapnpMethod(serializedType, result) {
|
|
1296
|
-
result.name = String(serializedType.name) || "";
|
|
1297
|
-
result.kind = serializedType.kind;
|
|
1298
|
-
result.typeName = serializedType.typeName || "";
|
|
1299
|
-
result.abstract = serializedType.abstract ?? false;
|
|
1300
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ? ReflectionVisibility$1.PUBLIC : serializedType.visibility === ReflectionVisibility.protected ? ReflectionVisibility$1.PROTECTED : ReflectionVisibility$1.PRIVATE;
|
|
1301
|
-
if (serializedType.decorators?.length) {
|
|
1302
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
1303
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
1304
|
-
const decorator = decorators.get(index);
|
|
1305
|
-
decorator.id = d;
|
|
1306
|
-
}, [
|
|
1307
|
-
"d",
|
|
1308
|
-
"index",
|
|
1309
|
-
"",
|
|
1310
|
-
"P\"2!\"2\"\"/#"
|
|
1311
|
-
]));
|
|
1312
|
-
}
|
|
1313
|
-
if (serializedType.typeArguments?.length) {
|
|
1314
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
1315
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
1316
|
-
const typeArgument = typeArguments.get(index);
|
|
1317
|
-
typeArgument.id = t;
|
|
1318
|
-
}, [
|
|
1319
|
-
"t",
|
|
1320
|
-
"index",
|
|
1321
|
-
"",
|
|
1322
|
-
"P\"2!\"2\"\"/#"
|
|
1323
|
-
]));
|
|
1324
|
-
}
|
|
1325
|
-
if (serializedType.parameters?.length) {
|
|
1326
|
-
const parameters = result._initParameters(serializedType.parameters.length);
|
|
1327
|
-
serializedType.parameters.forEach(__assignType((p, index) => {
|
|
1328
|
-
convertToCapnpParameter(p, parameters.get(index));
|
|
1329
|
-
}, [
|
|
1330
|
-
"p",
|
|
1331
|
-
"index",
|
|
1332
|
-
"",
|
|
1333
|
-
"P\"2!\"2\"\"/#"
|
|
1334
|
-
]));
|
|
1335
|
-
}
|
|
1336
|
-
const returnType = result._initReturn();
|
|
1337
|
-
returnType.id = serializedType.return;
|
|
1338
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1339
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1340
|
-
return result;
|
|
1341
|
-
}
|
|
1342
|
-
convertToCapnpMethod.__type = [
|
|
1343
|
-
() => __ΩSerializedTypeMethod,
|
|
1344
|
-
"serializedType",
|
|
1345
|
-
"result",
|
|
1346
|
-
"convertToCapnpMethod",
|
|
1347
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1348
|
-
"Pn!2\"!2#!/$?%"
|
|
1349
|
-
];
|
|
1350
|
-
function convertFromCapnpFunction(serializedType) {
|
|
1351
|
-
return {
|
|
1352
|
-
kind: ReflectionKind.function,
|
|
1353
|
-
name: serializedType.name,
|
|
1354
|
-
typeName: serializedType.typeName || void 0,
|
|
1355
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1356
|
-
"d",
|
|
1357
|
-
"",
|
|
1358
|
-
"P\"2!\"/\""
|
|
1359
|
-
])) : void 0,
|
|
1360
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1361
|
-
"t",
|
|
1362
|
-
"",
|
|
1363
|
-
"P\"2!\"/\""
|
|
1364
|
-
])) : void 0,
|
|
1365
|
-
parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((p) => convertFromCapnpParameter(p), [
|
|
1366
|
-
"p",
|
|
1367
|
-
"",
|
|
1368
|
-
"P\"2!\"/\""
|
|
1369
|
-
])) : [],
|
|
1370
|
-
return: serializedType.return.id,
|
|
1371
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
1372
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
1373
|
-
};
|
|
1374
|
-
}
|
|
1375
|
-
convertFromCapnpFunction.__type = [
|
|
1376
|
-
"serializedType",
|
|
1377
|
-
() => __ΩSerializedTypeFunction,
|
|
1378
|
-
"convertFromCapnpFunction",
|
|
1379
|
-
"P!2!n\"/#"
|
|
1380
|
-
];
|
|
1381
|
-
function convertFromCapnpMethod(serializedType) {
|
|
1382
|
-
return {
|
|
1383
|
-
kind: ReflectionKind.method,
|
|
1384
|
-
name: serializedType.name,
|
|
1385
|
-
typeName: serializedType.typeName || void 0,
|
|
1386
|
-
abstract: serializedType.abstract ? true : void 0,
|
|
1387
|
-
return: serializedType.return.id,
|
|
1388
|
-
visibility: serializedType.visibility === ReflectionVisibility$1.PUBLIC ? ReflectionVisibility.public : serializedType.visibility === ReflectionVisibility$1.PROTECTED ? ReflectionVisibility.protected : ReflectionVisibility.private,
|
|
1389
|
-
parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((parameter) => convertFromCapnpParameter(parameter), [
|
|
1390
|
-
"parameter",
|
|
1391
|
-
"",
|
|
1392
|
-
"P\"2!\"/\""
|
|
1393
|
-
])) : []
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
convertFromCapnpMethod.__type = [
|
|
1397
|
-
"serializedType",
|
|
1398
|
-
() => __ΩSerializedTypeMethod,
|
|
1399
|
-
"convertFromCapnpMethod",
|
|
1400
|
-
"P!2!n\"/#"
|
|
1401
|
-
];
|
|
1402
|
-
/**
|
|
1403
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1404
|
-
*
|
|
1405
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1406
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1407
|
-
*/
|
|
1408
|
-
function convertToCapnpClassType(serializedType, result) {
|
|
1409
|
-
result.kind = serializedType.kind;
|
|
1410
|
-
result.typeName = serializedType.typeName || "";
|
|
1411
|
-
result.classType = serializedType.classType || "";
|
|
1412
|
-
result.globalObject = serializedType.globalObject ?? false;
|
|
1413
|
-
if (serializedType.arguments?.length) {
|
|
1414
|
-
const _arguments = result._initArguments(serializedType.arguments.length);
|
|
1415
|
-
serializedType.arguments.forEach(__assignType((t, index) => {
|
|
1416
|
-
const serializedTypeArguments = _arguments.get(index);
|
|
1417
|
-
serializedTypeArguments.id = t;
|
|
1418
|
-
}, [
|
|
1419
|
-
"t",
|
|
1420
|
-
"index",
|
|
1421
|
-
"",
|
|
1422
|
-
"P\"2!\"2\"\"/#"
|
|
1423
|
-
]));
|
|
1424
|
-
}
|
|
1425
|
-
if (serializedType.extendsArguments?.length) {
|
|
1426
|
-
const extendsArguments = result._initArguments(serializedType.extendsArguments.length);
|
|
1427
|
-
serializedType.extendsArguments.forEach(__assignType((t, index) => {
|
|
1428
|
-
const serializedTypeExtendsArguments = extendsArguments.get(index);
|
|
1429
|
-
serializedTypeExtendsArguments.id = t;
|
|
1430
|
-
}, [
|
|
1431
|
-
"t",
|
|
1432
|
-
"index",
|
|
1433
|
-
"",
|
|
1434
|
-
"P\"2!\"2\"\"/#"
|
|
1435
|
-
]));
|
|
1436
|
-
}
|
|
1437
|
-
if (serializedType.decorators?.length) {
|
|
1438
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
1439
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
1440
|
-
const decorator = decorators.get(index);
|
|
1441
|
-
decorator.id = d;
|
|
1442
|
-
}, [
|
|
1443
|
-
"d",
|
|
1444
|
-
"index",
|
|
1445
|
-
"",
|
|
1446
|
-
"P\"2!\"2\"\"/#"
|
|
1447
|
-
]));
|
|
1448
|
-
}
|
|
1449
|
-
if (serializedType.typeArguments?.length) {
|
|
1450
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
1451
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
1452
|
-
const typeArgument = typeArguments.get(index);
|
|
1453
|
-
typeArgument.id = t;
|
|
1454
|
-
}, [
|
|
1455
|
-
"t",
|
|
1456
|
-
"index",
|
|
1457
|
-
"",
|
|
1458
|
-
"P\"2!\"2\"\"/#"
|
|
1459
|
-
]));
|
|
1460
|
-
}
|
|
1461
|
-
if (serializedType.superClass) {
|
|
1462
|
-
const superClass = result._initSuperClass();
|
|
1463
|
-
superClass.id = serializedType.superClass;
|
|
1464
|
-
}
|
|
1465
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1466
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1467
|
-
return result;
|
|
1468
|
-
}
|
|
1469
|
-
convertToCapnpClassType.__type = [
|
|
1470
|
-
() => __ΩSerializedTypeClassType,
|
|
1471
|
-
"serializedType",
|
|
1472
|
-
"result",
|
|
1473
|
-
"convertToCapnpClassType",
|
|
1474
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1475
|
-
"Pn!2\"!2#!/$?%"
|
|
1476
|
-
];
|
|
1477
|
-
function convertFromCapnpClassType(serializedType) {
|
|
1478
|
-
return {
|
|
1479
|
-
kind: ReflectionKind.class,
|
|
1480
|
-
typeName: serializedType.typeName || void 0,
|
|
1481
|
-
classType: serializedType.classType,
|
|
1482
|
-
globalObject: serializedType.globalObject ? true : void 0,
|
|
1483
|
-
arguments: serializedType._hasArguments() ? serializedType.arguments.map(__assignType((t) => t.id, [
|
|
1484
|
-
"t",
|
|
1485
|
-
"",
|
|
1486
|
-
"P\"2!\"/\""
|
|
1487
|
-
])) : void 0,
|
|
1488
|
-
extendsArguments: serializedType._hasExtendsArguments() ? serializedType.extendsArguments.map(__assignType((t) => t.id, [
|
|
1489
|
-
"t",
|
|
1490
|
-
"",
|
|
1491
|
-
"P\"2!\"/\""
|
|
1492
|
-
])) : void 0,
|
|
1493
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1494
|
-
"d",
|
|
1495
|
-
"",
|
|
1496
|
-
"P\"2!\"/\""
|
|
1497
|
-
])) : void 0,
|
|
1498
|
-
types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
|
|
1499
|
-
"t",
|
|
1500
|
-
"",
|
|
1501
|
-
"P\"2!\"/\""
|
|
1502
|
-
])) : [],
|
|
1503
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1504
|
-
"t",
|
|
1505
|
-
"",
|
|
1506
|
-
"P\"2!\"/\""
|
|
1507
|
-
])) : void 0,
|
|
1508
|
-
superClass: serializedType._hasSuperClass() ? serializedType.superClass.id : void 0,
|
|
1509
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
1510
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
convertFromCapnpClassType.__type = [
|
|
1514
|
-
"serializedType",
|
|
1515
|
-
() => __ΩSerializedTypeClassType,
|
|
1516
|
-
"convertFromCapnpClassType",
|
|
1517
|
-
"P!2!n\"/#"
|
|
1518
|
-
];
|
|
1519
|
-
/**
|
|
1520
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1521
|
-
*
|
|
1522
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1523
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1524
|
-
*/
|
|
1525
|
-
function convertToCapnpObjectLiteral(serializedType, result) {
|
|
1526
|
-
if (serializedType.decorators?.length) {
|
|
1527
|
-
const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
|
|
1528
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
1529
|
-
const decorator = decorators.get(index);
|
|
1530
|
-
decorator.id = d;
|
|
1531
|
-
}, [
|
|
1532
|
-
"d",
|
|
1533
|
-
"index",
|
|
1534
|
-
"",
|
|
1535
|
-
"P\"2!\"2\"\"/#"
|
|
1536
|
-
]));
|
|
1537
|
-
}
|
|
1538
|
-
if (serializedType.types?.length) {
|
|
1539
|
-
const types = result._initTypes(serializedType.types.length);
|
|
1540
|
-
serializedType.types.forEach(__assignType((t, index) => {
|
|
1541
|
-
const serializedTypeType = types.get(index);
|
|
1542
|
-
serializedTypeType.id = t;
|
|
1543
|
-
}, [
|
|
1544
|
-
"t",
|
|
1545
|
-
"index",
|
|
1546
|
-
"",
|
|
1547
|
-
"P\"2!\"2\"\"/#"
|
|
1548
|
-
]));
|
|
1549
|
-
}
|
|
1550
|
-
if (serializedType.typeArguments?.length) {
|
|
1551
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
1552
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
1553
|
-
const serializedTypeTypeArguments = typeArguments.get(index);
|
|
1554
|
-
serializedTypeTypeArguments.id = t;
|
|
1555
|
-
}, [
|
|
1556
|
-
"t",
|
|
1557
|
-
"index",
|
|
1558
|
-
"",
|
|
1559
|
-
"P\"2!\"2\"\"/#"
|
|
1560
|
-
]));
|
|
1561
|
-
}
|
|
1562
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1563
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1564
|
-
return result;
|
|
1565
|
-
}
|
|
1566
|
-
convertToCapnpObjectLiteral.__type = [
|
|
1567
|
-
() => __ΩSerializedTypeObjectLiteral,
|
|
1568
|
-
"serializedType",
|
|
1569
|
-
"result",
|
|
1570
|
-
"convertToCapnpObjectLiteral",
|
|
1571
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1572
|
-
"Pn!2\"!2#!/$?%"
|
|
1573
|
-
];
|
|
1574
|
-
function convertFromCapnpObjectLiteral(serializedType) {
|
|
1575
|
-
return {
|
|
1576
|
-
kind: ReflectionKind.objectLiteral,
|
|
1577
|
-
typeName: serializedType.typeName || void 0,
|
|
1578
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1579
|
-
"d",
|
|
1580
|
-
"",
|
|
1581
|
-
"P\"2!\"/\""
|
|
1582
|
-
])) : void 0,
|
|
1583
|
-
types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
|
|
1584
|
-
"t",
|
|
1585
|
-
"",
|
|
1586
|
-
"P\"2!\"/\""
|
|
1587
|
-
])) : [],
|
|
1588
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1589
|
-
"t",
|
|
1590
|
-
"",
|
|
1591
|
-
"P\"2!\"/\""
|
|
1592
|
-
])) : void 0,
|
|
1593
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
1594
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
1595
|
-
};
|
|
1596
|
-
}
|
|
1597
|
-
convertFromCapnpObjectLiteral.__type = [
|
|
1598
|
-
"serializedType",
|
|
1599
|
-
() => __ΩSerializedTypeObjectLiteral,
|
|
1600
|
-
"convertFromCapnpObjectLiteral",
|
|
1601
|
-
"P!2!n\"/#"
|
|
1602
|
-
];
|
|
1603
|
-
/**
|
|
1604
|
-
* Converts a Deepkit serialized type to a Cap'n Proto serialized type.
|
|
1605
|
-
*
|
|
1606
|
-
* @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
|
|
1607
|
-
* @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
|
|
1608
|
-
*/
|
|
1609
|
-
function convertToCapnpParameter(serializedType, result) {
|
|
1610
|
-
result.kind = serializedType.kind;
|
|
1611
|
-
result.typeName = serializedType.typeName || "";
|
|
1612
|
-
result.name = serializedType.name || "";
|
|
1613
|
-
result.optional = serializedType.optional ?? false;
|
|
1614
|
-
result.readonly = serializedType.readonly ?? false;
|
|
1615
|
-
result.visibility = serializedType.visibility === ReflectionVisibility.public ? ReflectionVisibility$1.PUBLIC : serializedType.visibility === ReflectionVisibility.protected ? ReflectionVisibility$1.PROTECTED : ReflectionVisibility$1.PRIVATE;
|
|
1616
|
-
if (typeof serializedType.default !== "undefined") {
|
|
1617
|
-
const defaultValue = result._initDefault();
|
|
1618
|
-
convertToCapnpDefault(serializedType.default, defaultValue);
|
|
1619
|
-
}
|
|
1620
|
-
const parameterType = result._initType();
|
|
1621
|
-
parameterType.id = serializedType.type;
|
|
1622
|
-
if (serializedType.decorators?.length) {
|
|
1623
|
-
const decorators = result._initDecorators(serializedType.decorators.length);
|
|
1624
|
-
serializedType.decorators.forEach(__assignType((d, index) => {
|
|
1625
|
-
const decorator = decorators.get(index);
|
|
1626
|
-
decorator.id = d;
|
|
1627
|
-
}, [
|
|
1628
|
-
"d",
|
|
1629
|
-
"index",
|
|
1630
|
-
"",
|
|
1631
|
-
"P\"2!\"2\"\"/#"
|
|
1632
|
-
]));
|
|
1633
|
-
}
|
|
1634
|
-
if (serializedType.typeArguments?.length) {
|
|
1635
|
-
const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
|
|
1636
|
-
serializedType.typeArguments.forEach(__assignType((t, index) => {
|
|
1637
|
-
const typeArgument = typeArguments.get(index);
|
|
1638
|
-
typeArgument.id = t;
|
|
1639
|
-
}, [
|
|
1640
|
-
"t",
|
|
1641
|
-
"index",
|
|
1642
|
-
"",
|
|
1643
|
-
"P\"2!\"2\"\"/#"
|
|
1644
|
-
]));
|
|
1645
|
-
}
|
|
1646
|
-
if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
|
|
1647
|
-
if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
|
|
1648
|
-
return result;
|
|
1649
|
-
}
|
|
1650
|
-
convertToCapnpParameter.__type = [
|
|
1651
|
-
() => __ΩSerializedTypeParameter,
|
|
1652
|
-
"serializedType",
|
|
1653
|
-
"result",
|
|
1654
|
-
"convertToCapnpParameter",
|
|
1655
|
-
"Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
|
|
1656
|
-
"Pn!2\"!2#!/$?%"
|
|
1657
|
-
];
|
|
1658
|
-
function convertFromCapnpParameter(serializedType) {
|
|
1659
|
-
return {
|
|
1660
|
-
kind: ReflectionKind.parameter,
|
|
1661
|
-
typeName: serializedType.typeName || void 0,
|
|
1662
|
-
name: serializedType.name,
|
|
1663
|
-
default: convertFromCapnpDefault(serializedType.default),
|
|
1664
|
-
optional: serializedType.optional ? true : void 0,
|
|
1665
|
-
readonly: serializedType.readonly ? true : void 0,
|
|
1666
|
-
visibility: serializedType.visibility === ReflectionVisibility$1.PUBLIC ? ReflectionVisibility.public : serializedType.visibility === ReflectionVisibility$1.PROTECTED ? ReflectionVisibility.protected : ReflectionVisibility.private,
|
|
1667
|
-
type: serializedType.type.id,
|
|
1668
|
-
decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
|
|
1669
|
-
"d",
|
|
1670
|
-
"",
|
|
1671
|
-
"P\"2!\"/\""
|
|
1672
|
-
])) : void 0,
|
|
1673
|
-
typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
|
|
1674
|
-
"t",
|
|
1675
|
-
"",
|
|
1676
|
-
"P\"2!\"/\""
|
|
1677
|
-
])) : void 0,
|
|
1678
|
-
indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
|
|
1679
|
-
tags: convertFromCapnpTagsReflection(serializedType)
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
convertFromCapnpParameter.__type = [
|
|
1683
|
-
"serializedType",
|
|
1684
|
-
() => __ΩSerializedTypeParameter,
|
|
1685
|
-
"convertFromCapnpParameter",
|
|
1686
|
-
"P!2!n\"/#"
|
|
1687
|
-
];
|
|
1688
|
-
|
|
1689
|
-
//#endregion
|
|
1690
|
-
export { convertFromCapnp, convertToCapnp };
|