@babylonjs/loaders 5.0.0-rc.7 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/index.js +4 -4
  3. package/OBJ/mtlFileLoader.d.ts +41 -41
  4. package/OBJ/mtlFileLoader.js +232 -232
  5. package/OBJ/mtlFileLoader.js.map +1 -1
  6. package/OBJ/objFileLoader.d.ts +126 -126
  7. package/OBJ/objFileLoader.js +296 -296
  8. package/OBJ/objFileLoader.js.map +1 -1
  9. package/OBJ/objLoadingOptions.d.ts +43 -43
  10. package/OBJ/objLoadingOptions.js +1 -1
  11. package/OBJ/objLoadingOptions.js.map +1 -1
  12. package/OBJ/solidParser.d.ts +154 -154
  13. package/OBJ/solidParser.js +693 -693
  14. package/OBJ/solidParser.js.map +1 -1
  15. package/STL/index.d.ts +1 -1
  16. package/STL/index.js +1 -1
  17. package/STL/stlFileLoader.d.ts +64 -64
  18. package/STL/stlFileLoader.js +233 -233
  19. package/STL/stlFileLoader.js.map +1 -1
  20. package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
  21. package/glTF/1.0/glTFBinaryExtension.js +60 -60
  22. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  23. package/glTF/1.0/glTFLoader.d.ts +136 -136
  24. package/glTF/1.0/glTFLoader.js +1814 -1815
  25. package/glTF/1.0/glTFLoader.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
  27. package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
  28. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  29. package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
  30. package/glTF/1.0/glTFLoaderUtils.js +250 -250
  31. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  32. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
  33. package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
  34. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  35. package/glTF/1.0/index.d.ts +5 -5
  36. package/glTF/1.0/index.js +5 -5
  37. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
  38. package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
  39. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  40. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
  41. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
  42. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  43. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
  44. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
  45. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  46. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
  47. package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
  48. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  49. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
  50. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
  51. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  52. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
  53. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
  54. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
  56. package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
  57. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
  59. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
  60. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
  62. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
  63. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
  65. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
  66. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  67. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
  68. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
  69. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  70. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
  71. package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
  72. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  73. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
  74. package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
  75. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  76. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
  77. package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
  78. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  79. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
  80. package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
  81. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  82. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
  83. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
  84. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  85. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
  86. package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
  87. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  88. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
  89. package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
  90. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  91. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
  92. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
  93. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  94. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
  95. package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
  96. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  97. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
  98. package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
  99. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  100. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
  101. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
  102. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  103. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
  104. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
  105. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  106. package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
  107. package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
  108. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  109. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
  110. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
  111. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  112. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
  113. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
  114. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  115. package/glTF/2.0/Extensions/index.d.ts +26 -26
  116. package/glTF/2.0/Extensions/index.js +26 -26
  117. package/glTF/2.0/glTFLoader.d.ts +406 -405
  118. package/glTF/2.0/glTFLoader.js +2366 -2366
  119. package/glTF/2.0/glTFLoader.js.map +1 -1
  120. package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
  121. package/glTF/2.0/glTFLoaderExtension.js +1 -1
  122. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  123. package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
  124. package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
  125. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  126. package/glTF/2.0/index.d.ts +4 -4
  127. package/glTF/2.0/index.js +5 -4
  128. package/glTF/2.0/index.js.map +1 -1
  129. package/glTF/glTFFileLoader.d.ts +433 -433
  130. package/glTF/glTFFileLoader.js +927 -927
  131. package/glTF/glTFFileLoader.js.map +1 -1
  132. package/glTF/glTFValidation.d.ts +29 -29
  133. package/glTF/glTFValidation.js +123 -123
  134. package/glTF/glTFValidation.js.map +1 -1
  135. package/glTF/index.d.ts +5 -5
  136. package/glTF/index.js +6 -5
  137. package/glTF/index.js.map +1 -1
  138. package/index.d.ts +3 -3
  139. package/index.js +4 -3
  140. package/index.js.map +1 -1
  141. package/legacy/legacy-glTF.d.ts +2 -2
  142. package/legacy/legacy-glTF.js +18 -18
  143. package/legacy/legacy-glTF.js.map +1 -1
  144. package/legacy/legacy-glTF1.d.ts +2 -2
  145. package/legacy/legacy-glTF1.js +15 -14
  146. package/legacy/legacy-glTF1.js.map +1 -1
  147. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  148. package/legacy/legacy-glTF1FileLoader.js +3 -3
  149. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  150. package/legacy/legacy-glTF2.d.ts +2 -2
  151. package/legacy/legacy-glTF2.js +33 -32
  152. package/legacy/legacy-glTF2.js.map +1 -1
  153. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  154. package/legacy/legacy-glTF2FileLoader.js +3 -3
  155. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  156. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  157. package/legacy/legacy-glTFFileLoader.js +4 -4
  158. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  159. package/legacy/legacy-objFileLoader.d.ts +1 -1
  160. package/legacy/legacy-objFileLoader.js +13 -12
  161. package/legacy/legacy-objFileLoader.js.map +1 -1
  162. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  163. package/legacy/legacy-stlFileLoader.js +13 -12
  164. package/legacy/legacy-stlFileLoader.js.map +1 -1
  165. package/legacy/legacy.d.ts +6 -6
  166. package/legacy/legacy.js +8 -7
  167. package/legacy/legacy.js.map +1 -1
  168. package/license.md +71 -0
  169. package/package.json +25 -6
