@maciejwojs/screen-capture 0.1.2 → 0.1.5

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,23 @@
1
+ export interface SharedHandleInfo {
2
+ handle: bigint;
3
+ width: number;
4
+ height: number;
5
+ stride: number;
6
+ offset: number;
7
+ planeSize: bigint;
8
+ pixelFormat: number;
9
+ modifier: bigint;
10
+ bufferType: number;
11
+ chunkSize: number;
12
+ }
13
+ export interface IScreenCapture {
14
+ start(): void;
15
+ stop(): void;
16
+ getSharedHandle(): SharedHandleInfo | null;
17
+ }
18
+ export interface INativeAddon {
19
+ ScreenCapture: new () => IScreenCapture;
20
+ }
21
+ declare const native: INativeAddon;
22
+ export declare const ScreenCapture: new () => IScreenCapture;
23
+ export default native;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import path from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import nodeGypBuild from 'node-gyp-build';
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = path.dirname(__filename);
6
+ const rootDir = path.resolve(__dirname, '..');
7
+ const native = nodeGypBuild(rootDir);
8
+ export const ScreenCapture = native.ScreenCapture;
9
+ export default native;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maciejwojs/screen-capture",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "Native screen capture addon for Node.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "scripts": {
39
39
  "build": "bun x tsc",
40
+ "prepublishOnly": "bun run build",
40
41
  "rebuild": "node-gyp rebuild",
41
42
  "prebuildify": "bun run build && bun x prebuildify --napi --strip --node-gyp node-gyp",
42
43
  "prebuildify:all": "bun run prebuildify --platform win32 --platform linux --platform darwin",
@@ -256,7 +256,7 @@ class LinuxPlatformCapture final : public IPlatformCapture {
256
256
  g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
257
257
  g_variant_builder_add(&builder, "{sv}", "types", g_variant_new_uint32(1));
258
258
  g_variant_builder_add(&builder, "{sv}", "multiple", g_variant_new_boolean(FALSE));
259
- g_variant_builder_add(&builder, "{sv}", "cursor_mode", g_variant_new_uint32(2));
259
+ g_variant_builder_add(&builder, "{sv}", "cursor_mode", g_variant_new_uint32(1));
260
260
 
261
261
  m_stage = PortalStage::SelectingSources;
262
262
  CallPortalMethod("SelectSources", g_variant_new("(oa{sv})", m_sessionHandle.c_str(), &builder));