@carbonenginejs/runtime-resource 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FORMAT-PROVENANCE.md +135 -0
- package/LICENSE +21 -0
- package/NOTICE +29 -0
- package/README.md +241 -0
- package/dist/CjsMotherLode.js +56 -0
- package/dist/CjsMotherLode.js.map +1 -0
- package/dist/CjsResMan.js +740 -0
- package/dist/CjsResMan.js.map +1 -0
- package/dist/CjsResManQueue.js +214 -0
- package/dist/CjsResManQueue.js.map +1 -0
- package/dist/CjsResource.js +366 -0
- package/dist/CjsResource.js.map +1 -0
- package/dist/CjsResourceSource.js +59 -0
- package/dist/CjsResourceSource.js.map +1 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.js +153 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/format/CjsFormat.js +178 -0
- package/dist/format/CjsFormat.js.map +1 -0
- package/dist/format/CjsResourceProbe.js +269 -0
- package/dist/format/CjsResourceProbe.js.map +1 -0
- package/dist/format/payloadContract.js +173 -0
- package/dist/format/payloadContract.js.map +1 -0
- package/dist/formats/black/CjsBlackFormat.js +272 -0
- package/dist/formats/black/CjsBlackFormat.js.map +1 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js +153 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +382 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -0
- package/dist/formats/black/core/CjsBlackReader.js +760 -0
- package/dist/formats/black/core/CjsBlackReader.js.map +1 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +433 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -0
- package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js +4 -0
- package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js.map +1 -0
- package/dist/formats/black/core/blackConstants.js +7 -0
- package/dist/formats/black/core/blackConstants.js.map +1 -0
- package/dist/formats/black/core/blackDefinitions.js +10 -0
- package/dist/formats/black/core/blackDefinitions.js.map +1 -0
- package/dist/formats/black/core/blackEnums.js +6 -0
- package/dist/formats/black/core/blackEnums.js.map +1 -0
- package/dist/formats/black/core/blackSchema.js +3 -0
- package/dist/formats/black/core/blackSchema.js.map +1 -0
- package/dist/formats/black/core/blackVersion.js +22 -0
- package/dist/formats/black/core/blackVersion.js.map +1 -0
- package/dist/formats/black/core/helpers.js +182 -0
- package/dist/formats/black/core/helpers.js.map +1 -0
- package/dist/formats/black/core/schema.js +4 -0
- package/dist/formats/black/core/schema.js.map +1 -0
- package/dist/formats/black/index.js +2 -0
- package/dist/formats/black/index.js.map +1 -0
- package/dist/formats/bnk/CjsBnkFormat.js +245 -0
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -0
- package/dist/formats/bnk/core/helpers.js +354 -0
- package/dist/formats/bnk/core/helpers.js.map +1 -0
- package/dist/formats/bnk/core/soundbanksInfo.js +246 -0
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -0
- package/dist/formats/bnk/index.js +3 -0
- package/dist/formats/bnk/index.js.map +1 -0
- package/dist/formats/cmf/CjsCmfFormat.js +491 -0
- package/dist/formats/cmf/CjsCmfFormat.js.map +1 -0
- package/dist/formats/cmf/core/binary.js +118 -0
- package/dist/formats/cmf/core/binary.js.map +1 -0
- package/dist/formats/cmf/core/buffers.js +233 -0
- package/dist/formats/cmf/core/buffers.js.map +1 -0
- package/dist/formats/cmf/core/constants.js +47 -0
- package/dist/formats/cmf/core/constants.js.map +1 -0
- package/dist/formats/cmf/core/gr2Anim.js +453 -0
- package/dist/formats/cmf/core/gr2Anim.js.map +1 -0
- package/dist/formats/cmf/core/helpers.js +287 -0
- package/dist/formats/cmf/core/helpers.js.map +1 -0
- package/dist/formats/cmf/core/pack.js +276 -0
- package/dist/formats/cmf/core/pack.js.map +1 -0
- package/dist/formats/cmf/core/schema.js +364 -0
- package/dist/formats/cmf/core/schema.js.map +1 -0
- package/dist/formats/cmf/core/shared.js +268 -0
- package/dist/formats/cmf/core/shared.js.map +1 -0
- package/dist/formats/cmf/core/writer.js +517 -0
- package/dist/formats/cmf/core/writer.js.map +1 -0
- package/dist/formats/cmf/index.js +2 -0
- package/dist/formats/cmf/index.js.map +1 -0
- package/dist/formats/dds/CjsDdsFormat.js +187 -0
- package/dist/formats/dds/CjsDdsFormat.js.map +1 -0
- package/dist/formats/dds/core/helpers.js +812 -0
- package/dist/formats/dds/core/helpers.js.map +1 -0
- package/dist/formats/dds/index.js +2 -0
- package/dist/formats/dds/index.js.map +1 -0
- package/dist/formats/fbx/CjsFbxFormat.js +260 -0
- package/dist/formats/fbx/CjsFbxFormat.js.map +1 -0
- package/dist/formats/fbx/core/helpers.js +3901 -0
- package/dist/formats/fbx/core/helpers.js.map +1 -0
- package/dist/formats/fbx/index.js +2 -0
- package/dist/formats/fbx/index.js.map +1 -0
- package/dist/formats/flac/CjsFlacFormat.js +81 -0
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -0
- package/dist/formats/flac/core/helpers.js +295 -0
- package/dist/formats/flac/core/helpers.js.map +1 -0
- package/dist/formats/flac/index.js +2 -0
- package/dist/formats/flac/index.js.map +1 -0
- package/dist/formats/gif/CjsGifFormat.js +81 -0
- package/dist/formats/gif/CjsGifFormat.js.map +1 -0
- package/dist/formats/gif/core/helpers.js +360 -0
- package/dist/formats/gif/core/helpers.js.map +1 -0
- package/dist/formats/gif/index.js +2 -0
- package/dist/formats/gif/index.js.map +1 -0
- package/dist/formats/gltf/CjsGltfFormat.js +284 -0
- package/dist/formats/gltf/CjsGltfFormat.js.map +1 -0
- package/dist/formats/gltf/core/helpers.js +292 -0
- package/dist/formats/gltf/core/helpers.js.map +1 -0
- package/dist/formats/gltf/core/json.js +79 -0
- package/dist/formats/gltf/core/json.js.map +1 -0
- package/dist/formats/gltf/core/parser.js +666 -0
- package/dist/formats/gltf/core/parser.js.map +1 -0
- package/dist/formats/gltf/core/targets.js +163 -0
- package/dist/formats/gltf/core/targets.js.map +1 -0
- package/dist/formats/gltf/index.js +2 -0
- package/dist/formats/gltf/index.js.map +1 -0
- package/dist/formats/index.js +23 -0
- package/dist/formats/index.js.map +1 -0
- package/dist/formats/jpeg/CjsJpegFormat.js +200 -0
- package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -0
- package/dist/formats/jpeg/core/helpers.js +350 -0
- package/dist/formats/jpeg/core/helpers.js.map +1 -0
- package/dist/formats/jpeg/core/jpeg.js +377 -0
- package/dist/formats/jpeg/core/jpeg.js.map +1 -0
- package/dist/formats/jpeg/index.js +2 -0
- package/dist/formats/jpeg/index.js.map +1 -0
- package/dist/formats/mp3/CjsMp3Format.js +186 -0
- package/dist/formats/mp3/CjsMp3Format.js.map +1 -0
- package/dist/formats/mp3/core/helpers.js +338 -0
- package/dist/formats/mp3/core/helpers.js.map +1 -0
- package/dist/formats/mp3/index.js +2 -0
- package/dist/formats/mp3/index.js.map +1 -0
- package/dist/formats/mp4/CjsMp4Format.js +185 -0
- package/dist/formats/mp4/CjsMp4Format.js.map +1 -0
- package/dist/formats/mp4/core/helpers.js +449 -0
- package/dist/formats/mp4/core/helpers.js.map +1 -0
- package/dist/formats/mp4/index.js +2 -0
- package/dist/formats/mp4/index.js.map +1 -0
- package/dist/formats/obj/CjsObjFormat.js +247 -0
- package/dist/formats/obj/CjsObjFormat.js.map +1 -0
- package/dist/formats/obj/core/helpers.js +573 -0
- package/dist/formats/obj/core/helpers.js.map +1 -0
- package/dist/formats/obj/core/json.js +64 -0
- package/dist/formats/obj/core/json.js.map +1 -0
- package/dist/formats/obj/core/parser.js +321 -0
- package/dist/formats/obj/core/parser.js.map +1 -0
- package/dist/formats/obj/index.js +2 -0
- package/dist/formats/obj/index.js.map +1 -0
- package/dist/formats/ogg/CjsOggFormat.js +82 -0
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -0
- package/dist/formats/ogg/core/helpers.js +387 -0
- package/dist/formats/ogg/core/helpers.js.map +1 -0
- package/dist/formats/ogg/core/imdct.js +178 -0
- package/dist/formats/ogg/core/imdct.js.map +1 -0
- package/dist/formats/ogg/core/vorbis.js +999 -0
- package/dist/formats/ogg/core/vorbis.js.map +1 -0
- package/dist/formats/ogg/index.js +2 -0
- package/dist/formats/ogg/index.js.map +1 -0
- package/dist/formats/png/CjsPngFormat.js +189 -0
- package/dist/formats/png/CjsPngFormat.js.map +1 -0
- package/dist/formats/png/core/helpers.js +583 -0
- package/dist/formats/png/core/helpers.js.map +1 -0
- package/dist/formats/png/index.js +2 -0
- package/dist/formats/png/index.js.map +1 -0
- package/dist/formats/red/CjsRedFormat.js +247 -0
- package/dist/formats/red/CjsRedFormat.js.map +1 -0
- package/dist/formats/red/core/CjsRedReader.js +201 -0
- package/dist/formats/red/core/CjsRedReader.js.map +1 -0
- package/dist/formats/red/core/blackDefinitions.js +3 -0
- package/dist/formats/red/core/blackDefinitions.js.map +1 -0
- package/dist/formats/red/core/helpers.js +136 -0
- package/dist/formats/red/core/helpers.js.map +1 -0
- package/dist/formats/red/core/redGraph.js +68 -0
- package/dist/formats/red/core/redGraph.js.map +1 -0
- package/dist/formats/red/core/schema.js +4 -0
- package/dist/formats/red/core/schema.js.map +1 -0
- package/dist/formats/red/index.js +2 -0
- package/dist/formats/red/index.js.map +1 -0
- package/dist/formats/stl/CjsStlFormat.js +304 -0
- package/dist/formats/stl/CjsStlFormat.js.map +1 -0
- package/dist/formats/stl/core/helpers.js +257 -0
- package/dist/formats/stl/core/helpers.js.map +1 -0
- package/dist/formats/stl/core/json.js +51 -0
- package/dist/formats/stl/core/json.js.map +1 -0
- package/dist/formats/stl/core/stl.js +544 -0
- package/dist/formats/stl/core/stl.js.map +1 -0
- package/dist/formats/stl/core/targets.js +163 -0
- package/dist/formats/stl/core/targets.js.map +1 -0
- package/dist/formats/stl/index.js +2 -0
- package/dist/formats/stl/index.js.map +1 -0
- package/dist/formats/tga/CjsTgaFormat.js +186 -0
- package/dist/formats/tga/CjsTgaFormat.js.map +1 -0
- package/dist/formats/tga/core/helpers.js +446 -0
- package/dist/formats/tga/core/helpers.js.map +1 -0
- package/dist/formats/tga/index.js +2 -0
- package/dist/formats/tga/index.js.map +1 -0
- package/dist/formats/wav/CjsWavFormat.js +186 -0
- package/dist/formats/wav/CjsWavFormat.js.map +1 -0
- package/dist/formats/wav/core/helpers.js +328 -0
- package/dist/formats/wav/core/helpers.js.map +1 -0
- package/dist/formats/wav/index.js +2 -0
- package/dist/formats/wav/index.js.map +1 -0
- package/dist/formats/webm/CjsWebmFormat.js +185 -0
- package/dist/formats/webm/CjsWebmFormat.js.map +1 -0
- package/dist/formats/webm/core/helpers.js +537 -0
- package/dist/formats/webm/core/helpers.js.map +1 -0
- package/dist/formats/webm/index.js +2 -0
- package/dist/formats/webm/index.js.map +1 -0
- package/dist/formats/webp/CjsWebpFormat.js +80 -0
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -0
- package/dist/formats/webp/core/helpers.js +214 -0
- package/dist/formats/webp/core/helpers.js.map +1 -0
- package/dist/formats/webp/index.js +2 -0
- package/dist/formats/webp/index.js.map +1 -0
- package/dist/formats/wem/CjsWemFormat.js +197 -0
- package/dist/formats/wem/CjsWemFormat.js.map +1 -0
- package/dist/formats/wem/core/bitStream.js +259 -0
- package/dist/formats/wem/core/bitStream.js.map +1 -0
- package/dist/formats/wem/core/codebookLibrary.js +164 -0
- package/dist/formats/wem/core/codebookLibrary.js.map +1 -0
- package/dist/formats/wem/core/helpers.js +336 -0
- package/dist/formats/wem/core/helpers.js.map +1 -0
- package/dist/formats/wem/core/packedCodebooksAotuv603.js +30 -0
- package/dist/formats/wem/core/packedCodebooksAotuv603.js.map +1 -0
- package/dist/formats/wem/core/wemToOgg.js +485 -0
- package/dist/formats/wem/core/wemToOgg.js.map +1 -0
- package/dist/formats/wem/index.js +2 -0
- package/dist/formats/wem/index.js.map +1 -0
- package/dist/formats/yaml/CjsYamlFormat.js +77 -0
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -0
- package/dist/formats/yaml/core/CjsYamlReader.js +304 -0
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -0
- package/dist/formats/yaml/core/helpers.js +160 -0
- package/dist/formats/yaml/core/helpers.js.map +1 -0
- package/dist/formats/yaml/index.js +2 -0
- package/dist/formats/yaml/index.js.map +1 -0
- package/dist/generated/resources/AudioGeometryResData.js +47 -0
- package/dist/generated/resources/AudioGeometryResData.js.map +1 -0
- package/dist/generated/resources/CmfVertexReader.js +46 -0
- package/dist/generated/resources/CmfVertexReader.js.map +1 -0
- package/dist/generated/resources/GStateBindingCallbackData.js +31 -0
- package/dist/generated/resources/GStateBindingCallbackData.js.map +1 -0
- package/dist/generated/resources/MeshDecalData.js +37 -0
- package/dist/generated/resources/MeshDecalData.js.map +1 -0
- package/dist/generated/resources/MeshDecalLodData.js +34 -0
- package/dist/generated/resources/MeshDecalLodData.js.map +1 -0
- package/dist/generated/resources/Tr2AsyncSave.js +46 -0
- package/dist/generated/resources/Tr2AsyncSave.js.map +1 -0
- package/dist/generated/resources/Tr2CmfContents.js +37 -0
- package/dist/generated/resources/Tr2CmfContents.js.map +1 -0
- package/dist/generated/resources/Tr2GrannyIntersectionResult.js +58 -0
- package/dist/generated/resources/Tr2GrannyIntersectionResult.js.map +1 -0
- package/dist/generated/resources/Tr2LoadPrepareFence.js +37 -0
- package/dist/generated/resources/Tr2LoadPrepareFence.js.map +1 -0
- package/dist/generated/resources/Tr2MaterialArea.js +34 -0
- package/dist/generated/resources/Tr2MaterialArea.js.map +1 -0
- package/dist/generated/resources/Tr2MaterialMesh.js +31 -0
- package/dist/generated/resources/Tr2MaterialMesh.js.map +1 -0
- package/dist/generated/resources/Tr2MaterialRes.js +34 -0
- package/dist/generated/resources/Tr2MaterialRes.js.map +1 -0
- package/dist/generated/resources/Tr2ShaderPermutation.js +43 -0
- package/dist/generated/resources/Tr2ShaderPermutation.js.map +1 -0
- package/dist/generated/resources/Tr2TextureLodManager.js +60 -0
- package/dist/generated/resources/Tr2TextureLodManager.js.map +1 -0
- package/dist/generated/resources/Tr2TextureLodUpdateRequest.js +37 -0
- package/dist/generated/resources/Tr2TextureLodUpdateRequest.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePackChannel.js +37 -0
- package/dist/generated/resources/Tr2TexturePackChannel.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipeline.js +44 -0
- package/dist/generated/resources/Tr2TexturePipeline.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipelineParams.js +34 -0
- package/dist/generated/resources/Tr2TexturePipelineParams.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipelineStepCompress.js +40 -0
- package/dist/generated/resources/Tr2TexturePipelineStepCompress.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipelineStepLimitSize.js +34 -0
- package/dist/generated/resources/Tr2TexturePipelineStepLimitSize.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipelineStepLoad.js +31 -0
- package/dist/generated/resources/Tr2TexturePipelineStepLoad.js.map +1 -0
- package/dist/generated/resources/Tr2TexturePipelineStepPack.js +43 -0
- package/dist/generated/resources/Tr2TexturePipelineStepPack.js.map +1 -0
- package/dist/generated/resources/TriGeometryResAreaData.js +59 -0
- package/dist/generated/resources/TriGeometryResAreaData.js.map +1 -0
- package/dist/generated/resources/TriGeometryResJointData.js +38 -0
- package/dist/generated/resources/TriGeometryResJointData.js.map +1 -0
- package/dist/generated/resources/TriGeometryResLodData.js +88 -0
- package/dist/generated/resources/TriGeometryResLodData.js.map +1 -0
- package/dist/generated/resources/TriGeometryResMeshData.js +63 -0
- package/dist/generated/resources/TriGeometryResMeshData.js.map +1 -0
- package/dist/generated/resources/TriGeometryResSkeletonData.js +34 -0
- package/dist/generated/resources/TriGeometryResSkeletonData.js.map +1 -0
- package/dist/generated/resources/TriJointBinding.js +38 -0
- package/dist/generated/resources/TriJointBinding.js.map +1 -0
- package/dist/generated/resources/TriMorphTargetGeometryConstants.js +46 -0
- package/dist/generated/resources/TriMorphTargetGeometryConstants.js.map +1 -0
- package/dist/generated/resources/TriRtGeometryConstants.js +88 -0
- package/dist/generated/resources/TriRtGeometryConstants.js.map +1 -0
- package/dist/generated/resources/enums.js +18 -0
- package/dist/generated/resources/enums.js.map +1 -0
- package/dist/generated/resources/index.js +32 -0
- package/dist/generated/resources/index.js.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/resourcePath.js +18 -0
- package/dist/resourcePath.js.map +1 -0
- package/dist/resourceStates.js +9 -0
- package/dist/resourceStates.js.map +1 -0
- package/dist/resources/Tr2EffectRes.js +71 -0
- package/dist/resources/Tr2EffectRes.js.map +1 -0
- package/dist/resources/Tr2GrannyStateRes.js +44 -0
- package/dist/resources/Tr2GrannyStateRes.js.map +1 -0
- package/dist/resources/Tr2ImageRes.js +114 -0
- package/dist/resources/Tr2ImageRes.js.map +1 -0
- package/dist/resources/Tr2LightProfileRes.js +40 -0
- package/dist/resources/Tr2LightProfileRes.js.map +1 -0
- package/dist/resources/TriGeometryRes.js +216 -0
- package/dist/resources/TriGeometryRes.js.map +1 -0
- package/dist/resources/TriGrannyRes.js +43 -0
- package/dist/resources/TriGrannyRes.js.map +1 -0
- package/dist/resources/TriTextureRes.js +304 -0
- package/dist/resources/TriTextureRes.js.map +1 -0
- package/dist/resources/resourceBoundary.js +47 -0
- package/dist/resources/resourceBoundary.js.map +1 -0
- package/dist/texture/CjsTextureArrayRes.js +406 -0
- package/dist/texture/CjsTextureArrayRes.js.map +1 -0
- package/dist/texture/CjsTextureParameterProxy.js +133 -0
- package/dist/texture/CjsTextureParameterProxy.js.map +1 -0
- package/format-notices/black/LICENSE +21 -0
- package/format-notices/black/NOTICE +47 -0
- package/format-notices/bnk/LICENSE +21 -0
- package/format-notices/bnk/NOTICE +17 -0
- package/format-notices/cmf/LICENSE +21 -0
- package/format-notices/cmf/NOTICE +36 -0
- package/format-notices/dds/LICENSE +21 -0
- package/format-notices/dds/NOTICE +14 -0
- package/format-notices/fbx/LICENSE +21 -0
- package/format-notices/fbx/NOTICE +14 -0
- package/format-notices/flac/LICENSE +21 -0
- package/format-notices/flac/NOTICE +14 -0
- package/format-notices/gif/LICENSE +21 -0
- package/format-notices/gif/NOTICE +14 -0
- package/format-notices/gltf/LICENSE +21 -0
- package/format-notices/gltf/NOTICE +27 -0
- package/format-notices/jpeg/LICENSE +21 -0
- package/format-notices/jpeg/NOTICE +14 -0
- package/format-notices/mp3/LICENSE +21 -0
- package/format-notices/mp3/NOTICE +14 -0
- package/format-notices/mp4/LICENSE +21 -0
- package/format-notices/mp4/NOTICE +14 -0
- package/format-notices/obj/LICENSE +21 -0
- package/format-notices/obj/NOTICE +26 -0
- package/format-notices/ogg/LICENSE +21 -0
- package/format-notices/ogg/NOTICE +28 -0
- package/format-notices/png/LICENSE +21 -0
- package/format-notices/png/NOTICE +14 -0
- package/format-notices/red/LICENSE +21 -0
- package/format-notices/red/NOTICE +31 -0
- package/format-notices/stl/LICENSE +21 -0
- package/format-notices/stl/NOTICE +21 -0
- package/format-notices/tga/LICENSE +21 -0
- package/format-notices/tga/NOTICE +14 -0
- package/format-notices/wav/LICENSE +21 -0
- package/format-notices/wav/NOTICE +14 -0
- package/format-notices/webm/LICENSE +21 -0
- package/format-notices/webm/NOTICE +14 -0
- package/format-notices/webp/LICENSE +21 -0
- package/format-notices/webp/NOTICE +14 -0
- package/format-notices/wem/LICENSE +57 -0
- package/format-notices/wem/NOTICE +33 -0
- package/format-notices/yaml/LICENSE +21 -0
- package/format-notices/yaml/NOTICE +44 -0
- package/package.json +51 -0
- package/resource-lifecycle.md +487 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { CjsResourceProbe as _CjsResourceProbe } from './CjsResourceProbe.js';
|
|
2
|
+
|
|
3
|
+
class CjsFormat {
|
|
4
|
+
options = {};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Convenience factory for simple format helpers.
|
|
8
|
+
* Keep this lightweight so format classes can stay pure-reader implementations.
|
|
9
|
+
*
|
|
10
|
+
* @param {*} input
|
|
11
|
+
* @param {object} options
|
|
12
|
+
* @returns {Promise<*>|*}
|
|
13
|
+
*/
|
|
14
|
+
static read(input, options = null) {
|
|
15
|
+
const reader = new this(options || {});
|
|
16
|
+
return reader.Read(input, options || {});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Async convenience factory for format readers.
|
|
21
|
+
*
|
|
22
|
+
* @param {*} input
|
|
23
|
+
* @param {object} options
|
|
24
|
+
* @returns {Promise<*>}
|
|
25
|
+
*/
|
|
26
|
+
static async readAsync(input, options = null) {
|
|
27
|
+
const reader = new this(options || {});
|
|
28
|
+
return reader.ReadAsync(input, options || {});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Canonical support probe entrypoint.
|
|
33
|
+
* Returns a probe report including compressed/raw capability variants when implemented.
|
|
34
|
+
*
|
|
35
|
+
* @param {*} input
|
|
36
|
+
* @param {object} options
|
|
37
|
+
* @returns {CjsResourceProbe}
|
|
38
|
+
*/
|
|
39
|
+
static isSupported(input, options = null) {
|
|
40
|
+
const source = typeof input === "string" ? "path" : "buffer";
|
|
41
|
+
const formatName = this.name ? this.name.replace(/^Cjs/u, "").replace(/Format$/u, "").toLowerCase() : "format";
|
|
42
|
+
return _CjsResourceProbe.createUnsupported(formatName, "No probe implementation.", {
|
|
43
|
+
source,
|
|
44
|
+
...options
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Alias for canonical naming.
|
|
50
|
+
*
|
|
51
|
+
* @param {*} input
|
|
52
|
+
* @param {object} options
|
|
53
|
+
* @returns {CjsResourceProbe}
|
|
54
|
+
*/
|
|
55
|
+
static inspect(input, options = null) {
|
|
56
|
+
return this.isSupported(input, options);
|
|
57
|
+
}
|
|
58
|
+
constructor(options = null) {
|
|
59
|
+
this.options = {
|
|
60
|
+
...(options || {})
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
SetValues(values = null) {
|
|
64
|
+
if (!values || typeof values !== "object") {
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
if (Object.prototype.hasOwnProperty.call(values, "options")) {
|
|
68
|
+
this.options = {
|
|
69
|
+
...(values.options || {})
|
|
70
|
+
};
|
|
71
|
+
} else {
|
|
72
|
+
this.options = {
|
|
73
|
+
...this.options,
|
|
74
|
+
...values
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
GetValues() {
|
|
80
|
+
return {
|
|
81
|
+
options: {
|
|
82
|
+
...this.options
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
Initialize(values = null) {
|
|
87
|
+
return this.SetValues(values || {});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Primary instance read entrypoint for synchronous readers.
|
|
92
|
+
* Implementations may override with async handling in readAsync only if needed.
|
|
93
|
+
*/
|
|
94
|
+
Read(input, options = null) {
|
|
95
|
+
throw new Error(`${this.constructor.name}.Read must be implemented by a format package.`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Primary async read entrypoint for asynchronous readers.
|
|
100
|
+
* Defaults to sync Read for compatibility.
|
|
101
|
+
*/
|
|
102
|
+
async ReadAsync(input, options = null) {
|
|
103
|
+
return this.Read(input, options);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Canonical package-family group names.
|
|
108
|
+
*/
|
|
109
|
+
static Type = Object.freeze({
|
|
110
|
+
AUDIO: "audio",
|
|
111
|
+
DATA: "data",
|
|
112
|
+
GEOMETRY: "geometry",
|
|
113
|
+
IMAGE: "image",
|
|
114
|
+
SCHEMA: "schema",
|
|
115
|
+
SHADER: "shader",
|
|
116
|
+
TEXTURE: "texture",
|
|
117
|
+
VIDEO: "video"
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Canonical media-type groups used by format registration.
|
|
122
|
+
*/
|
|
123
|
+
static MediaType = Object.freeze({
|
|
124
|
+
AUDIO: "audio",
|
|
125
|
+
DATA: "data",
|
|
126
|
+
GEOMETRY: "geometry",
|
|
127
|
+
IMAGE: "image",
|
|
128
|
+
SHADER: "shader",
|
|
129
|
+
SCHEMA: "schema",
|
|
130
|
+
TEXTURE: "texture",
|
|
131
|
+
VIDEO: "video"
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Canonical output-type tokens used by format emit contracts.
|
|
136
|
+
*/
|
|
137
|
+
static OutputType = Object.freeze({
|
|
138
|
+
AUDIO: "audio",
|
|
139
|
+
CMF: "cmf",
|
|
140
|
+
GR2: "gr2",
|
|
141
|
+
IMAGE: "image",
|
|
142
|
+
JSON: "json",
|
|
143
|
+
PCM: "pcm",
|
|
144
|
+
RAW: "raw",
|
|
145
|
+
RGBA: "rgba",
|
|
146
|
+
SCHEMA: "schema",
|
|
147
|
+
SHADER: "shader",
|
|
148
|
+
SHARED: "shared",
|
|
149
|
+
TEXTURE: "texture",
|
|
150
|
+
VIDEO: "video",
|
|
151
|
+
OBJ_JSON: "objJson"
|
|
152
|
+
});
|
|
153
|
+
static type = Object.freeze([]);
|
|
154
|
+
static mediaTypes = Object.freeze([]);
|
|
155
|
+
static inputTypes = Object.freeze([]);
|
|
156
|
+
static outputTypes = Object.freeze([]);
|
|
157
|
+
static debugOutputTypes = Object.freeze(["json", "raw"]);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Shared utility for asserting required format metadata exists.
|
|
162
|
+
*/
|
|
163
|
+
function ValidateFormatContract(Constructor) {
|
|
164
|
+
if (!Constructor) {
|
|
165
|
+
throw new TypeError("ValidateFormatContract requires a format class.");
|
|
166
|
+
}
|
|
167
|
+
const hasOutput = Array.isArray(Constructor.outputTypes) && Constructor.outputTypes.length > 0;
|
|
168
|
+
const hasInput = Array.isArray(Constructor.inputTypes) && Constructor.inputTypes.length > 0;
|
|
169
|
+
const hasMedia = Array.isArray(Constructor.mediaTypes) && Constructor.mediaTypes.length > 0;
|
|
170
|
+
const hasType = Array.isArray(Constructor.type) && Constructor.type.length > 0;
|
|
171
|
+
const hasDebug = Array.isArray(Constructor.debugOutputTypes) && Constructor.debugOutputTypes.length > 0;
|
|
172
|
+
if (!hasType || !hasMedia || !hasInput || !hasOutput || !hasDebug) {
|
|
173
|
+
throw new TypeError(`Format contract missing metadata: type:${hasType} mediaTypes:${hasMedia} inputTypes:${hasInput} outputTypes:${hasOutput} debugOutputTypes:${hasDebug}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { CjsFormat, ValidateFormatContract };
|
|
178
|
+
//# sourceMappingURL=CjsFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CjsFormat.js","sources":["../../../src/format/CjsFormat.js"],"sourcesContent":["import { CjsResourceProbe } from \"./CjsResourceProbe.js\";\n\nexport class CjsFormat\n{\n options = {};\n\n /**\n * Convenience factory for simple format helpers.\n * Keep this lightweight so format classes can stay pure-reader implementations.\n *\n * @param {*} input\n * @param {object} options\n * @returns {Promise<*>|*}\n */\n static read(input, options = null) {\n const reader = new this(options || {});\n return reader.Read(input, options || {});\n }\n\n /**\n * Async convenience factory for format readers.\n *\n * @param {*} input\n * @param {object} options\n * @returns {Promise<*>}\n */\n static async readAsync(input, options = null) {\n const reader = new this(options || {});\n return reader.ReadAsync(input, options || {});\n }\n\n /**\n * Canonical support probe entrypoint.\n * Returns a probe report including compressed/raw capability variants when implemented.\n *\n * @param {*} input\n * @param {object} options\n * @returns {CjsResourceProbe}\n */\n static isSupported(input, options = null) {\n const source = typeof input === \"string\" ? \"path\" : \"buffer\";\n const formatName = this.name\n ? this.name.replace(/^Cjs/u, \"\").replace(/Format$/u, \"\").toLowerCase()\n : \"format\";\n return CjsResourceProbe.createUnsupported(formatName, \"No probe implementation.\", { source, ...options });\n }\n\n /**\n * Alias for canonical naming.\n *\n * @param {*} input\n * @param {object} options\n * @returns {CjsResourceProbe}\n */\n static inspect(input, options = null) {\n return this.isSupported(input, options);\n }\n\n constructor(options = null) {\n this.options = { ...(options || {}) };\n }\n\n SetValues(values = null) {\n if (!values || typeof values !== \"object\") {\n return this;\n }\n if (Object.prototype.hasOwnProperty.call(values, \"options\")) {\n this.options = { ...(values.options || {}) };\n } else {\n this.options = { ...this.options, ...values };\n }\n return this;\n }\n\n GetValues() {\n return { options: { ...this.options } };\n }\n\n Initialize(values = null) {\n return this.SetValues(values || {});\n }\n\n /**\n * Primary instance read entrypoint for synchronous readers.\n * Implementations may override with async handling in readAsync only if needed.\n */\n Read(input, options = null) {\n throw new Error(`${this.constructor.name}.Read must be implemented by a format package.`);\n }\n\n /**\n * Primary async read entrypoint for asynchronous readers.\n * Defaults to sync Read for compatibility.\n */\n async ReadAsync(input, options = null) {\n return this.Read(input, options);\n }\n\n /**\n * Canonical package-family group names.\n */\n static Type = Object.freeze({\n AUDIO: \"audio\",\n DATA: \"data\",\n GEOMETRY: \"geometry\",\n IMAGE: \"image\",\n SCHEMA: \"schema\",\n SHADER: \"shader\",\n TEXTURE: \"texture\",\n VIDEO: \"video\"\n });\n\n /**\n * Canonical media-type groups used by format registration.\n */\n static MediaType = Object.freeze({\n AUDIO: \"audio\",\n DATA: \"data\",\n GEOMETRY: \"geometry\",\n IMAGE: \"image\",\n SHADER: \"shader\",\n SCHEMA: \"schema\",\n TEXTURE: \"texture\",\n VIDEO: \"video\"\n });\n\n /**\n * Canonical output-type tokens used by format emit contracts.\n */\n static OutputType = Object.freeze({\n AUDIO: \"audio\",\n CMF: \"cmf\",\n GR2: \"gr2\",\n IMAGE: \"image\",\n JSON: \"json\",\n PCM: \"pcm\",\n RAW: \"raw\",\n RGBA: \"rgba\",\n SCHEMA: \"schema\",\n SHADER: \"shader\",\n SHARED: \"shared\",\n TEXTURE: \"texture\",\n VIDEO: \"video\",\n OBJ_JSON: \"objJson\"\n });\n\n static type = Object.freeze([]);\n static mediaTypes = Object.freeze([]);\n static inputTypes = Object.freeze([]);\n static outputTypes = Object.freeze([]);\n static debugOutputTypes = Object.freeze([\"json\", \"raw\"]);\n}\n\n/**\n * Shared utility for asserting required format metadata exists.\n */\nexport function ValidateFormatContract(Constructor) {\n if (!Constructor) {\n throw new TypeError(\"ValidateFormatContract requires a format class.\");\n }\n const hasOutput = Array.isArray(Constructor.outputTypes) && Constructor.outputTypes.length > 0;\n const hasInput = Array.isArray(Constructor.inputTypes) && Constructor.inputTypes.length > 0;\n const hasMedia = Array.isArray(Constructor.mediaTypes) && Constructor.mediaTypes.length > 0;\n const hasType = Array.isArray(Constructor.type) && Constructor.type.length > 0;\n const hasDebug = Array.isArray(Constructor.debugOutputTypes) && Constructor.debugOutputTypes.length > 0;\n if (!hasType || !hasMedia || !hasInput || !hasOutput || !hasDebug) {\n throw new TypeError(`Format contract missing metadata: type:${hasType} mediaTypes:${hasMedia} inputTypes:${hasInput} outputTypes:${hasOutput} debugOutputTypes:${hasDebug}`);\n }\n}\n"],"names":["CjsFormat","options","read","input","reader","Read","readAsync","ReadAsync","isSupported","source","formatName","name","replace","toLowerCase","CjsResourceProbe","createUnsupported","inspect","constructor","SetValues","values","Object","prototype","hasOwnProperty","call","GetValues","Initialize","Error","Type","freeze","AUDIO","DATA","GEOMETRY","IMAGE","SCHEMA","SHADER","TEXTURE","VIDEO","MediaType","OutputType","CMF","GR2","JSON","PCM","RAW","RGBA","SHARED","OBJ_JSON","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes","ValidateFormatContract","Constructor","TypeError","hasOutput","Array","isArray","length","hasInput","hasMedia","hasType","hasDebug"],"mappings":";;AAEO,MAAMA,SAAS,CACtB;EACEC,OAAO,GAAG,EAAE;;AAEZ;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACE,EAAA,OAAOC,IAAIA,CAACC,KAAK,EAAEF,OAAO,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jE,IAAA,MAAM,IAAIR,SAAS,CAAC,CAAA,uCAAA,EAA0CO,OAAO,CAAA,YAAA,EAAeD,QAAQ,CAAA,YAAA,EAAeD,QAAQ,CAAA,aAAA,EAAgBJ,SAAS,CAAA,kBAAA,EAAqBO,QAAQ,EAAE,CAAC;AAC9K,EAAA;AACF;;;;"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { applyDecs2311 as _applyDecs2311 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { CjsModel } from '@carbonenginejs/core-types/model';
|
|
3
|
+
import { io, type } from '@carbonenginejs/core-types/schema';
|
|
4
|
+
|
|
5
|
+
let _initClass, _init_format, _init_extra_format, _init_source, _init_extra_source, _init_supported, _init_extra_supported, _init_confidence, _init_extra_confidence, _init_preferred, _init_extra_preferred, _init_reason, _init_extra_reason, _init_metadata, _init_extra_metadata, _init_variant, _init_extra_variant, _init_variants, _init_extra_variants, _init_warnings, _init_extra_warnings, _init_errors, _init_extra_errors;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Standard probe report for resource formats and a reusable base for format-specific probes.
|
|
9
|
+
*
|
|
10
|
+
* Instances can be built by:
|
|
11
|
+
* - returning plain object JSON payloads from format packages, then converted with CjsResourceProbe.from(...)
|
|
12
|
+
* - returning CjsResourceProbe instances directly
|
|
13
|
+
*
|
|
14
|
+
* A format can report multiple usable variants in one payload, such as a
|
|
15
|
+
* native compressed texture and a decoded RGBA fallback, without deciding
|
|
16
|
+
* which engine-gpu or media backend should use.
|
|
17
|
+
*/
|
|
18
|
+
let _CjsResourceProbe;
|
|
19
|
+
class CjsResourceProbe extends CjsModel {
|
|
20
|
+
static {
|
|
21
|
+
({
|
|
22
|
+
e: [_init_format, _init_extra_format, _init_source, _init_extra_source, _init_supported, _init_extra_supported, _init_confidence, _init_extra_confidence, _init_preferred, _init_extra_preferred, _init_reason, _init_extra_reason, _init_metadata, _init_extra_metadata, _init_variant, _init_extra_variant, _init_variants, _init_extra_variants, _init_warnings, _init_extra_warnings, _init_errors, _init_extra_errors],
|
|
23
|
+
c: [_CjsResourceProbe, _initClass]
|
|
24
|
+
} = _applyDecs2311(this, [type.define({
|
|
25
|
+
className: "CjsResourceProbe",
|
|
26
|
+
family: "resource"
|
|
27
|
+
})], [[[io, io.persist, type, type.string], 16, "format"], [[io, io.persist, type, type.string], 16, "source"], [[io, io.persist, type, type.string], 16, "supported"], [[io, io.persist, type, type.float64], 16, "confidence"], [[io, io.persist, type, type.string], 16, "preferred"], [[io, io.persist, type, type.string], 16, "reason"], [[io, io.persist, type, type.unknown], 16, "metadata"], [[io, io.persist, type, type.unknown], 16, "variant"], [[io, io.persist, void 0, type.list("unknown")], 16, "variants"], [[io, io.persist, void 0, type.list("string")], 16, "warnings"], [[io, io.persist, void 0, type.list("string")], 16, "errors"]], 0, void 0, CjsModel));
|
|
28
|
+
}
|
|
29
|
+
format = _init_format(this, "");
|
|
30
|
+
source = (_init_extra_format(this), _init_source(this, ""));
|
|
31
|
+
supported = (_init_extra_source(this), _init_supported(this, "none"));
|
|
32
|
+
confidence = (_init_extra_supported(this), _init_confidence(this, 0));
|
|
33
|
+
preferred = (_init_extra_confidence(this), _init_preferred(this, ""));
|
|
34
|
+
reason = (_init_extra_preferred(this), _init_reason(this, ""));
|
|
35
|
+
metadata = (_init_extra_reason(this), _init_metadata(this, null));
|
|
36
|
+
variant = (_init_extra_metadata(this), _init_variant(this, {}));
|
|
37
|
+
variants = (_init_extra_variant(this), _init_variants(this, []));
|
|
38
|
+
warnings = (_init_extra_variants(this), _init_warnings(this, []));
|
|
39
|
+
errors = (_init_extra_warnings(this), _init_errors(this, []));
|
|
40
|
+
constructor(values = null) {
|
|
41
|
+
super(), _init_extra_errors(this);
|
|
42
|
+
this.SetValues(values || {}, {
|
|
43
|
+
markDirty: false,
|
|
44
|
+
skipUpdate: true,
|
|
45
|
+
skipEvents: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Initialize probe fields from a plain object payload.
|
|
51
|
+
*
|
|
52
|
+
* @param {object|null} values
|
|
53
|
+
* @returns {CjsResourceProbe}
|
|
54
|
+
*/
|
|
55
|
+
Initialize(values = null) {
|
|
56
|
+
this.SetValues(values || {}, {
|
|
57
|
+
skipEvents: true
|
|
58
|
+
});
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Lightweight probe entrypoint.
|
|
64
|
+
* Format packages should override this or provide their own probe implementation.
|
|
65
|
+
*
|
|
66
|
+
* @param {*} src
|
|
67
|
+
* Raw source path or source payload passed by caller.
|
|
68
|
+
* @param {object|null} options
|
|
69
|
+
* Optional metadata/control overrides.
|
|
70
|
+
* @returns {CjsResourceProbe}
|
|
71
|
+
*/
|
|
72
|
+
static isSupported(src, options = null) {
|
|
73
|
+
return new _CjsResourceProbe({
|
|
74
|
+
format: "",
|
|
75
|
+
source: typeof src === "string" ? src : "buffer",
|
|
76
|
+
supported: "none",
|
|
77
|
+
confidence: 0,
|
|
78
|
+
preferred: "",
|
|
79
|
+
reason: "No probe provided.",
|
|
80
|
+
metadata: null,
|
|
81
|
+
variant: {},
|
|
82
|
+
variants: [],
|
|
83
|
+
warnings: [],
|
|
84
|
+
errors: ["CjsResourceProbe has no built-in format detection."],
|
|
85
|
+
...options
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Detailed probe with report-style metadata. Aliases isSupported() in this minimal base.
|
|
91
|
+
*
|
|
92
|
+
* @param {*} src
|
|
93
|
+
* @param {object|null} options
|
|
94
|
+
* @returns {CjsResourceProbe}
|
|
95
|
+
*/
|
|
96
|
+
static inspect(src, options = null) {
|
|
97
|
+
return _CjsResourceProbe.isSupported(src, options);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Build a probe report representing explicit failure.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} format
|
|
104
|
+
* @param {string} reason
|
|
105
|
+
* @param {object|null} options
|
|
106
|
+
* @returns {CjsResourceProbe}
|
|
107
|
+
*/
|
|
108
|
+
static createUnsupported(format, reason, options = null) {
|
|
109
|
+
return new _CjsResourceProbe({
|
|
110
|
+
format,
|
|
111
|
+
supported: "none",
|
|
112
|
+
confidence: 0,
|
|
113
|
+
preferred: "",
|
|
114
|
+
reason: reason || "Unsupported format.",
|
|
115
|
+
variant: {},
|
|
116
|
+
variants: [],
|
|
117
|
+
warnings: [],
|
|
118
|
+
errors: [reason],
|
|
119
|
+
...(options || {})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Build a probe report representing one or more variants.
|
|
125
|
+
*
|
|
126
|
+
* @param {string} format
|
|
127
|
+
* @param {Array<Object>} variants
|
|
128
|
+
* @param {object|null} options
|
|
129
|
+
* @returns {CjsResourceProbe}
|
|
130
|
+
*/
|
|
131
|
+
static createSupported(format, variants, options = null) {
|
|
132
|
+
const normalizedVariants = Array.isArray(variants) ? variants : [];
|
|
133
|
+
const anySupported = normalizedVariants.some(entry => entry && entry.supported === true);
|
|
134
|
+
const normalized = normalizedVariants.map(entry => _CjsResourceProbe.normalizeVariant(entry));
|
|
135
|
+
const preferred = options && options.preferred ? options.preferred : _CjsResourceProbe.selectPreferred(normalized);
|
|
136
|
+
return new _CjsResourceProbe({
|
|
137
|
+
format,
|
|
138
|
+
source: options?.source || "",
|
|
139
|
+
supported: anySupported ? "full" : normalizedVariants.length > 0 ? "partial" : "none",
|
|
140
|
+
confidence: normalized.length > 0 && anySupported ? 1 : normalized.length > 0 ? 0.5 : 0,
|
|
141
|
+
preferred,
|
|
142
|
+
reason: options?.reason || (anySupported ? "Supported variant found." : "No variant supported."),
|
|
143
|
+
metadata: options?.metadata || null,
|
|
144
|
+
variant: normalized[0] || {},
|
|
145
|
+
variants: normalized,
|
|
146
|
+
warnings: Array.isArray(options?.warnings) ? options.warnings : [],
|
|
147
|
+
errors: Array.isArray(options?.errors) ? options.errors : [],
|
|
148
|
+
...(options || {})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Normalize incoming report payloads into a standard CjsResourceProbe instance.
|
|
154
|
+
*
|
|
155
|
+
* @param {CjsResourceProbe|object|null} input
|
|
156
|
+
* @returns {CjsResourceProbe}
|
|
157
|
+
*/
|
|
158
|
+
static from(input) {
|
|
159
|
+
if (input instanceof _CjsResourceProbe) return input;
|
|
160
|
+
if (!input) return _CjsResourceProbe.createUnsupported("", "No probe input.");
|
|
161
|
+
if (typeof input === "object" && typeof input.toJSON === "function") {
|
|
162
|
+
return new _CjsResourceProbe(_CjsResourceProbe.normalizeReport(input.toJSON()));
|
|
163
|
+
}
|
|
164
|
+
if (typeof input === "object") return new _CjsResourceProbe(_CjsResourceProbe.normalizeReport(input));
|
|
165
|
+
return _CjsResourceProbe.createUnsupported("", "Invalid probe payload.");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Normalize a plain probe report while preserving format-specific metadata.
|
|
170
|
+
*
|
|
171
|
+
* @param {object} input
|
|
172
|
+
* @returns {object}
|
|
173
|
+
*/
|
|
174
|
+
static normalizeReport(input) {
|
|
175
|
+
const variants = Array.isArray(input.variants) ? input.variants.map(entry => _CjsResourceProbe.normalizeVariant(entry)) : [];
|
|
176
|
+
return {
|
|
177
|
+
...input,
|
|
178
|
+
variant: input.variant ? _CjsResourceProbe.normalizeVariant(input.variant) : variants[0] || {},
|
|
179
|
+
variants
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Normalize variant objects so runtimes can evaluate capability uniformly.
|
|
185
|
+
*
|
|
186
|
+
* @param {object|any} input
|
|
187
|
+
* @returns {{kind: string, payloadType: string, codec: string, format: string, supported: boolean, reason: string, meta: *}}
|
|
188
|
+
*/
|
|
189
|
+
static normalizeVariant(input) {
|
|
190
|
+
if (!input || typeof input !== "object") {
|
|
191
|
+
return {
|
|
192
|
+
kind: "raw",
|
|
193
|
+
payloadType: "raw",
|
|
194
|
+
codec: "",
|
|
195
|
+
format: "",
|
|
196
|
+
supported: false,
|
|
197
|
+
reason: "Invalid variant payload.",
|
|
198
|
+
meta: null
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const kind = input.kind || input.payloadType || "raw";
|
|
202
|
+
return {
|
|
203
|
+
...input,
|
|
204
|
+
kind,
|
|
205
|
+
payloadType: input.payloadType || kind,
|
|
206
|
+
codec: input.codec || "",
|
|
207
|
+
format: input.format || "",
|
|
208
|
+
supported: !!input.supported,
|
|
209
|
+
reason: input.reason || "",
|
|
210
|
+
meta: input.meta || null
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Select best preferred variant from normalized variant list.
|
|
216
|
+
*
|
|
217
|
+
* @param {Array<Object>} variants
|
|
218
|
+
* @returns {string}
|
|
219
|
+
*/
|
|
220
|
+
static selectPreferred(variants) {
|
|
221
|
+
if (!Array.isArray(variants) || variants.length < 1) return "";
|
|
222
|
+
const priority = ["compressed", "texture", "rgba", "pcm", "raw", "container", "video", "audio"];
|
|
223
|
+
const preferred = priority.map(kind => variants.find(variant => variant.kind === kind && variant.supported)).find(Boolean) || variants.find(variant => variant.supported);
|
|
224
|
+
return preferred ? preferred.codec || preferred.payloadType || preferred.kind || "" : "";
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Returns true if any supported variant is available.
|
|
229
|
+
*
|
|
230
|
+
* @returns {boolean}
|
|
231
|
+
*/
|
|
232
|
+
isSupported() {
|
|
233
|
+
return this.supported === "full" || this.supported === "partial";
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Returns true if raw fallback variant is supported.
|
|
238
|
+
*
|
|
239
|
+
* @returns {boolean}
|
|
240
|
+
*/
|
|
241
|
+
canUseRaw() {
|
|
242
|
+
return this.variants.some(entry => entry && ["raw", "rgba"].includes(entry.kind) && entry.supported);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Returns true if compressed variant is supported.
|
|
247
|
+
*
|
|
248
|
+
* @returns {boolean}
|
|
249
|
+
*/
|
|
250
|
+
canUseCompressed() {
|
|
251
|
+
return this.variants.some(entry => entry && entry.kind === "compressed" && entry.supported);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Return true when a supported variant of the requested kind exists.
|
|
256
|
+
*
|
|
257
|
+
* @param {string} kind
|
|
258
|
+
* @returns {boolean}
|
|
259
|
+
*/
|
|
260
|
+
canUse(kind) {
|
|
261
|
+
return this.variants.some(entry => entry && entry.kind === kind && entry.supported);
|
|
262
|
+
}
|
|
263
|
+
static {
|
|
264
|
+
_initClass();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export { _CjsResourceProbe as CjsResourceProbe };
|
|
269
|
+
//# sourceMappingURL=CjsResourceProbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CjsResourceProbe.js","sources":["../../../src/format/CjsResourceProbe.js"],"sourcesContent":["import { CjsModel } from \"@carbonenginejs/core-types/model\";\nimport { io, type } from \"@carbonenginejs/core-types/schema\";\n\n/**\n * Standard probe report for resource formats and a reusable base for format-specific probes.\n *\n * Instances can be built by:\n * - returning plain object JSON payloads from format packages, then converted with CjsResourceProbe.from(...)\n * - returning CjsResourceProbe instances directly\n *\n * A format can report multiple usable variants in one payload, such as a\n * native compressed texture and a decoded RGBA fallback, without deciding\n * which engine-gpu or media backend should use.\n */\n@type.define({ className: \"CjsResourceProbe\", family: \"resource\" })\nexport class CjsResourceProbe extends CjsModel\n{\n @io.persist\n @type.string\n format = \"\";\n\n @io.persist\n @type.string\n source = \"\";\n\n @io.persist\n @type.string\n supported = \"none\";\n\n @io.persist\n @type.float64\n confidence = 0;\n\n @io.persist\n @type.string\n preferred = \"\";\n\n @io.persist\n @type.string\n reason = \"\";\n\n @io.persist\n @type.unknown\n metadata = null;\n\n @io.persist\n @type.unknown\n variant = {};\n\n @io.persist\n @type.list(\"unknown\")\n variants = [];\n\n @io.persist\n @type.list(\"string\")\n warnings = [];\n\n @io.persist\n @type.list(\"string\")\n errors = [];\n\n constructor(values = null) {\n super();\n this.SetValues(values || {}, {\n markDirty: false,\n skipUpdate: true,\n skipEvents: true\n });\n }\n\n /**\n * Initialize probe fields from a plain object payload.\n *\n * @param {object|null} values\n * @returns {CjsResourceProbe}\n */\n Initialize(values = null) {\n this.SetValues(values || {}, { skipEvents: true });\n return this;\n }\n\n /**\n * Lightweight probe entrypoint.\n * Format packages should override this or provide their own probe implementation.\n *\n * @param {*} src\n * Raw source path or source payload passed by caller.\n * @param {object|null} options\n * Optional metadata/control overrides.\n * @returns {CjsResourceProbe}\n */\n static isSupported(src, options = null) {\n return new CjsResourceProbe({\n format: \"\",\n source: typeof src === \"string\" ? src : \"buffer\",\n supported: \"none\",\n confidence: 0,\n preferred: \"\",\n reason: \"No probe provided.\",\n metadata: null,\n variant: {},\n variants: [],\n warnings: [],\n errors: [\"CjsResourceProbe has no built-in format detection.\"],\n ...options\n });\n }\n\n /**\n * Detailed probe with report-style metadata. Aliases isSupported() in this minimal base.\n *\n * @param {*} src\n * @param {object|null} options\n * @returns {CjsResourceProbe}\n */\n static inspect(src, options = null) {\n return CjsResourceProbe.isSupported(src, options);\n }\n\n /**\n * Build a probe report representing explicit failure.\n *\n * @param {string} format\n * @param {string} reason\n * @param {object|null} options\n * @returns {CjsResourceProbe}\n */\n static createUnsupported(format, reason, options = null) {\n return new CjsResourceProbe({\n format,\n supported: \"none\",\n confidence: 0,\n preferred: \"\",\n reason: reason || \"Unsupported format.\",\n variant: {},\n variants: [],\n warnings: [],\n errors: [reason],\n ...(options || {})\n });\n }\n\n /**\n * Build a probe report representing one or more variants.\n *\n * @param {string} format\n * @param {Array<Object>} variants\n * @param {object|null} options\n * @returns {CjsResourceProbe}\n */\n static createSupported(format, variants, options = null) {\n const normalizedVariants = Array.isArray(variants) ? variants : [];\n const anySupported = normalizedVariants.some((entry) => entry && entry.supported === true);\n const normalized = normalizedVariants.map((entry) => CjsResourceProbe.normalizeVariant(entry));\n const preferred = options && options.preferred ? options.preferred : CjsResourceProbe.selectPreferred(normalized);\n\n return new CjsResourceProbe({\n format,\n source: options?.source || \"\",\n supported: anySupported ? \"full\" : normalizedVariants.length > 0 ? \"partial\" : \"none\",\n confidence: normalized.length > 0 && anySupported ? 1 : (normalized.length > 0 ? 0.5 : 0),\n preferred,\n reason: options?.reason || (anySupported ? \"Supported variant found.\" : \"No variant supported.\"),\n metadata: options?.metadata || null,\n variant: normalized[0] || {},\n variants: normalized,\n warnings: Array.isArray(options?.warnings) ? options.warnings : [],\n errors: Array.isArray(options?.errors) ? options.errors : [],\n ...(options || {})\n });\n }\n\n /**\n * Normalize incoming report payloads into a standard CjsResourceProbe instance.\n *\n * @param {CjsResourceProbe|object|null} input\n * @returns {CjsResourceProbe}\n */\n static from(input) {\n if (input instanceof CjsResourceProbe) return input;\n if (!input) return CjsResourceProbe.createUnsupported(\"\", \"No probe input.\");\n if (typeof input === \"object\" && typeof input.toJSON === \"function\") {\n return new CjsResourceProbe(CjsResourceProbe.normalizeReport(input.toJSON()));\n }\n if (typeof input === \"object\") return new CjsResourceProbe(CjsResourceProbe.normalizeReport(input));\n return CjsResourceProbe.createUnsupported(\"\", \"Invalid probe payload.\");\n }\n\n /**\n * Normalize a plain probe report while preserving format-specific metadata.\n *\n * @param {object} input\n * @returns {object}\n */\n static normalizeReport(input) {\n const variants = Array.isArray(input.variants)\n ? input.variants.map((entry) => CjsResourceProbe.normalizeVariant(entry))\n : [];\n return {\n ...input,\n variant: input.variant ? CjsResourceProbe.normalizeVariant(input.variant) : variants[0] || {},\n variants\n };\n }\n\n /**\n * Normalize variant objects so runtimes can evaluate capability uniformly.\n *\n * @param {object|any} input\n * @returns {{kind: string, payloadType: string, codec: string, format: string, supported: boolean, reason: string, meta: *}}\n */\n static normalizeVariant(input) {\n if (!input || typeof input !== \"object\") {\n return {\n kind: \"raw\",\n payloadType: \"raw\",\n codec: \"\",\n format: \"\",\n supported: false,\n reason: \"Invalid variant payload.\",\n meta: null\n };\n }\n\n const kind = input.kind || input.payloadType || \"raw\";\n return {\n ...input,\n kind,\n payloadType: input.payloadType || kind,\n codec: input.codec || \"\",\n format: input.format || \"\",\n supported: !!input.supported,\n reason: input.reason || \"\",\n meta: input.meta || null\n };\n }\n\n /**\n * Select best preferred variant from normalized variant list.\n *\n * @param {Array<Object>} variants\n * @returns {string}\n */\n static selectPreferred(variants) {\n if (!Array.isArray(variants) || variants.length < 1) return \"\";\n const priority = [ \"compressed\", \"texture\", \"rgba\", \"pcm\", \"raw\", \"container\", \"video\", \"audio\" ];\n const preferred = priority\n .map((kind) => variants.find((variant) => variant.kind === kind && variant.supported))\n .find(Boolean) || variants.find((variant) => variant.supported);\n return preferred ? preferred.codec || preferred.payloadType || preferred.kind || \"\" : \"\";\n }\n\n /**\n * Returns true if any supported variant is available.\n *\n * @returns {boolean}\n */\n isSupported() {\n return this.supported === \"full\" || this.supported === \"partial\";\n }\n\n /**\n * Returns true if raw fallback variant is supported.\n *\n * @returns {boolean}\n */\n canUseRaw() {\n return this.variants.some((entry) => entry && [ \"raw\", \"rgba\" ].includes(entry.kind) && entry.supported);\n }\n\n /**\n * Returns true if compressed variant is supported.\n *\n * @returns {boolean}\n */\n canUseCompressed() {\n return this.variants.some((entry) => entry && entry.kind === \"compressed\" && entry.supported);\n }\n\n /**\n * Return true when a supported variant of the requested kind exists.\n *\n * @param {string} kind\n * @returns {boolean}\n */\n canUse(kind) {\n return this.variants.some((entry) => entry && entry.kind === kind && entry.supported);\n }\n}\n"],"names":["_CjsResourceProbe","CjsResourceProbe","CjsModel","e","_init_format","_init_extra_format","_init_source","_init_extra_source","_init_supported","_init_extra_supported","_init_confidence","_init_extra_confidence","_init_preferred","_init_extra_preferred","_init_reason","_init_extra_reason","_init_metadata","_init_extra_metadata","_init_variant","_init_extra_variant","_init_variants","_init_extra_variants","_init_warnings","_init_extra_warnings","_init_errors","_init_extra_errors","c","_initClass","_applyDecs","type","define","className","family","io","persist","string","float64","unknown","list","format","source","supported","confidence","preferred","reason","metadata","variant","variants","warnings","errors","constructor","values","SetValues","markDirty","skipUpdate","skipEvents","Initialize","isSupported","src","options","inspect","createUnsupported","createSupported","normalizedVariants","Array","isArray","anySupported","some","entry","normalized","map","normalizeVariant","selectPreferred","length","from","input","toJSON","normalizeReport","kind","payloadType","codec","meta","priority","find","Boolean","canUseRaw","includes","canUseCompressed","canUse"],"mappings":";;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAAAA;AAWA,MAAAC,gBAAA,SACsCC,QAAQ,CAC9C;AAAA,EAAA;AAAA,IAAA,CAAA;AAAAC,MAAAA,CAAA,GAAAC,YAAA,EAAAC,kBAAA,EAAAC,YAAA,EAAAC,kBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,gBAAA,EAAAC,sBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,YAAA,EAAAC,kBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,aAAA,EAAAC,mBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,YAAA,EAAAC,kBAAA,CAAA;MAAAC,CAAA,EAAA,CAAA1B,iBAAA,EAAA2B,UAAA;AAAA,KAAA,GAAAC,cAAA,CAAA,IAAA,EAAA,CAFCC,IAAI,CAACC,MAAM,CAAC;AAAEC,MAAAA,SAAS,EAAE,kBAAkB;AAAEC,MAAAA,MAAM,EAAE;AAAW,KAAC,CAAC,CAAA,EAAA,CAAA,CAAA,CAGhEC,EAAE,EAAFA,EAAE,CAACC,OAAO,EACVL,IAAI,EAAJA,IAAI,CAACM,MAAM,CAAA,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