@gjsify/bridge-types 0.4.42 → 0.4.44
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 +33 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @gjsify/bridge-types
|
|
2
|
+
|
|
3
|
+
Shared interfaces and environment classes used by the gjsify GTK↔DOM bridge packages. Provides `DOMBridgeContainer` (the common interface for all bridges), `BridgeEnvironment` (an isolated per-bridge document, body, and window), and `BridgeWindow` (requestAnimationFrame, performance.now, and viewport dimensions delegated back to the owning GTK widget).
|
|
4
|
+
|
|
5
|
+
Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gjsify install @gjsify/bridge-types
|
|
11
|
+
|
|
12
|
+
# npm or yarn also work (e.g. adding it to an existing project):
|
|
13
|
+
npm install @gjsify/bridge-types
|
|
14
|
+
yarn add @gjsify/bridge-types
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { BridgeEnvironment, BridgeWindow } from '@gjsify/bridge-types';
|
|
21
|
+
import type { DOMBridgeContainer, BridgeWindowHost } from '@gjsify/bridge-types';
|
|
22
|
+
|
|
23
|
+
// Each bridge creates its own isolated environment so multiple bridges
|
|
24
|
+
// can coexist without polluting a shared global state.
|
|
25
|
+
const env = new BridgeEnvironment(host); // host implements BridgeWindowHost
|
|
26
|
+
const { document, window } = env;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This package is primarily consumed by `@gjsify/canvas2d`, `@gjsify/webgl`, `@gjsify/iframe`, and `@gjsify/video` — you rarely need to import it directly unless you are implementing a new bridge.
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/bridge-types",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "Shared interfaces and environment classes for GTK-DOM bridge containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@girs/gjs": "4.0.4",
|
|
33
33
|
"@girs/glib-2.0": "2.88.0-4.0.4",
|
|
34
34
|
"@girs/gtk-4.0": "4.23.0-4.0.4",
|
|
35
|
-
"@gjsify/dom-elements": "^0.4.
|
|
36
|
-
"@gjsify/dom-events": "^0.4.
|
|
35
|
+
"@gjsify/dom-elements": "^0.4.44",
|
|
36
|
+
"@gjsify/dom-events": "^0.4.44"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@gjsify/cli": "^0.4.
|
|
39
|
+
"@gjsify/cli": "^0.4.44",
|
|
40
40
|
"@types/node": "^25.9.1",
|
|
41
41
|
"typescript": "^6.0.3"
|
|
42
42
|
},
|