@thi.ng/webgl 6.8.11 → 6.8.13

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-11T12:32:44Z
3
+ - **Last updated**: 2024-04-23T07:02:19Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [6.8.12](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.8.12) (2024-04-20)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update type usage ([f584c7c](https://github.com/thi-ng/umbrella/commit/f584c7c))
17
+
12
18
  ## [6.8.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/webgl@6.8.0) (2024-03-09)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -95,12 +95,12 @@ import * as gl from "@thi.ng/webgl";
95
95
  Browser ESM import:
96
96
 
97
97
  ```html
98
- <script type="module" src="https://cdn.skypack.dev/@thi.ng/webgl"></script>
98
+ <script type="module" src="https://esm.run/@thi.ng/webgl"></script>
99
99
  ```
100
100
 
101
- [Skypack documentation](https://docs.skypack.dev/)
101
+ [JSDelivr documentation](https://www.jsdelivr.com/)
102
102
 
103
- Package sizes (brotli'd, pre-treeshake): ESM: 11.65 KB
103
+ Package sizes (brotli'd, pre-treeshake): ESM: 11.66 KB
104
104
 
105
105
  ## Dependencies
106
106
 
package/api/shader.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Fn, Fn2, Fn3, Fn4, IBind, IDeref, IObjectOf, IRelease, NumericArray } from "@thi.ng/api";
1
+ import type { Fn, Fn2, Fn3, Fn4, IBind, IDeref, IObjectOf, IRelease, Nullable, NumericArray } from "@thi.ng/api";
2
2
  import type { ILogger } from "@thi.ng/logger";
3
3
  import type { Func, Sym } from "@thi.ng/shader-ast";
4
4
  import type { GLSLTarget } from "@thi.ng/shader-ast-glsl";
@@ -50,7 +50,7 @@ export type ShaderOutputSpec = GLSL | [GLSL, number];
50
50
  export interface ShaderUniform {
51
51
  type: GLSL;
52
52
  loc: WebGLUniformLocation;
53
- setter: Fn<UniformValue | undefined | null, void>;
53
+ setter: Fn<Nullable<UniformValue>, void>;
54
54
  defaultFn?: (shaderUnis: any, specUnis: any) => UniformValue;
55
55
  defaultVal?: UniformValue;
56
56
  }
package/buffer.d.ts CHANGED
@@ -24,9 +24,9 @@ export declare class WebGLArrayBuffer<T extends TypedArray> implements IWebGLBuf
24
24
  set(data: T, mode?: number): void;
25
25
  setChunk(data: T, byteOffset?: number): void;
26
26
  }
27
- export declare const defBuffer: (gl: WebGLRenderingContext, data?: TypedArray, target?: GLenum, mode?: GLenum, retain?: boolean) => WebGLArrayBuffer<Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array>;
27
+ export declare const defBuffer: (gl: WebGLRenderingContext, data?: TypedArray, target?: GLenum, mode?: GLenum, retain?: boolean) => WebGLArrayBuffer<Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array>;
28
28
  export declare const compileModel: (gl: WebGLRenderingContext, spec: ModelSpec, mode?: 35044) => ModelSpec;
29
- export declare const compileIndices: (gl: WebGLRenderingContext, index: IndexBufferSpec | undefined, mode?: GLenum) => IndexBufferSpec | undefined;
29
+ export declare const compileIndices: (gl: WebGLRenderingContext, index?: IndexBufferSpec, mode?: GLenum) => IndexBufferSpec | undefined;
30
30
  export declare const compileVAO: (gl: WebGLRenderingContext, spec: ModelSpec) => WebGLVertexArrayObject | undefined;
31
31
  export declare const compileAttribPool: (gl: WebGLRenderingContext, pool: AttribPool, ids?: string[], target?: GLenum, mode?: GLenum) => ModelAttributeSpecs;
32
32
  //# sourceMappingURL=buffer.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/webgl",
3
- "version": "6.8.11",
3
+ "version": "6.8.13",
4
4
  "description": "WebGL & GLSL abstraction layer",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -31,7 +31,7 @@
31
31
  "build": "yarn build:esbuild && yarn build:decl",
32
32
  "build:decl": "tsc --declaration --emitDeclarationOnly",
33
33
  "build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
34
- "clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc api geo shaders textures",
34
+ "clean": "bun ../../tools/src/clean-package.ts geo shaders textures",
35
35
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
36
36
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
37
37
  "doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
@@ -40,27 +40,26 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.10.1",
44
- "@thi.ng/associative": "^6.3.56",
45
- "@thi.ng/canvas": "^0.2.16",
46
- "@thi.ng/checks": "^3.6.1",
47
- "@thi.ng/equiv": "^2.1.55",
48
- "@thi.ng/errors": "^2.5.4",
49
- "@thi.ng/logger": "^3.0.9",
50
- "@thi.ng/matrices": "^2.3.33",
51
- "@thi.ng/memoize": "^3.3.1",
52
- "@thi.ng/pixel": "^6.1.28",
53
- "@thi.ng/shader-ast": "^0.15.11",
54
- "@thi.ng/shader-ast-glsl": "^0.4.119",
55
- "@thi.ng/shader-ast-stdlib": "^0.18.11",
56
- "@thi.ng/transducers": "^9.0.1",
57
- "@thi.ng/vector-pools": "^3.1.125",
58
- "@thi.ng/vectors": "^7.10.27"
43
+ "@thi.ng/api": "^8.11.1",
44
+ "@thi.ng/associative": "^6.3.58",
45
+ "@thi.ng/canvas": "^0.2.18",
46
+ "@thi.ng/checks": "^3.6.3",
47
+ "@thi.ng/equiv": "^2.1.57",
48
+ "@thi.ng/errors": "^2.5.6",
49
+ "@thi.ng/logger": "^3.0.11",
50
+ "@thi.ng/matrices": "^2.3.35",
51
+ "@thi.ng/memoize": "^3.3.3",
52
+ "@thi.ng/pixel": "^6.1.30",
53
+ "@thi.ng/shader-ast": "^0.15.13",
54
+ "@thi.ng/shader-ast-glsl": "^0.4.121",
55
+ "@thi.ng/shader-ast-stdlib": "^0.18.13",
56
+ "@thi.ng/transducers": "^9.0.3",
57
+ "@thi.ng/vector-pools": "^3.1.127",
58
+ "@thi.ng/vectors": "^7.10.29"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@microsoft/api-extractor": "^7.43.0",
62
62
  "esbuild": "^0.20.2",
63
- "rimraf": "^5.0.5",
64
63
  "typedoc": "^0.25.12",
65
64
  "typescript": "^5.4.3"
66
65
  },
@@ -221,5 +220,5 @@
221
220
  ],
222
221
  "year": 2014
223
222
  },
224
- "gitHead": "18a0c063a7b33d790e5bc2486c106f45f663ac28\n"
223
+ "gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
225
224
  }