@@ -1,405 +1,406 @@
1
- import { Nullable } from "@babylonjs/core/types.js";
2
- import { Camera } from "@babylonjs/core/Cameras/camera.js";
3
- import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
4
- import { Material } from "@babylonjs/core/Materials/material.js";
5
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
- import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
7
- import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
8
- import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
9
- import { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
10
- import { Scene } from "@babylonjs/core/scene.js";
11
- import { IProperty } from "babylonjs-gltf2interface";
12
- import { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IAnimationChannel, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "./glTFLoaderInterfaces";
13
- import { IGLTFLoaderExtension } from "./glTFLoaderExtension";
14
- import { IGLTFLoader, GLTFFileLoader, IGLTFLoaderData } from "../glTFFileLoader";
15
- import { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
16
- import { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
17
- import { Light } from "@babylonjs/core/Lights/light.js";
18
- import { AssetContainer } from "@babylonjs/core/assetContainer.js";
19
- /**
20
- * Helper class for working with arrays when loading the glTF asset
21
- */
22
- export declare class ArrayItem {
23
- /**
24
- * Gets an item from the given array.
25
- * @param context The context when loading the asset
26
- * @param array The array to get the item from
27
- * @param index The index to the array
28
- * @returns The array item
29
- */
30
- static Get<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
31
- /**
32
- * Assign an `index` field to each item of the given array.
33
- * @param array The array of items
34
- */
35
- static Assign(array?: IArrItem[]): void;
36
- }
37
- /**
38
- * The glTF 2.0 loader
39
- */
40
- export declare class GLTFLoader implements IGLTFLoader {
41
- /** @hidden */
42
- _completePromises: Promise<any>[];
43
- /** @hidden */
44
- _assetContainer: Nullable<AssetContainer>;
45
- /** Storage */
46
- _babylonLights: Light[];
47
- /** @hidden */
48
- _disableInstancedMesh: number;
49
- private readonly _parent;
50
- private readonly _extensions;
51
- private _disposed;
52
- private _rootUrl;
53
- private _fileName;
54
- private _uniqueRootUrl;
55
- private _gltf;
56
- private _bin;
57
- private _babylonScene;
58
- private _rootBabylonMesh;
59
- private _defaultBabylonMaterialData;
60
- private _postSceneLoadActions;
61
- private static _RegisteredExtensions;
62
- /**
63
- * The default glTF sampler.
64
- */
65
- static readonly DefaultSampler: ISampler;
66
- /**
67
- * Registers a loader extension.
68
- * @param name The name of the loader extension.
69
- * @param factory The factory function that creates the loader extension.
70
- */
71
- static RegisterExtension(name: string, factory: (loader: GLTFLoader) => IGLTFLoaderExtension): void;
72
- /**
73
- * Unregisters a loader extension.
74
- * @param name The name of the loader extension.
75
- * @returns A boolean indicating whether the extension has been unregistered
76
- */
77
- static UnregisterExtension(name: string): boolean;
78
- /**
79
- * The object that represents the glTF JSON.
80
- */
81
- get gltf(): IGLTF;
82
- /**
83
- * The BIN chunk of a binary glTF.
84
- */
85
- get bin(): Nullable<IDataBuffer>;
86
- /**
87
- * The parent file loader.
88
- */
89
- get parent(): GLTFFileLoader;
90
- /**
91
- * The Babylon scene when loading the asset.
92
- */
93
- get babylonScene(): Scene;
94
- /**
95
- * The root Babylon mesh when loading the asset.
96
- */
97
- get rootBabylonMesh(): Nullable<Mesh>;
98
- /**
99
- * @param parent
100
- * @hidden
101
- */
102
- constructor(parent: GLTFFileLoader);
103
- /** @hidden */
104
- dispose(): void;
105
- /**
106
- * @param meshesNames
107
- * @param scene
108
- * @param container
109
- * @param data
110
- * @param rootUrl
111
- * @param onProgress
112
- * @param fileName
113
- * @hidden
114
- */
115
- importMeshAsync(meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
116
- /**
117
- * @param scene
118
- * @param data
119
- * @param rootUrl
120
- * @param onProgress
121
- * @param fileName
122
- * @hidden
123
- */
124
- loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
125
- private _loadAsync;
126
- private _loadData;
127
- private _setupData;
128
- private _loadExtensions;
129
- private _checkExtensions;
130
- private _createRootNode;
131
- /**
132
- * Loads a glTF scene.
133
- * @param context The context when loading the asset
134
- * @param scene The glTF scene property
135
- * @returns A promise that resolves when the load is complete
136
- */
137
- loadSceneAsync(context: string, scene: IScene): Promise<void>;
138
- private _forEachPrimitive;
139
- private _getGeometries;
140
- private _getMeshes;
141
- private _getTransformNodes;
142
- private _getSkeletons;
143
- private _getAnimationGroups;
144
- private _startAnimations;
145
- /**
146
- * Loads a glTF node.
147
- * @param context The context when loading the asset
148
- * @param node The glTF node property
149
- * @param assign A function called synchronously after parsing the glTF properties
150
- * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
151
- */
152
- loadNodeAsync(context: string, node: INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
153
- private _loadMeshAsync;
154
- /**
155
- * @hidden Define this method to modify the default behavior when loading data for mesh primitives.
156
- * @param context The context when loading the asset
157
- * @param name The mesh name when loading the asset
158
- * @param node The glTF node when loading the asset
159
- * @param mesh The glTF mesh when loading the asset
160
- * @param primitive The glTF mesh primitive property
161
- * @param assign A function called synchronously after parsing the glTF properties
162
- * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
163
- */
164
- _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
165
- private _loadVertexDataAsync;
166
- private _createMorphTargets;
167
- private _loadMorphTargetsAsync;
168
- private _loadMorphTargetVertexDataAsync;
169
- private static _LoadTransform;
170
- private _loadSkinAsync;
171
- private _loadBones;
172
- private _findSkeletonRootNode;
173
- private _loadBone;
174
- private _loadSkinInverseBindMatricesDataAsync;
175
- private _updateBoneMatrices;
176
- private _getNodeMatrix;
177
- /**
178
- * Loads a glTF camera.
179
- * @param context The context when loading the asset
180
- * @param camera The glTF camera property
181
- * @param assign A function called synchronously after parsing the glTF properties
182
- * @returns A promise that resolves with the loaded Babylon camera when the load is complete
183
- */
184
- loadCameraAsync(context: string, camera: ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
185
- private _loadAnimationsAsync;
186
- /**
187
- * Loads a glTF animation.
188
- * @param context The context when loading the asset
189
- * @param animation The glTF animation property
190
- * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
191
- */
192
- loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup>;
193
- /**
194
- * @hidden Loads a glTF animation channel.
195
- * @param context The context when loading the asset
196
- * @param animationContext The context of the animation when loading the asset
197
- * @param animation The glTF animation property
198
- * @param channel The glTF animation channel property
199
- * @param babylonAnimationGroup The babylon animation group property
200
- * @param animationTargetOverride The babylon animation channel target override property. My be null.
201
- * @returns A void promise when the channel load is complete
202
- */
203
- _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
204
- private _loadAnimationSamplerAsync;
205
- /**
206
- * Loads a glTF buffer.
207
- * @param context The context when loading the asset
208
- * @param buffer The glTF buffer property
209
- * @param byteOffset The byte offset to use
210
- * @param byteLength The byte length to use
211
- * @returns A promise that resolves with the loaded data when the load is complete
212
- */
213
- loadBufferAsync(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Promise<ArrayBufferView>;
214
- /**
215
- * Loads a glTF buffer view.
216
- * @param context The context when loading the asset
217
- * @param bufferView The glTF buffer view property
218
- * @returns A promise that resolves with the loaded data when the load is complete
219
- */
220
- loadBufferViewAsync(context: string, bufferView: IBufferView): Promise<ArrayBufferView>;
221
- private _loadAccessorAsync;
222
- /**
223
- * @param context
224
- * @param accessor
225
- * @hidden
226
- */
227
- _loadFloatAccessorAsync(context: string, accessor: IAccessor): Promise<Float32Array>;
228
- private _loadIndicesAccessorAsync;
229
- private _loadVertexBufferViewAsync;
230
- private _loadVertexAccessorAsync;
231
- private _loadMaterialMetallicRoughnessPropertiesAsync;
232
- /**
233
- * @param context
234
- * @param material
235
- * @param babylonMesh
236
- * @param babylonDrawMode
237
- * @param assign
238
- * @hidden
239
- */
240
- _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
241
- private _createDefaultMaterial;
242
- /**
243
- * Creates a Babylon material from a glTF material.
244
- * @param context The context when loading the asset
245
- * @param material The glTF material property
246
- * @param babylonDrawMode The draw mode for the Babylon material
247
- * @returns The Babylon material
248
- */
249
- createMaterial(context: string, material: IMaterial, babylonDrawMode: number): Material;
250
- /**
251
- * Loads properties from a glTF material into a Babylon material.
252
- * @param context The context when loading the asset
253
- * @param material The glTF material property
254
- * @param babylonMaterial The Babylon material
255
- * @returns A promise that resolves when the load is complete
256
- */
257
- loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
258
- /**
259
- * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
260
- * @param context The context when loading the asset
261
- * @param material The glTF material property
262
- * @param babylonMaterial The Babylon material
263
- * @returns A promise that resolves when the load is complete
264
- */
265
- loadMaterialBasePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
266
- /**
267
- * Loads the alpha properties from a glTF material into a Babylon material.
268
- * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
269
- * @param context The context when loading the asset
270
- * @param material The glTF material property
271
- * @param babylonMaterial The Babylon material
272
- */
273
- loadMaterialAlphaProperties(context: string, material: IMaterial, babylonMaterial: Material): void;
274
- /**
275
- * Loads a glTF texture info.
276
- * @param context The context when loading the asset
277
- * @param textureInfo The glTF texture info property
278
- * @param assign A function called synchronously after parsing the glTF properties
279
- * @returns A promise that resolves with the loaded Babylon texture when the load is complete
280
- */
281
- loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
282
- /**
283
- * @param context
284
- * @param texture
285
- * @param assign
286
- * @hidden
287
- */
288
- _loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
289
- /**
290
- * @param context
291
- * @param sampler
292
- * @param image
293
- * @param assign
294
- * @param textureLoaderOptions
295
- * @param useSRGBBuffer
296
- * @hidden
297
- */
298
- _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void, textureLoaderOptions?: any, useSRGBBuffer?: boolean): Promise<BaseTexture>;
299
- private _loadSampler;
300
- /**
301
- * Loads a glTF image.
302
- * @param context The context when loading the asset
303
- * @param image The glTF image property
304
- * @returns A promise that resolves with the loaded data when the load is complete
305
- */
306
- loadImageAsync(context: string, image: IImage): Promise<ArrayBufferView>;
307
- /**
308
- * Loads a glTF uri.
309
- * @param context The context when loading the asset
310
- * @param property The glTF property associated with the uri
311
- * @param uri The base64 or relative uri
312
- * @returns A promise that resolves with the loaded data when the load is complete
313
- */
314
- loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
315
- /**
316
- * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
317
- * @param babylonObject the Babylon object with metadata
318
- * @param babylonObject.metadata
319
- * @param pointer the JSON pointer
320
- */
321
- static AddPointerMetadata(babylonObject: {
322
- metadata: any;
323
- }, pointer: string): void;
324
- private static _GetTextureWrapMode;
325
- private static _GetTextureSamplingMode;
326
- private static _GetTypedArrayConstructor;
327
- private static _GetTypedArray;
328
- private static _GetNumComponents;
329
- private static _ValidateUri;
330
- /**
331
- * @param context
332
- * @param mode
333
- * @hidden
334
- */
335
- static _GetDrawMode(context: string, mode: number | undefined): number;
336
- private _compileMaterialsAsync;
337
- private _compileShadowGeneratorsAsync;
338
- private _forEachExtensions;
339
- private _applyExtensions;
340
- private _extensionsOnLoading;
341
- private _extensionsOnReady;
342
- private _extensionsLoadSceneAsync;
343
- private _extensionsLoadNodeAsync;
344
- private _extensionsLoadCameraAsync;
345
- private _extensionsLoadVertexDataAsync;
346
- private _extensionsLoadMeshPrimitiveAsync;
347
- private _extensionsLoadMaterialAsync;
348
- private _extensionsCreateMaterial;
349
- private _extensionsLoadMaterialPropertiesAsync;
350
- private _extensionsLoadTextureInfoAsync;
351
- private _extensionsLoadTextureAsync;
352
- private _extensionsLoadAnimationAsync;
353
- private _extensionsLoadSkinAsync;
354
- private _extensionsLoadUriAsync;
355
- private _extensionsLoadBufferViewAsync;
356
- private _extensionsLoadBufferAsync;
357
- /**
358
- * Helper method called by a loader extension to load an glTF extension.
359
- * @param context The context when loading the asset
360
- * @param property The glTF property to load the extension from
361
- * @param extensionName The name of the extension to load
362
- * @param actionAsync The action to run
363
- * @returns The promise returned by actionAsync or null if the extension does not exist
364
- */
365
- static LoadExtensionAsync<TExtension = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extensionContext: string, extension: TExtension) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
366
- /**
367
- * Helper method called by a loader extension to load a glTF extra.
368
- * @param context The context when loading the asset
369
- * @param property The glTF property to load the extra from
370
- * @param extensionName The name of the extension to load
371
- * @param actionAsync The action to run
372
- * @returns The promise returned by actionAsync or null if the extra does not exist
373
- */
374
- static LoadExtraAsync<TExtra = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extraContext: string, extra: TExtra) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
375
- /**
376
- * Checks for presence of an extension.
377
- * @param name The name of the extension to check
378
- * @returns A boolean indicating the presence of the given extension name in `extensionsUsed`
379
- */
380
- isExtensionUsed(name: string): boolean;
381
- /**
382
- * Increments the indentation level and logs a message.
383
- * @param message The message to log
384
- */
385
- logOpen(message: string): void;
386
- /**
387
- * Decrements the indentation level.
388
- */
389
- logClose(): void;
390
- /**
391
- * Logs a message
392
- * @param message The message to log
393
- */
394
- log(message: string): void;
395
- /**
396
- * Starts a performance counter.
397
- * @param counterName The name of the performance counter
398
- */
399
- startPerformanceCounter(counterName: string): void;
400
- /**
401
- * Ends a performance counter.
402
- * @param counterName The name of the performance counter
403
- */
404
- endPerformanceCounter(counterName: string): void;
405
- }
1
+ import type { Nullable } from "@babylonjs/core/types.js";
2
+ import { Camera } from "@babylonjs/core/Cameras/camera.js";
3
+ import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
4
+ import { Material } from "@babylonjs/core/Materials/material.js";
5
+ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
6
+ import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
7
+ import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
8
+ import { Mesh } from "@babylonjs/core/Meshes/mesh.js";
9
+ import type { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader.js";
10
+ import type { Scene } from "@babylonjs/core/scene.js";
11
+ import type { IProperty } from "babylonjs-gltf2interface/.js";
12
+ import type { IGLTF, ISampler, INode, IScene, IMesh, IAccessor, ICamera, IAnimation, IAnimationChannel, IBuffer, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "./glTFLoaderInterfaces";
13
+ import type { IGLTFLoaderExtension } from "./glTFLoaderExtension";
14
+ import type { IGLTFLoader, IGLTFLoaderData } from "../glTFFileLoader";
15
+ import { GLTFFileLoader } from "../glTFFileLoader";
16
+ import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
17
+ import type { IDataBuffer } from "@babylonjs/core/Misc/dataReader.js";
18
+ import type { Light } from "@babylonjs/core/Lights/light.js";
19
+ import type { AssetContainer } from "@babylonjs/core/assetContainer.js";
20
+ /**
21
+ * Helper class for working with arrays when loading the glTF asset
22
+ */
23
+ export declare class ArrayItem {
24
+ /**
25
+ * Gets an item from the given array.
26
+ * @param context The context when loading the asset
27
+ * @param array The array to get the item from
28
+ * @param index The index to the array
29
+ * @returns The array item
30
+ */
31
+ static Get<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
32
+ /**
33
+ * Assign an `index` field to each item of the given array.
34
+ * @param array The array of items
35
+ */
36
+ static Assign(array?: IArrItem[]): void;
37
+ }
38
+ /**
39
+ * The glTF 2.0 loader
40
+ */
41
+ export declare class GLTFLoader implements IGLTFLoader {
42
+ /** @hidden */
43
+ _completePromises: Promise<any>[];
44
+ /** @hidden */
45
+ _assetContainer: Nullable<AssetContainer>;
46
+ /** Storage */
47
+ _babylonLights: Light[];
48
+ /** @hidden */
49
+ _disableInstancedMesh: number;
50
+ private readonly _parent;
51
+ private readonly _extensions;
52
+ private _disposed;
53
+ private _rootUrl;
54
+ private _fileName;
55
+ private _uniqueRootUrl;
56
+ private _gltf;
57
+ private _bin;
58
+ private _babylonScene;
59
+ private _rootBabylonMesh;
60
+ private _defaultBabylonMaterialData;
61
+ private _postSceneLoadActions;
62
+ private static _RegisteredExtensions;
63
+ /**
64
+ * The default glTF sampler.
65
+ */
66
+ static readonly DefaultSampler: ISampler;
67
+ /**
68
+ * Registers a loader extension.
69
+ * @param name The name of the loader extension.
70
+ * @param factory The factory function that creates the loader extension.
71
+ */
72
+ static RegisterExtension(name: string, factory: (loader: GLTFLoader) => IGLTFLoaderExtension): void;
73
+ /**
74
+ * Unregisters a loader extension.
75
+ * @param name The name of the loader extension.
76
+ * @returns A boolean indicating whether the extension has been unregistered
77
+ */
78
+ static UnregisterExtension(name: string): boolean;
79
+ /**
80
+ * The object that represents the glTF JSON.
81
+ */
82
+ get gltf(): IGLTF;
83
+ /**
84
+ * The BIN chunk of a binary glTF.
85
+ */
86
+ get bin(): Nullable<IDataBuffer>;
87
+ /**
88
+ * The parent file loader.
89
+ */
90
+ get parent(): GLTFFileLoader;
91
+ /**
92
+ * The Babylon scene when loading the asset.
93
+ */
94
+ get babylonScene(): Scene;
95
+ /**
96
+ * The root Babylon mesh when loading the asset.
97
+ */
98
+ get rootBabylonMesh(): Nullable<Mesh>;
99
+ /**
100
+ * @param parent
101
+ * @hidden
102
+ */
103
+ constructor(parent: GLTFFileLoader);
104
+ /** @hidden */
105
+ dispose(): void;
106
+ /**
107
+ * @param meshesNames
108
+ * @param scene
109
+ * @param container
110
+ * @param data
111
+ * @param rootUrl
112
+ * @param onProgress
113
+ * @param fileName
114
+ * @hidden
115
+ */
116
+ importMeshAsync(meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
117
+ /**
118
+ * @param scene
119
+ * @param data
120
+ * @param rootUrl
121
+ * @param onProgress
122
+ * @param fileName
123
+ * @hidden
124
+ */
125
+ loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
126
+ private _loadAsync;
127
+ private _loadData;
128
+ private _setupData;
129
+ private _loadExtensions;
130
+ private _checkExtensions;
131
+ private _createRootNode;
132
+ /**
133
+ * Loads a glTF scene.
134
+ * @param context The context when loading the asset
135
+ * @param scene The glTF scene property
136
+ * @returns A promise that resolves when the load is complete
137
+ */
138
+ loadSceneAsync(context: string, scene: IScene): Promise<void>;
139
+ private _forEachPrimitive;
140
+ private _getGeometries;
141
+ private _getMeshes;
142
+ private _getTransformNodes;
143
+ private _getSkeletons;
144
+ private _getAnimationGroups;
145
+ private _startAnimations;
146
+ /**
147
+ * Loads a glTF node.
148
+ * @param context The context when loading the asset
149
+ * @param node The glTF node property
150
+ * @param assign A function called synchronously after parsing the glTF properties
151
+ * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
152
+ */
153
+ loadNodeAsync(context: string, node: INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
154
+ private _loadMeshAsync;
155
+ /**
156
+ * @hidden Define this method to modify the default behavior when loading data for mesh primitives.
157
+ * @param context The context when loading the asset
158
+ * @param name The mesh name when loading the asset
159
+ * @param node The glTF node when loading the asset
160
+ * @param mesh The glTF mesh when loading the asset
161
+ * @param primitive The glTF mesh primitive property
162
+ * @param assign A function called synchronously after parsing the glTF properties
163
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
164
+ */
165
+ _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
166
+ private _loadVertexDataAsync;
167
+ private _createMorphTargets;
168
+ private _loadMorphTargetsAsync;
169
+ private _loadMorphTargetVertexDataAsync;
170
+ private static _LoadTransform;
171
+ private _loadSkinAsync;
172
+ private _loadBones;
173
+ private _findSkeletonRootNode;
174
+ private _loadBone;
175
+ private _loadSkinInverseBindMatricesDataAsync;
176
+ private _updateBoneMatrices;
177
+ private _getNodeMatrix;
178
+ /**
179
+ * Loads a glTF camera.
180
+ * @param context The context when loading the asset
181
+ * @param camera The glTF camera property
182
+ * @param assign A function called synchronously after parsing the glTF properties
183
+ * @returns A promise that resolves with the loaded Babylon camera when the load is complete
184
+ */
185
+ loadCameraAsync(context: string, camera: ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
186
+ private _loadAnimationsAsync;
187
+ /**
188
+ * Loads a glTF animation.
189
+ * @param context The context when loading the asset
190
+ * @param animation The glTF animation property
191
+ * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
192
+ */
193
+ loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup>;
194
+ /**
195
+ * @hidden Loads a glTF animation channel.
196
+ * @param context The context when loading the asset
197
+ * @param animationContext The context of the animation when loading the asset
198
+ * @param animation The glTF animation property
199
+ * @param channel The glTF animation channel property
200
+ * @param babylonAnimationGroup The babylon animation group property
201
+ * @param animationTargetOverride The babylon animation channel target override property. My be null.
202
+ * @returns A void promise when the channel load is complete
203
+ */
204
+ _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
205
+ private _loadAnimationSamplerAsync;
206
+ /**
207
+ * Loads a glTF buffer.
208
+ * @param context The context when loading the asset
209
+ * @param buffer The glTF buffer property
210
+ * @param byteOffset The byte offset to use
211
+ * @param byteLength The byte length to use
212
+ * @returns A promise that resolves with the loaded data when the load is complete
213
+ */
214
+ loadBufferAsync(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Promise<ArrayBufferView>;
215
+ /**
216
+ * Loads a glTF buffer view.
217
+ * @param context The context when loading the asset
218
+ * @param bufferView The glTF buffer view property
219
+ * @returns A promise that resolves with the loaded data when the load is complete
220
+ */
221
+ loadBufferViewAsync(context: string, bufferView: IBufferView): Promise<ArrayBufferView>;
222
+ private _loadAccessorAsync;
223
+ /**
224
+ * @param context
225
+ * @param accessor
226
+ * @hidden
227
+ */
228
+ _loadFloatAccessorAsync(context: string, accessor: IAccessor): Promise<Float32Array>;
229
+ private _loadIndicesAccessorAsync;
230
+ private _loadVertexBufferViewAsync;
231
+ private _loadVertexAccessorAsync;
232
+ private _loadMaterialMetallicRoughnessPropertiesAsync;
233
+ /**
234
+ * @param context
235
+ * @param material
236
+ * @param babylonMesh
237
+ * @param babylonDrawMode
238
+ * @param assign
239
+ * @hidden
240
+ */
241
+ _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
242
+ private _createDefaultMaterial;
243
+ /**
244
+ * Creates a Babylon material from a glTF material.
245
+ * @param context The context when loading the asset
246
+ * @param material The glTF material property
247
+ * @param babylonDrawMode The draw mode for the Babylon material
248
+ * @returns The Babylon material
249
+ */
250
+ createMaterial(context: string, material: IMaterial, babylonDrawMode: number): Material;
251
+ /**
252
+ * Loads properties from a glTF material into a Babylon material.
253
+ * @param context The context when loading the asset
254
+ * @param material The glTF material property
255
+ * @param babylonMaterial The Babylon material
256
+ * @returns A promise that resolves when the load is complete
257
+ */
258
+ loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
259
+ /**
260
+ * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
261
+ * @param context The context when loading the asset
262
+ * @param material The glTF material property
263
+ * @param babylonMaterial The Babylon material
264
+ * @returns A promise that resolves when the load is complete
265
+ */
266
+ loadMaterialBasePropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Promise<void>;
267
+ /**
268
+ * Loads the alpha properties from a glTF material into a Babylon material.
269
+ * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
270
+ * @param context The context when loading the asset
271
+ * @param material The glTF material property
272
+ * @param babylonMaterial The Babylon material
273
+ */
274
+ loadMaterialAlphaProperties(context: string, material: IMaterial, babylonMaterial: Material): void;
275
+ /**
276
+ * Loads a glTF texture info.
277
+ * @param context The context when loading the asset
278
+ * @param textureInfo The glTF texture info property
279
+ * @param assign A function called synchronously after parsing the glTF properties
280
+ * @returns A promise that resolves with the loaded Babylon texture when the load is complete
281
+ */
282
+ loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
283
+ /**
284
+ * @param context
285
+ * @param texture
286
+ * @param assign
287
+ * @hidden
288
+ */
289
+ _loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
290
+ /**
291
+ * @param context
292
+ * @param sampler
293
+ * @param image
294
+ * @param assign
295
+ * @param textureLoaderOptions
296
+ * @param useSRGBBuffer
297
+ * @hidden
298
+ */
299
+ _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void, textureLoaderOptions?: any, useSRGBBuffer?: boolean): Promise<BaseTexture>;
300
+ private _loadSampler;
301
+ /**
302
+ * Loads a glTF image.
303
+ * @param context The context when loading the asset
304
+ * @param image The glTF image property
305
+ * @returns A promise that resolves with the loaded data when the load is complete
306
+ */
307
+ loadImageAsync(context: string, image: IImage): Promise<ArrayBufferView>;
308
+ /**
309
+ * Loads a glTF uri.
310
+ * @param context The context when loading the asset
311
+ * @param property The glTF property associated with the uri
312
+ * @param uri The base64 or relative uri
313
+ * @returns A promise that resolves with the loaded data when the load is complete
314
+ */
315
+ loadUriAsync(context: string, property: IProperty, uri: string): Promise<ArrayBufferView>;
316
+ /**
317
+ * Adds a JSON pointer to the metadata of the Babylon object at `<object>.metadata.gltf.pointers`.
318
+ * @param babylonObject the Babylon object with metadata
319
+ * @param babylonObject.metadata
320
+ * @param pointer the JSON pointer
321
+ */
322
+ static AddPointerMetadata(babylonObject: {
323
+ metadata: any;
324
+ }, pointer: string): void;
325
+ private static _GetTextureWrapMode;
326
+ private static _GetTextureSamplingMode;
327
+ private static _GetTypedArrayConstructor;
328
+ private static _GetTypedArray;
329
+ private static _GetNumComponents;
330
+ private static _ValidateUri;
331
+ /**
332
+ * @param context
333
+ * @param mode
334
+ * @hidden
335
+ */
336
+ static _GetDrawMode(context: string, mode: number | undefined): number;
337
+ private _compileMaterialsAsync;
338
+ private _compileShadowGeneratorsAsync;
339
+ private _forEachExtensions;
340
+ private _applyExtensions;
341
+ private _extensionsOnLoading;
342
+ private _extensionsOnReady;
343
+ private _extensionsLoadSceneAsync;
344
+ private _extensionsLoadNodeAsync;
345
+ private _extensionsLoadCameraAsync;
346
+ private _extensionsLoadVertexDataAsync;
347
+ private _extensionsLoadMeshPrimitiveAsync;
348
+ private _extensionsLoadMaterialAsync;
349
+ private _extensionsCreateMaterial;
350
+ private _extensionsLoadMaterialPropertiesAsync;
351
+ private _extensionsLoadTextureInfoAsync;
352
+ private _extensionsLoadTextureAsync;
353
+ private _extensionsLoadAnimationAsync;
354
+ private _extensionsLoadSkinAsync;
355
+ private _extensionsLoadUriAsync;
356
+ private _extensionsLoadBufferViewAsync;
357
+ private _extensionsLoadBufferAsync;
358
+ /**
359
+ * Helper method called by a loader extension to load an glTF extension.
360
+ * @param context The context when loading the asset
361
+ * @param property The glTF property to load the extension from
362
+ * @param extensionName The name of the extension to load
363
+ * @param actionAsync The action to run
364
+ * @returns The promise returned by actionAsync or null if the extension does not exist
365
+ */
366
+ static LoadExtensionAsync<TExtension = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extensionContext: string, extension: TExtension) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
367
+ /**
368
+ * Helper method called by a loader extension to load a glTF extra.
369
+ * @param context The context when loading the asset
370
+ * @param property The glTF property to load the extra from
371
+ * @param extensionName The name of the extension to load
372
+ * @param actionAsync The action to run
373
+ * @returns The promise returned by actionAsync or null if the extra does not exist
374
+ */
375
+ static LoadExtraAsync<TExtra = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extraContext: string, extra: TExtra) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
376
+ /**
377
+ * Checks for presence of an extension.
378
+ * @param name The name of the extension to check
379
+ * @returns A boolean indicating the presence of the given extension name in `extensionsUsed`
380
+ */
381
+ isExtensionUsed(name: string): boolean;
382
+ /**
383
+ * Increments the indentation level and logs a message.
384
+ * @param message The message to log
385
+ */
386
+ logOpen(message: string): void;
387
+ /**
388
+ * Decrements the indentation level.
389
+ */
390
+ logClose(): void;
391
+ /**
392
+ * Logs a message
393
+ * @param message The message to log
394
+ */
395
+ log(message: string): void;
396
+ /**
397
+ * Starts a performance counter.
398
+ * @param counterName The name of the performance counter
399
+ */
400
+ startPerformanceCounter(counterName: string): void;
401
+ /**
402
+ * Ends a performance counter.
403
+ * @param counterName The name of the performance counter
404
+ */
405
+ endPerformanceCounter(counterName: string): void;
406
+ }