@maptiler/sdk 3.4.1 → 3.5.0-rc1

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.
@@ -0,0 +1,49 @@
1
+ export type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;
2
+ /**
3
+ * Load a shader from a source string
4
+ */
5
+ export declare function loadShader({ gl, type, source }: {
6
+ gl: WebGLContext;
7
+ type: GLenum;
8
+ source: string;
9
+ }): WebGLShader;
10
+ /**
11
+ * Create a set of shaders (vertex and fragment) and link them into a program
12
+ *
13
+ * @param gl WebGL context
14
+ * @param vertexShaderSource Vertex shader source code
15
+ * @param fragmentShaderSource Fragment shader source code
16
+ *
17
+ * @returns WebGL program
18
+ */
19
+ export declare function createShadersSetProgram({ gl, vertexShaderSource, fragmentShaderSource }: {
20
+ gl: WebGLContext;
21
+ vertexShaderSource: string;
22
+ fragmentShaderSource: string;
23
+ }): WebGLProgram;
24
+ /**
25
+ * null-free version of getUniformLocation
26
+ */
27
+ export declare function getUniformLocation(gl: WebGLRenderingContext | WebGL2RenderingContext, program: WebGLProgram, name: string): WebGLUniformLocation;
28
+ export type Object3D<Attribute extends string, Uniform extends string> = {
29
+ shaderProgram: WebGLProgram;
30
+ programInfo: {
31
+ attributesLocations: Record<Attribute, number>;
32
+ uniformsLocations: Record<Uniform, WebGLUniformLocation>;
33
+ };
34
+ positionBuffer: WebGLBuffer;
35
+ indexBuffer?: WebGLBuffer;
36
+ indexBufferLength?: number;
37
+ };
38
+ export declare function createObject3D<Attribute extends string, Uniform extends string>({ gl, vertexShaderSource, fragmentShaderSource, attributesKeys, uniformsKeys, vertices, indices, }: {
39
+ gl: WebGLContext;
40
+ vertexShaderSource: string;
41
+ fragmentShaderSource: string;
42
+ attributesKeys: readonly Attribute[];
43
+ uniformsKeys: readonly Uniform[];
44
+ vertices: Array<number>;
45
+ indices?: Array<number>;
46
+ }): Object3D<Attribute, Uniform>;
47
+ export type Vec4 = [number, number, number, number];
48
+ export declare function parseColorStringToVec4(color?: string): Vec4;
49
+ export declare function degreesToRadians(degrees: number): number;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@maptiler/sdk",
3
- "version": "3.4.1",
3
+ "version": "3.5.0-rc1",
4
4
  "description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
5
5
  "author": "MapTiler",
6
6
  "module": "dist/maptiler-sdk.mjs",
7
7
  "types": "dist/maptiler-sdk.d.ts",
8
8
  "style": "dist/maptiler-sdk.css",
9
9
  "type": "module",
10
+ "main": "dist/maptiler-sdk.mjs",
10
11
  "exports": {
11
12
  ".": {
12
13
  "import": "./dist/maptiler-sdk.mjs",
@@ -54,9 +55,14 @@
54
55
  "lint-staged": {
55
56
  "*.ts": "npm run lint:fix"
56
57
  },
58
+ "ts-typecheck": {
59
+ "*.ts": "npm tsc --noEmit"
60
+ },
57
61
  "devDependencies": {
58
62
  "@canvas/image-data": "^1.0.0",
59
63
  "@eslint/js": "^9.21.0",
64
+ "@types/color-convert": "^2.0.4",
65
+ "@types/color-name": "^2.0.0",
60
66
  "@types/stats.js": "^0.17.4",
61
67
  "@types/uuid": "^10.0.0",
62
68
  "@types/xmldom": "^0.1.31",
@@ -83,6 +89,7 @@
83
89
  "@maplibre/maplibre-gl-style-spec": "~23.3.0",
84
90
  "@maptiler/client": "~2.3.2",
85
91
  "events": "^3.3.0",
92
+ "gl-matrix": "^3.4.3",
86
93
  "js-base64": "^3.7.7",
87
94
  "maplibre-gl": "~5.6.0",
88
95
  "uuid": "^11.0.5"