@maciejwojs/screen-capture 0.1.0 → 0.1.2

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 CHANGED
File without changes
package/binding.gyp CHANGED
File without changes
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@maciejwojs/screen-capture",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Native screen capture addon for Node.js",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/maciejwojs/screen-capture.git"
8
+ "url": "https://github.com/MaciejWojs/screen-capture.git"
9
9
  },
10
10
  "keywords": [
11
11
  "screen-capture",
@@ -38,11 +38,10 @@
38
38
  "scripts": {
39
39
  "build": "bun x tsc",
40
40
  "rebuild": "node-gyp rebuild",
41
- "prebuildify": "bun run build && prebuildify --napi --strip --node-gyp \"bun x --silent node-gyp\"",
42
- "prebuildify:all": "bun run build && prebuildify --napi --strip --node-gyp \"bun x --silent node-gyp\" --platform win32 --platform linux --platform darwin",
41
+ "prebuildify": "bun run build && bun x prebuildify --napi --strip --node-gyp node-gyp",
42
+ "prebuildify:all": "bun run prebuildify --platform win32 --platform linux --platform darwin",
43
43
  "test:load": "bun run build && node -e \"import('./dist/index.js').then(() => console.log('addon loaded'))\"",
44
- "install": "node-gyp-build",
45
- "prepack": "bun run build"
44
+ "install": "node-gyp-build"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@types/bun": "latest",
package/src/addon.cpp CHANGED
File without changes
File without changes
File without changes
@@ -1,24 +1,24 @@
1
- #ifndef _WIN32
2
-
3
- #include "platform_capture.hpp"
4
-
5
- #include <stdexcept>
6
-
7
- class StubPlatformCapture final : public IPlatformCapture {
8
- public:
9
- void Start(Napi::Env) override {
10
- throw std::runtime_error("Screen capture backend is not implemented for this platform yet");
11
- }
12
-
13
- void Stop() override {}
14
-
15
- std::optional<SharedHandleInfo> GetSharedHandle() const override {
16
- return std::nullopt;
17
- }
18
- };
19
-
20
- std::unique_ptr<IPlatformCapture> CreatePlatformCapture() {
21
- return std::make_unique<StubPlatformCapture>();
22
- }
23
-
24
- #endif
1
+ #ifndef _WIN32
2
+
3
+ #include "platform_capture.hpp"
4
+
5
+ #include <stdexcept>
6
+
7
+ class StubPlatformCapture final : public IPlatformCapture {
8
+ public:
9
+ void Start(Napi::Env) override {
10
+ throw std::runtime_error("Screen capture backend is not implemented for this platform yet");
11
+ }
12
+
13
+ void Stop() override {}
14
+
15
+ std::optional<SharedHandleInfo> GetSharedHandle() const override {
16
+ return std::nullopt;
17
+ }
18
+ };
19
+
20
+ std::unique_ptr<IPlatformCapture> CreatePlatformCapture() {
21
+ return std::make_unique<StubPlatformCapture>();
22
+ }
23
+
24
+ #endif
package/src/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module 'node-gyp-build' {
2
- function nodeGypBuild(path: string): any;
3
- export default nodeGypBuild;
4
- }
1
+ declare module 'node-gyp-build' {
2
+ function nodeGypBuild(path: string): any;
3
+ export default nodeGypBuild;
4
+ }
File without changes
package/dist/index.d.ts DELETED
@@ -1,23 +0,0 @@
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 DELETED
@@ -1,9 +0,0 @@
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;