@loaders.gl/gltf 4.2.0-alpha.6 → 4.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +90 -62
- package/dist/dist.min.js +1 -1
- package/dist/glb-loader.d.ts +22 -2
- package/dist/glb-loader.d.ts.map +1 -1
- package/dist/glb-loader.js +2 -0
- package/dist/glb-writer.d.ts +17 -2
- package/dist/glb-writer.d.ts.map +1 -1
- package/dist/gltf-loader.d.ts +24 -2
- package/dist/gltf-loader.d.ts.map +1 -1
- package/dist/gltf-loader.js +2 -0
- package/dist/gltf-writer.d.ts +2 -18
- package/dist/gltf-writer.d.ts.map +1 -1
- package/dist/gltf-writer.js +2 -2
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +2 -2
- package/dist/lib/utils/version.js +1 -1
- package/package.json +7 -7
- package/src/glb-loader.ts +4 -2
- package/src/glb-writer.ts +2 -2
- package/src/gltf-loader.ts +4 -2
- package/src/gltf-writer.ts +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Version constant cannot be imported, it needs to correspond to the build version of **this** module.
|
|
2
2
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
3
3
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
4
|
-
export const VERSION = typeof "4.2.0-
|
|
4
|
+
export const VERSION = typeof "4.2.0-beta.1" !== 'undefined' ? "4.2.0-beta.1" : 'latest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/gltf",
|
|
3
|
-
"version": "4.2.0-
|
|
3
|
+
"version": "4.2.0-beta.2",
|
|
4
4
|
"description": "Framework-independent loader for the glTF format",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@loaders.gl/draco": "4.2.0-
|
|
47
|
-
"@loaders.gl/images": "4.2.0-
|
|
48
|
-
"@loaders.gl/loader-utils": "4.2.0-
|
|
49
|
-
"@loaders.gl/schema": "4.2.0-
|
|
50
|
-
"@loaders.gl/textures": "4.2.0-
|
|
46
|
+
"@loaders.gl/draco": "4.2.0-beta.2",
|
|
47
|
+
"@loaders.gl/images": "4.2.0-beta.2",
|
|
48
|
+
"@loaders.gl/loader-utils": "4.2.0-beta.2",
|
|
49
|
+
"@loaders.gl/schema": "4.2.0-beta.2",
|
|
50
|
+
"@loaders.gl/textures": "4.2.0-beta.2",
|
|
51
51
|
"@math.gl/core": "^4.0.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@loaders.gl/core": "^4.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "13c03663fec365a4d24c06377d50035cebd7ba9f"
|
|
57
57
|
}
|
package/src/glb-loader.ts
CHANGED
|
@@ -16,7 +16,9 @@ export type GLBLoaderOptions = LoaderOptions & {
|
|
|
16
16
|
* GLB Loader -
|
|
17
17
|
* GLB is the binary container format for GLTF
|
|
18
18
|
*/
|
|
19
|
-
export const GLBLoader
|
|
19
|
+
export const GLBLoader = {
|
|
20
|
+
dataType: null as unknown as GLB,
|
|
21
|
+
batchType: null as never,
|
|
20
22
|
name: 'GLB',
|
|
21
23
|
id: 'glb',
|
|
22
24
|
module: 'gltf',
|
|
@@ -31,7 +33,7 @@ export const GLBLoader: LoaderWithParser<GLB, never, GLBLoaderOptions> = {
|
|
|
31
33
|
strict: false // Enables deprecated XVIZ support (illegal CHUNK formats)
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
}
|
|
36
|
+
} as const satisfies LoaderWithParser<GLB, never, GLBLoaderOptions>;
|
|
35
37
|
|
|
36
38
|
async function parse(arrayBuffer: ArrayBuffer, options?: GLBLoaderOptions): Promise<GLB> {
|
|
37
39
|
return parseSync(arrayBuffer, options);
|
package/src/glb-writer.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type GLBWriterOptions = WriterOptions & {
|
|
|
16
16
|
* GLB exporter
|
|
17
17
|
* GLB is the binary container format for GLTF
|
|
18
18
|
*/
|
|
19
|
-
export const GLBWriter
|
|
19
|
+
export const GLBWriter = {
|
|
20
20
|
name: 'GLB',
|
|
21
21
|
id: 'glb',
|
|
22
22
|
module: 'gltf',
|
|
@@ -31,7 +31,7 @@ export const GLBWriter: WriterWithEncoder<GLB, never, GLBWriterOptions> = {
|
|
|
31
31
|
|
|
32
32
|
encode: async (glb, options: GLBWriterOptions = {}) => encodeSync(glb, options),
|
|
33
33
|
encodeSync
|
|
34
|
-
}
|
|
34
|
+
} as const satisfies WriterWithEncoder<GLB, never, GLBWriterOptions>;
|
|
35
35
|
|
|
36
36
|
function encodeSync(glb, options) {
|
|
37
37
|
const {byteOffset = 0} = options;
|
package/src/gltf-loader.ts
CHANGED
|
@@ -22,7 +22,9 @@ export type GLTFLoaderOptions = LoaderOptions &
|
|
|
22
22
|
/**
|
|
23
23
|
* GLTF loader
|
|
24
24
|
*/
|
|
25
|
-
export const GLTFLoader
|
|
25
|
+
export const GLTFLoader = {
|
|
26
|
+
dataType: null as unknown as GLTFWithBuffers,
|
|
27
|
+
batchType: null as never,
|
|
26
28
|
name: 'glTF',
|
|
27
29
|
id: 'gltf',
|
|
28
30
|
module: 'gltf',
|
|
@@ -46,7 +48,7 @@ export const GLTFLoader: LoaderWithParser<GLTFWithBuffers, never, GLBLoaderOptio
|
|
|
46
48
|
// common?
|
|
47
49
|
log: console // eslint-disable-line
|
|
48
50
|
}
|
|
49
|
-
}
|
|
51
|
+
} as const satisfies LoaderWithParser<GLTFWithBuffers, never, GLBLoaderOptions>;
|
|
50
52
|
|
|
51
53
|
export async function parse(
|
|
52
54
|
arrayBuffer,
|
package/src/gltf-writer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {WriterOptions, WriterWithEncoder} from '@loaders.gl/loader-utils';
|
|
2
2
|
import {VERSION} from './lib/utils/version';
|
|
3
3
|
import {encodeGLTFSync} from './lib/encoders/encode-gltf';
|
|
4
4
|
|
|
@@ -11,6 +11,9 @@ export type GLTFWriterOptions = WriterOptions & {
|
|
|
11
11
|
* GLTF exporter
|
|
12
12
|
*/
|
|
13
13
|
export const GLTFWriter = {
|
|
14
|
+
dataType: null as unknown as any,
|
|
15
|
+
batchType: null as never,
|
|
16
|
+
|
|
14
17
|
name: 'glTF',
|
|
15
18
|
id: 'gltf',
|
|
16
19
|
module: 'gltf',
|
|
@@ -25,7 +28,7 @@ export const GLTFWriter = {
|
|
|
25
28
|
|
|
26
29
|
encode: async (gltf, options: GLTFWriterOptions = {}) => encodeSync(gltf, options),
|
|
27
30
|
encodeSync
|
|
28
|
-
}
|
|
31
|
+
} as WriterWithEncoder<any, never, GLTFWriterOptions>;
|
|
29
32
|
|
|
30
33
|
function encodeSync(gltf, options: GLTFWriterOptions = {}) {
|
|
31
34
|
const {byteOffset = 0} = options;
|
|
@@ -38,6 +41,3 @@ function encodeSync(gltf, options: GLTFWriterOptions = {}) {
|
|
|
38
41
|
|
|
39
42
|
return arrayBuffer;
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
// TYPE TESTS - TODO find a better way than exporting junk
|
|
43
|
-
export const _TypecheckGLBLoader: Writer = GLTFWriter;
|