package/readpixels.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { UIntArray } from "@thi.ng/api";
2
2
  import type { ITexture, ReadableTextureFormat, TextureType } from "./api/texture.js";
3
3
  export declare const readPixels: <T extends Float32Array | UIntArray>(gl: WebGLRenderingContext, x: number, y: number, w: number, h: number, format: ReadableTextureFormat, type: TextureType, out: T) => T;
4
- export declare const readTexture: <T extends Uint8Array | Uint16Array | Uint32Array | Float32Array>(gl: WebGLRenderingContext, tex: ITexture, format: ReadableTextureFormat, type: TextureType, out: T) => T;
4
+ export declare const readTexture: <T extends Float32Array | Uint8Array | Uint16Array | Uint32Array>(gl: WebGLRenderingContext, tex: ITexture, format: ReadableTextureFormat, type: TextureType, out: T) => T;
5
5
  //# sourceMappingURL=readpixels.d.ts.map
package/shader.js CHANGED
@@ -170,7 +170,7 @@ const defShader = (gl, spec, opts) => {
170
170
  const logger = opts?.logger || LOGGER;
171
171
  logger.debug(srcVS);
172
172
  logger.debug(srcFS);
173
- initShaderExtensions(gl, spec.ext);
173
+ spec.ext && initShaderExtensions(gl, spec.ext);
174
174
  const vs = compileShader(gl, gl.VERTEX_SHADER, srcVS);
175
175
  const fs = compileShader(gl, gl.FRAGMENT_SHADER, srcFS);
176
176
  const program2 = gl.createProgram() || error("error creating shader program");
@@ -203,12 +203,10 @@ const compileExtensionPragma = (id, behavior, version) => {
203
203
  ` : "";
204
204
  };
205
205
  const initShaderExtensions = (gl, exts) => {
206
- if (exts) {
207
- for (let id in exts) {
208
- const state = exts[id];
209
- if (state === true || state === "require") {
210
- getExtensions(gl, [id], state === "require");
211
- }
206
+ for (let id in exts) {
207
+ const state = exts[id];
208
+ if (state === true || state === "require") {
209
+ getExtensions(gl, [id], state === "require");
212
210
  }
213
211
  }
214
212
  };
package/texture.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Nullable } from "@thi.ng/api";
1
2
  import { TextureFilter, TextureFormat, TextureRepeat, TextureTarget, TextureType, type ITexture, type TextureOpts } from "./api/texture.js";
2
3
  export declare const bindTextures: (textures?: ITexture[]) => void;
3
4
  export declare const unbindTextures: (textures?: ITexture[]) => void;
@@ -59,5 +60,5 @@ export declare const defTextureCubeMap: (gl: WebGLRenderingContext, faces: (Arra
59
60
  * @param format -
60
61
  * @param type -
61
62
  */
62
- export declare const defTextureFloat: (gl: WebGLRenderingContext, data: Float32Array | undefined | null, width: number, height: number, format?: TextureFormat, type?: TextureType) => Texture;
63
+ export declare const defTextureFloat: (gl: WebGLRenderingContext, data: Nullable<Float32Array>, width: number, height: number, format?: TextureFormat, type?: TextureType) => Texture;
63
64
  //# sourceMappingURL=texture.d.ts.map
package/uniforms.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Fn, Fn3, IObjectOf } from "@thi.ng/api";
1
+ import type { Fn, Fn3, IObjectOf, Maybe, Nullable } from "@thi.ng/api";
2
2
  import { type ReadonlyVec } from "@thi.ng/vectors/api";
3
3
  import type { UniformValue } from "./api/shader.js";
4
- export declare const UNIFORM_SETTERS: IObjectOf<Fn3<WebGLRenderingContext, WebGLUniformLocation, number | ReadonlyVec | undefined, Fn<UniformValue | undefined | null, void>>>;
4
+ export declare const UNIFORM_SETTERS: IObjectOf<Fn3<WebGLRenderingContext, WebGLUniformLocation, Maybe<number | ReadonlyVec>, Fn<Nullable<UniformValue>, void>>>;
5
5
  //# sourceMappingURL=uniforms.d.ts.map