@girs/cogl-15 4.2.0 → 4.4.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/README.md +8 -8
- package/cogl-15.d.ts +10 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Cogl-15 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.
|
|
8
|
+
GJS TypeScript type definitions for Cogl-15 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Install the type definitions with npm:
|
|
13
13
|
```bash
|
|
14
14
|
npm install @girs/cogl-15
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Import it like any other module:
|
|
20
20
|
```ts
|
|
21
21
|
import Cogl from '@girs/cogl-15';
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Ambient Modules
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
[Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
|
|
27
27
|
For this you need to include `@girs/cogl-15` or `@girs/cogl-15/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
28
|
|
|
29
29
|
`index.ts`:
|
|
@@ -42,7 +42,7 @@ import '@girs/cogl-15'
|
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The ambient module now resolves with types:
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
import Cogl from 'gi://Cogl?version=15';
|
|
@@ -50,7 +50,7 @@ import Cogl from 'gi://Cogl?version=15';
|
|
|
50
50
|
|
|
51
51
|
### Global import
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
GJS's global `imports.gi` works too, with types.
|
|
54
54
|
For this you need to include `@girs/cogl-15` or `@girs/cogl-15/import` in your `tsconfig` or entry point Typescript file:
|
|
55
55
|
|
|
56
56
|
`index.ts`:
|
|
@@ -69,7 +69,7 @@ import '@girs/cogl-15'
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
That form carries types as well:
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
const Cogl = imports.gi.Cogl;
|
|
@@ -77,7 +77,7 @@ const Cogl = imports.gi.Cogl;
|
|
|
77
77
|
|
|
78
78
|
### Bundle
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
|
|
81
81
|
|
|
82
82
|
## Other packages
|
|
83
83
|
|
package/cogl-15.d.ts
CHANGED
|
@@ -5004,6 +5004,7 @@ export namespace Cogl {
|
|
|
5004
5004
|
* `main()` function. It is allowed to use a program with only a vertex
|
|
5005
5005
|
* shader or only a fragment shader.
|
|
5006
5006
|
* @param shader a {@link Cogl.Shader} for a vertex of fragment shader.
|
|
5007
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api
|
|
5007
5008
|
*/
|
|
5008
5009
|
attach_shader(shader: Shader): void;
|
|
5009
5010
|
|
|
@@ -5013,6 +5014,7 @@ export namespace Cogl {
|
|
|
5013
5014
|
* shader object and is possible to modify as an external parameter.
|
|
5014
5015
|
* @param uniform_name the name of a uniform.
|
|
5015
5016
|
* @returns the offset of a uniform in a specified program.
|
|
5017
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5016
5018
|
*/
|
|
5017
5019
|
get_uniform_location(uniform_name: string): number;
|
|
5018
5020
|
|
|
@@ -5020,6 +5022,7 @@ export namespace Cogl {
|
|
|
5020
5022
|
* Links a program making it ready for use. Note that calling this
|
|
5021
5023
|
* function is optional. If it is not called the program will
|
|
5022
5024
|
* automatically be linked the first time it is used.
|
|
5025
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api
|
|
5023
5026
|
*/
|
|
5024
5027
|
link(): void;
|
|
5025
5028
|
|
|
@@ -5028,6 +5031,7 @@ export namespace Cogl {
|
|
|
5028
5031
|
* `program`.
|
|
5029
5032
|
* @param uniform_location the uniform location retrieved from {@link Program.get_uniform_location}.
|
|
5030
5033
|
* @param value the new value of the uniform.
|
|
5034
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5031
5035
|
*/
|
|
5032
5036
|
set_uniform_1f(uniform_location: number, value: number): void;
|
|
5033
5037
|
|
|
@@ -5036,6 +5040,7 @@ export namespace Cogl {
|
|
|
5036
5040
|
* `program`.
|
|
5037
5041
|
* @param uniform_location the uniform location retrieved from {@link Program.get_uniform_location}.
|
|
5038
5042
|
* @param value the new value of the uniform.
|
|
5043
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5039
5044
|
*/
|
|
5040
5045
|
set_uniform_1i(uniform_location: number, value: number): void;
|
|
5041
5046
|
|
|
@@ -5045,6 +5050,7 @@ export namespace Cogl {
|
|
|
5045
5050
|
* @param uniform_location the uniform location retrieved from {@link Program.get_uniform_location}.
|
|
5046
5051
|
* @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
|
|
5047
5052
|
* @param value the new value of the uniform[s].
|
|
5053
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5048
5054
|
*/
|
|
5049
5055
|
set_uniform_float(uniform_location: number, n_components: number, value: number[]): void;
|
|
5050
5056
|
|
|
@@ -5054,6 +5060,7 @@ export namespace Cogl {
|
|
|
5054
5060
|
* @param uniform_location the uniform location retrieved from {@link Program.get_uniform_location}.
|
|
5055
5061
|
* @param n_components The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4.
|
|
5056
5062
|
* @param value the new value of the uniform[s].
|
|
5063
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5057
5064
|
*/
|
|
5058
5065
|
set_uniform_int(uniform_location: number, n_components: number, value: number[]): void;
|
|
5059
5066
|
|
|
@@ -5064,6 +5071,7 @@ export namespace Cogl {
|
|
|
5064
5071
|
* @param dimensions The dimensions of the matrix. So for for example pass 2 for a 2x2 matrix or 3 for 3x3.
|
|
5065
5072
|
* @param transpose Whether to transpose the matrix when setting the uniform.
|
|
5066
5073
|
* @param value the new value of the uniform.
|
|
5074
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api instead
|
|
5067
5075
|
*/
|
|
5068
5076
|
set_uniform_matrix(uniform_location: number, dimensions: number, transpose: boolean, value: number[]): void;
|
|
5069
5077
|
}
|
|
@@ -5418,6 +5426,7 @@ export namespace Cogl {
|
|
|
5418
5426
|
/**
|
|
5419
5427
|
* Retrieves the type of a shader
|
|
5420
5428
|
* @returns {@link Cogl.ShaderType.VERTEX} if the shader is a vertex processor or {@link Cogl.ShaderType.FRAGMENT} if the shader is a fragment processor
|
|
5429
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api
|
|
5421
5430
|
*/
|
|
5422
5431
|
get_shader_type(): ShaderType;
|
|
5423
5432
|
|
|
@@ -5425,6 +5434,7 @@ export namespace Cogl {
|
|
|
5425
5434
|
* Replaces the current source associated with a shader with a new
|
|
5426
5435
|
* one.
|
|
5427
5436
|
* @param source Shader source.
|
|
5437
|
+
* @deprecated since 1.16: Use {@link Cogl.Snippet} api
|
|
5428
5438
|
*/
|
|
5429
5439
|
source(source: string): void;
|
|
5430
5440
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/cogl-15",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Cogl-15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "cogl-15.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "^4.
|
|
35
|
-
"@girs/xlib-2.0": "^4.
|
|
36
|
-
"@girs/mtk-15": "^4.
|
|
37
|
-
"@girs/graphene-1.0": "^4.
|
|
38
|
-
"@girs/gobject-2.0": "^4.
|
|
39
|
-
"@girs/glib-2.0": "^4.
|
|
40
|
-
"@girs/gl-1.0": "^4.
|
|
34
|
+
"@girs/gjs": "^4.4.0",
|
|
35
|
+
"@girs/xlib-2.0": "^4.4.0",
|
|
36
|
+
"@girs/mtk-15": "^4.4.0",
|
|
37
|
+
"@girs/graphene-1.0": "^4.4.0",
|
|
38
|
+
"@girs/gobject-2.0": "^4.4.0",
|
|
39
|
+
"@girs/glib-2.0": "^4.4.0",
|
|
40
|
+
"@girs/gl-1.0": "^4.4.0" },
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "*"
|
|
43
43
|
},
|