@nativedesktop/react 0.1.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.
Files changed (35) hide show
  1. package/dist/generated/rpc.js +13 -0
  2. package/dist/index.js +2089 -0
  3. package/dist/jsx-dev-runtime.js +6 -0
  4. package/dist/jsx-runtime.js +20 -0
  5. package/dist/packages/react/src/css-classes-validate.d.ts +3 -0
  6. package/dist/packages/react/src/dev-react.d.ts +23 -0
  7. package/dist/packages/react/src/dialogs.d.ts +54 -0
  8. package/dist/packages/react/src/errors.d.ts +55 -0
  9. package/dist/packages/react/src/generated/intrinsics.d.ts +1360 -0
  10. package/dist/packages/react/src/generated/protocol.d.ts +140 -0
  11. package/dist/packages/react/src/generated/rpc.d.ts +299 -0
  12. package/dist/packages/react/src/generated/schema-meta.d.ts +29 -0
  13. package/dist/packages/react/src/generated/widget-types.d.ts +2 -0
  14. package/dist/packages/react/src/hmr.d.ts +53 -0
  15. package/dist/packages/react/src/hooks.d.ts +4 -0
  16. package/dist/packages/react/src/host-config.d.ts +72 -0
  17. package/dist/packages/react/src/ids.d.ts +4 -0
  18. package/dist/packages/react/src/index.d.ts +26 -0
  19. package/dist/packages/react/src/jsx-dev-runtime.d.ts +2 -0
  20. package/dist/packages/react/src/jsx-runtime.d.ts +2 -0
  21. package/dist/packages/react/src/metrics.d.ts +12 -0
  22. package/dist/packages/react/src/native-component.d.ts +23 -0
  23. package/dist/packages/react/src/ops.d.ts +20 -0
  24. package/dist/packages/react/src/paths.d.ts +4 -0
  25. package/dist/packages/react/src/platform.d.ts +45 -0
  26. package/dist/packages/react/src/renderer.d.ts +12 -0
  27. package/dist/packages/react/src/shell.d.ts +6 -0
  28. package/dist/packages/react/src/store.d.ts +61 -0
  29. package/dist/packages/react/src/style-validate.d.ts +3 -0
  30. package/dist/packages/react/src/system.d.ts +166 -0
  31. package/dist/packages/react/src/toast.d.ts +19 -0
  32. package/dist/packages/react/src/webview.d.ts +5 -0
  33. package/dist/runtime/ndp-binary.d.ts +42 -0
  34. package/dist/runtime/ndp.d.ts +38 -0
  35. package/package.json +56 -0
@@ -0,0 +1,23 @@
1
+ import type { JSX, NdNodeRef } from "./generated/intrinsics.ts";
2
+ export interface NativeComponentOptions {
3
+ /** Factory key registered by the app's platform-native library. */
4
+ viewKind: string;
5
+ }
6
+ type NativeViewHostProps = Omit<JSX.IntrinsicElements["nativeview"], "viewKind" | "props" | "onNativeEvent" | "ref" | "children">;
7
+ export interface NativeComponentProps<Props, Event = unknown> extends NativeViewHostProps {
8
+ props: Props;
9
+ onNativeEvent?: (event: {
10
+ name: string;
11
+ data: Event;
12
+ }) => void;
13
+ }
14
+ export interface NativeComponentRef<Command = unknown> extends NdNodeRef<"nativeview"> {
15
+ send(command: string, arg?: Command): void;
16
+ }
17
+ /**
18
+ * Defines a typed React component backed by an app-owned GTK/AppKit native view.
19
+ * Props cross the stable NativeView ABI as JSON; events and commands use the
20
+ * generic channel, so app components never require edits to widgets.json.
21
+ */
22
+ export declare function defineNativeComponent<Props extends object, Event = unknown, Command = unknown>(options: NativeComponentOptions): import("react").ForwardRefExoticComponent<NativeComponentProps<Props, Event> & import("react").RefAttributes<NativeComponentRef<Command>>>;
23
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { Op } from "../../../runtime/ndp.ts";
2
+ export declare class Batch {
3
+ private ops;
4
+ push(op: Op): void;
5
+ drain(): Op[];
6
+ get length(): number;
7
+ }
8
+ export type Handler = (payload?: unknown) => void;
9
+ export interface NodeRecord {
10
+ id: number;
11
+ type: string;
12
+ props: Record<string, unknown>;
13
+ handlers: Record<string, Handler>;
14
+ }
15
+ export declare class NodeRegistry {
16
+ private byId;
17
+ register(rec: NodeRecord): void;
18
+ get(id: number): NodeRecord | undefined;
19
+ unregister(id: number): void;
20
+ }
@@ -0,0 +1,4 @@
1
+ /** The per-platform user-data directory for this app. Does not create it. */
2
+ export declare function getAppDataDir(): string;
3
+ /** Like `getAppDataDir`, but also creates the directory (recursively) if missing. */
4
+ export declare function ensureAppDataDir(): string;
@@ -0,0 +1,45 @@
1
+ export type Backend = "gtk" | "appkit" | "unknown";
2
+ export type OS = "macos" | "linux" | "windows";
3
+ interface PlatformState {
4
+ backend: Backend;
5
+ hostWidgets: Set<string> | null;
6
+ hostCommands: Set<string> | null;
7
+ }
8
+ declare global {
9
+ var __nd_platform: PlatformState | undefined;
10
+ }
11
+ /** Package-internal (metrics.ts): runs `cb` once the backend is known —
12
+ * immediately when it already is. */
13
+ export declare function onBackendKnown(cb: () => void): void;
14
+ /** Renderer-internal: called once from `render()` after the handshake. */
15
+ export declare function setBackend(name: string): void;
16
+ /** Renderer-internal: called once from `render()` beside `setBackend`. */
17
+ export declare function setHostManifest(widgets: Set<string> | null, commands: Set<string> | null): void;
18
+ /**
19
+ * True when the connected host build knows the intrinsic (e.g.
20
+ * `hasWidget("sourcetree")`). Answers from the host's handshake manifest;
21
+ * against an older host that doesn't send one, falls back to this runtime's
22
+ * own schema table (i.e. "the JS side knows it").
23
+ */
24
+ export declare function hasWidget(type: string): boolean;
25
+ /**
26
+ * True when the connected host build dispatches `command` on `type` (e.g.
27
+ * `hasCommand("window", "present")`). Same manifest-with-fallback semantics
28
+ * as `hasWidget`. Replaces try/catch around `sendCommand` for feature
29
+ * detection.
30
+ */
31
+ export declare function hasCommand(type: string, command: string): boolean;
32
+ export declare const Platform: {
33
+ /** The native widget backend drawing this app: "gtk" | "appkit". */
34
+ readonly backend: Backend;
35
+ /** The OS this app is running on. */
36
+ readonly os: OS;
37
+ /**
38
+ * Pick a value by the active backend, like React Native's `Platform.select`.
39
+ * Returns `default` when the active backend has no matching entry.
40
+ */
41
+ select<T>(spec: Partial<Record<Backend, T>> & {
42
+ default?: T;
43
+ }): T | undefined;
44
+ };
45
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ReactNode, ReactPortal } from "react";
2
+ import type { NdNodeRef, WidgetType } from "./generated/intrinsics.ts";
3
+ import { type WidgetCommandNames } from "./generated/schema-meta.ts";
4
+ export declare function render(element: ReactNode): Promise<void>;
5
+ export declare function sendCommand<T extends keyof WidgetCommandNames & WidgetType>(node: NdNodeRef<T>, command: WidgetCommandNames[T], arg?: unknown): void;
6
+ export declare function sendNativeCommand(node: NdNodeRef<"nativeview">, command: string, arg?: unknown): void;
7
+ export interface Pool {
8
+ readonly rootId: null;
9
+ }
10
+ export declare function createPool(): Pool;
11
+ export declare function createPortal(children: ReactNode, pool?: Pool): ReactPortal;
12
+ export declare function moveNode(node: NdNodeRef, toParent: NdNodeRef, before?: NdNodeRef | null): void;
@@ -0,0 +1,6 @@
1
+ /** Opens `url` in the OS default browser/handler (`open` on macOS, `xdg-open` on Linux). */
2
+ export declare function openExternal(url: string): Promise<void>;
3
+ /** Opens `path` with its OS-registered default application. */
4
+ export declare function openPath(path: string): Promise<void>;
5
+ /** Reveals `path` in the OS file manager, selecting it if the file manager supports that. On Linux, tries the freedesktop FileManager1 DBus interface first (selects the file) and falls back to opening its containing directory if that fails (e.g. no DBus session or no file manager registered on it). */
6
+ export declare function revealPath(path: string): Promise<void>;
@@ -0,0 +1,61 @@
1
+ export interface StoreOptions<T> {
2
+ /** File is `${name}.json` under `dir` (default: getAppDataDir()). */
3
+ name: string;
4
+ version: number;
5
+ defaults: T;
6
+ /** Validate AND upgrade in one hook. Called on EVERY load, including a
7
+ * current-version file (type guards and sanitizing live here, not in a
8
+ * second option). Return null to reject the file and start from defaults. */
9
+ migrate?: (raw: unknown, fromVersion: number) => T | null;
10
+ /** Override for tests / env vars. */
11
+ dir?: string;
12
+ /** Default 250. */
13
+ debounceMs?: number;
14
+ }
15
+ export interface Store<T> {
16
+ readonly name: string;
17
+ readonly path: string;
18
+ /** Idempotent; repeat calls return the same promise. */
19
+ load(): Promise<T>;
20
+ /** Synchronous after load() resolves; throws a named error before that. */
21
+ get(): T;
22
+ set(next: T): void;
23
+ update(fn: (prev: T) => T): void;
24
+ subscribe(cb: (value: T) => void): () => void;
25
+ /** Awaits the pending debounced write plus every queued one. */
26
+ flush(): Promise<void>;
27
+ /** Set when a corrupt/unmigratable file was backed up and reset. */
28
+ readonly loadError: Error | undefined;
29
+ }
30
+ declare class StoreImpl<T> implements Store<T> {
31
+ #private;
32
+ readonly name: string;
33
+ readonly path: string;
34
+ readonly corruptPath: string;
35
+ loadError: Error | undefined;
36
+ constructor(options: StoreOptions<T>, path: string);
37
+ load(): Promise<T>;
38
+ get(): T;
39
+ set(next: T): void;
40
+ update(fn: (prev: T) => T): void;
41
+ subscribe(cb: (value: T) => void): () => void;
42
+ flush(): Promise<void>;
43
+ /** Exit-path flush: synchronous, no allocation of new timers, safe inside
44
+ * a signal handler or the "exit" event. */
45
+ writeSyncPending(): void;
46
+ }
47
+ interface StoreRegistry {
48
+ stores: Map<string, StoreImpl<unknown>>;
49
+ exitHooked: boolean;
50
+ }
51
+ declare global {
52
+ var __nd_stores: StoreRegistry | undefined;
53
+ }
54
+ /** Deduped by resolved file path: the same name+dir always returns the same
55
+ * instance (a `dir` override in tests is a distinct instance). */
56
+ export declare function createStore<T>(options: StoreOptions<T>): Store<T>;
57
+ /** Subscribes a component to the store (or a selection of it). The selected
58
+ * snapshot is cached per store value, so `select` may return a fresh object
59
+ * without re-render loops, but it must be pure. */
60
+ export declare function useStoreValue<T, S = T>(store: Store<T>, select?: (value: T) => S): S;
61
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare class StyleError extends Error {
2
+ }
3
+ export declare function validateStyle(style: unknown): void;
@@ -0,0 +1,166 @@
1
+ type SystemEventHandler = (data: unknown) => void;
2
+ declare global {
3
+ var __nd_system_events: Map<string, Set<SystemEventHandler>> | undefined;
4
+ var __nd_notification_data: Map<string, unknown> | undefined;
5
+ var __nd_app_active: boolean | undefined;
6
+ }
7
+ /** Wired up by renderer.ts from `ndp.onSystemEvent()` — not part of the public API. */
8
+ export declare function dispatchSystemEvent(channel: string, data: unknown): void;
9
+ /** A native file-picker filter, e.g. `{ name: "Images", extensions: ["png", "jpg"] }`. */
10
+ export interface FileFilter {
11
+ name: string;
12
+ extensions: string[];
13
+ }
14
+ export interface OpenFileOptions {
15
+ title?: string;
16
+ defaultPath?: string;
17
+ filters?: FileFilter[];
18
+ multiple?: boolean;
19
+ directories?: boolean;
20
+ }
21
+ export interface SaveFileOptions {
22
+ title?: string;
23
+ defaultPath?: string;
24
+ defaultName?: string;
25
+ filters?: FileFilter[];
26
+ }
27
+ export type MessageLevel = "info" | "warning" | "error";
28
+ export interface MessageOptions {
29
+ message: string;
30
+ detail?: string;
31
+ level?: MessageLevel;
32
+ buttons?: string[];
33
+ defaultButton?: number;
34
+ }
35
+ export interface NotificationOptions {
36
+ title: string;
37
+ body?: string;
38
+ /**
39
+ * App payload echoed on the matching `onClick` event. Held in a
40
+ * process-local map (never sent to the host), so it survives `bun --hot`
41
+ * re-evals but NOT an app restart — a click arriving after a restart is
42
+ * dropped by the transport today anyway (no host-side buffering), so the
43
+ * same-session limit costs nothing extra.
44
+ */
45
+ data?: unknown;
46
+ }
47
+ /** Native file/message dialogs. Default-granted (no ACL manifest entry needed). */
48
+ export declare const dialog: {
49
+ /** Opens a native "choose file(s)" dialog. Resolves to the chosen paths, or `[]` if the user cancels. */
50
+ openFile(options?: OpenFileOptions): Promise<string[]>;
51
+ /** Opens a native "save file" dialog. Resolves to the chosen path, or `null` if the user cancels. */
52
+ saveFile(options?: SaveFileOptions): Promise<string | null>;
53
+ /** Shows a native modal alert. Resolves to the 0-based index of the button the user clicked. */
54
+ showMessage(options: MessageOptions): Promise<number>;
55
+ };
56
+ export declare const clipboard: {
57
+ /** Reads text from the system clipboard. Default-denied — needs `core:clipboard.readText` in ND_ACL_GRANTS, or rejects with "capability denied". */
58
+ readText(): Promise<string>;
59
+ /** Writes text to the system clipboard. Default-granted. */
60
+ writeText(text: string): Promise<void>;
61
+ /** Reads the clipboard's image, written to a host-local temp PNG. Default-denied — needs `core:clipboard.read.image`. Rejects when the clipboard holds no image. */
62
+ readImage(): Promise<{
63
+ path: string;
64
+ width: number;
65
+ height: number;
66
+ bytes: number;
67
+ }>;
68
+ };
69
+ export declare const notifications: {
70
+ /** Shows a native OS notification. Resolves to the notification's id (correlates a later `notification.click` event). Default-granted. */
71
+ show(options: NotificationOptions): Promise<string>;
72
+ /** Subscribes to notification-click events; `e.data` is the payload passed to `show()`, same-session only. Returns an unsubscribe function, usable directly as a `useEffect` cleanup. */
73
+ onClick(handler: (e: {
74
+ id: string;
75
+ data?: unknown;
76
+ }) => void): () => void;
77
+ };
78
+ export declare const recentDocuments: {
79
+ /** Adds `path` to the OS's recent-documents list. Default-granted. */
80
+ add(path: string): Promise<void>;
81
+ /** Clears the OS's recent-documents list. Default-granted. */
82
+ clear(): Promise<void>;
83
+ };
84
+ /** OS keychain / credential storage. Default-denied — needs `core:credentials.*` in ND_ACL_GRANTS, or these reject with "capability denied". */
85
+ export declare const credentials: {
86
+ /** Stores `secret` under (`service`, `account`) in the OS credential store. */
87
+ set(service: string, account: string, secret: string): Promise<void>;
88
+ /** Reads the secret stored under (`service`, `account`), or `null` if none exists. */
89
+ get(service: string, account: string): Promise<string | null>;
90
+ /** Removes the secret stored under (`service`, `account`). */
91
+ delete(service: string, account: string): Promise<void>;
92
+ };
93
+ export declare const app: {
94
+ /**
95
+ * Whether the app is currently active (frontmost), synchronously. Backed by
96
+ * the host's app.activate/app.deactivate stream — the host replays the
97
+ * standing state right after the handshake, so this is correct from the
98
+ * first render. Defaults to true before any transition has been seen.
99
+ */
100
+ isActive(): boolean;
101
+ /** Subscribes to app-activation (e.g. Dock/taskbar re-activation). Returns an unsubscribe function. */
102
+ onActivate(handler: () => void): () => void;
103
+ /** Subscribes to app-deactivation. Returns an unsubscribe function. */
104
+ onDeactivate(handler: () => void): () => void;
105
+ /** Subscribes to OS "open URL" launch requests (e.g. a registered custom URL scheme). Returns an unsubscribe function. */
106
+ onOpenUrl(handler: (url: string) => void): () => void;
107
+ /** Subscribes to OS "open file" launch requests (e.g. double-clicking a registered document type). Returns an unsubscribe function. */
108
+ onOpenFile(handler: (paths: string[]) => void): () => void;
109
+ /** Subscribes to files dropped onto a window. Returns an unsubscribe function. */
110
+ onFileDrop(handler: (e: {
111
+ paths: string[];
112
+ windowId: number;
113
+ }) => void): () => void;
114
+ };
115
+ export type Appearance = "dark" | "light";
116
+ /** Result of `system.getAppearance` and payload of `onAppearanceChange`:
117
+ * light/dark plus the OS accent as `#rrggbb` (AdwStyleManager accent-color
118
+ * on Linux, `NSColor.controlAccentColor` on macOS). */
119
+ export interface AppearanceInfo {
120
+ appearance: Appearance;
121
+ accentColor: string;
122
+ }
123
+ export declare const system: {
124
+ /** Reads the OS's current light/dark appearance + accent color. Default-granted. */
125
+ getAppearance(): Promise<AppearanceInfo>;
126
+ /** Subscribes to system appearance/accent changes. Returns an unsubscribe function. */
127
+ onAppearanceChange(handler: (info: AppearanceInfo) => void): () => void;
128
+ };
129
+ export interface AudioPlayOptions {
130
+ path?: string;
131
+ url?: string;
132
+ volume?: number;
133
+ spectrum?: boolean;
134
+ }
135
+ export type AudioState = "playing" | "paused" | "ended" | "stopped" | "error";
136
+ export interface AudioStateEvent {
137
+ handle: string;
138
+ state: AudioState;
139
+ position: number;
140
+ duration: number | null;
141
+ error?: string;
142
+ }
143
+ export interface AudioSpectrumEvent {
144
+ handle: string;
145
+ bins: number[];
146
+ }
147
+ /** Audio playback. `core:audio` is default-granted (ND_ACL_GRANTS manifests extend the default set — they cannot revoke it). */
148
+ export declare const audio: {
149
+ /** Starts playback from exactly one of `path` (local file) or `url` (remote). Resolves to a handle used by the other methods below. */
150
+ play(options: AudioPlayOptions): Promise<string>;
151
+ /** Pauses playback for `handle`. */
152
+ pause(handle: string): Promise<void>;
153
+ /** Resumes playback for `handle`. */
154
+ resume(handle: string): Promise<void>;
155
+ /** Stops playback and releases `handle` — it is no longer valid afterward. */
156
+ stop(handle: string): Promise<void>;
157
+ /** Seeks `handle` to `positionMs` milliseconds. */
158
+ seek(handle: string, positionMs: number): Promise<void>;
159
+ /** Sets playback volume (0..1) for `handle`. */
160
+ setVolume(handle: string, volume: number): Promise<void>;
161
+ /** Subscribes to playback state transitions (not position ticks). Returns an unsubscribe function. */
162
+ onState(handler: (e: AudioStateEvent) => void): () => void;
163
+ /** Subscribes to spectrum frames (32 bins, 0..1, ~15 Hz) — only emitted for handles played with `spectrum: true`. Returns an unsubscribe function. */
164
+ onSpectrum(handler: (e: AudioSpectrumEvent) => void): () => void;
165
+ };
166
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { NdNodeRef } from "./generated/intrinsics.ts";
2
+ export type ToastPriority = "normal" | "high";
3
+ export interface ShowToastOptions {
4
+ title: string;
5
+ buttonLabel?: string;
6
+ timeoutSeconds?: number;
7
+ priority?: ToastPriority;
8
+ }
9
+ export interface ToastResult {
10
+ buttonClicked: boolean;
11
+ }
12
+ export declare function showToast(node: NdNodeRef<"toastoverlay">, options: ShowToastOptions): Promise<ToastResult>;
13
+ export declare function dismissToast(node: NdNodeRef<"toastoverlay">, id?: string): void;
14
+ export declare function onToastButtonClicked(e: {
15
+ data: unknown;
16
+ }): void;
17
+ export declare function onToastDismissed(e: {
18
+ data: unknown;
19
+ }): void;
@@ -0,0 +1,5 @@
1
+ import type { NdNodeRef } from "./generated/intrinsics.ts";
2
+ export declare function executeJavaScript(node: NdNodeRef<"webview">, code: string): Promise<string>;
3
+ export declare function onJavaScriptResult(e: {
4
+ data: unknown;
5
+ }): void;
@@ -0,0 +1,42 @@
1
+ type Op = {
2
+ op: "create";
3
+ id: number;
4
+ widget: string;
5
+ props: Record<string, unknown>;
6
+ } | {
7
+ op: "append";
8
+ parent: number;
9
+ child: number;
10
+ } | {
11
+ op: "insertBefore";
12
+ parent: number;
13
+ child: number;
14
+ before: number | null;
15
+ } | {
16
+ op: "remove";
17
+ id: number;
18
+ } | {
19
+ op: "setText";
20
+ id: number;
21
+ text: string;
22
+ } | {
23
+ op: "update";
24
+ id: number;
25
+ props: Record<string, unknown>;
26
+ } | {
27
+ op: "hide";
28
+ id: number;
29
+ } | {
30
+ op: "unhide";
31
+ id: number;
32
+ };
33
+ type Batch = {
34
+ commitId: number;
35
+ generation: number;
36
+ ops: readonly Op[];
37
+ };
38
+ export declare class BinaryUnsupportedValue extends Error {
39
+ constructor(key: string, value: unknown);
40
+ }
41
+ export declare function encodeCommitBatchBinary(batch: Batch): Uint8Array;
42
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { Runtime, Op, CommitBatch, EventMsg } from "../packages/react/src/generated/protocol";
2
+ export declare class Ndp {
3
+ private socket;
4
+ private inbox;
5
+ private eventCb;
6
+ private helloAckResolve;
7
+ private outbox;
8
+ private outboxOffset;
9
+ private encoding;
10
+ private backendName;
11
+ private hostWidgetsSet;
12
+ private hostCommandsSet;
13
+ private pending;
14
+ private nextRequestId;
15
+ private systemEventCb;
16
+ private constructor();
17
+ /** The host's active widget backend, valid after `handshake()` resolves. */
18
+ get backend(): string;
19
+ /** Intrinsics the host build knows, or null on a pre-manifest host. Valid after `handshake()`. */
20
+ get hostWidgets(): Set<string> | null;
21
+ /** "<intrinsic>.<command>" entries the host dispatches, or null on a pre-manifest host. Valid after `handshake()`. */
22
+ get hostCommands(): Set<string> | null;
23
+ static connect(): Promise<Ndp>;
24
+ private pump;
25
+ private onData;
26
+ private dispatch;
27
+ private send;
28
+ handshake(runtime: Runtime): Promise<void>;
29
+ sendCommit(batch: Omit<CommitBatch, "type">): void;
30
+ private sendBinaryFrame;
31
+ sendWidgetCommand(nodeId: number, command: string, arg?: unknown): void;
32
+ onEvent(cb: (e: EventMsg) => void): void;
33
+ request(method: string, params: unknown): Promise<unknown>;
34
+ onSystemEvent(cb: (channel: string, data: unknown) => void): void;
35
+ ping(): void;
36
+ sendRuntimeError(message: string, stack: string, fatal: boolean): void;
37
+ }
38
+ export type { Op, CommitBatch, EventMsg, Runtime };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@nativedesktop/react",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/FormalSnake/NativeDesktop#readme",
7
+ "bugs": "https://github.com/FormalSnake/NativeDesktop/issues",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/FormalSnake/NativeDesktop.git",
11
+ "directory": "packages/react"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "files": ["dist"],
17
+ "main": "./dist/index.js",
18
+ "types": "./dist/packages/react/src/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/packages/react/src/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./jsx-runtime": {
25
+ "types": "./dist/packages/react/src/jsx-runtime.d.ts",
26
+ "default": "./dist/jsx-runtime.js"
27
+ },
28
+ "./jsx-dev-runtime": {
29
+ "types": "./dist/packages/react/src/jsx-dev-runtime.d.ts",
30
+ "default": "./dist/jsx-dev-runtime.js"
31
+ },
32
+ "./rpc": {
33
+ "types": "./dist/packages/react/src/generated/rpc.d.ts",
34
+ "default": "./dist/generated/rpc.js"
35
+ }
36
+ },
37
+ "scripts": {
38
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && bun build ./src/index.ts ./src/jsx-runtime.ts ./src/jsx-dev-runtime.ts ./src/generated/rpc.ts --outdir dist --target node --format esm --external react --external react-reconciler --external react-refresh",
39
+ "prepack": "bun run build",
40
+ "prepare": "bun run build"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^19.2.7"
44
+ },
45
+ "dependencies": {
46
+ "react-reconciler": "0.33.0",
47
+ "react-refresh": "0.17.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/react": "19.2.17",
51
+ "@types/react-reconciler": "0.33.0",
52
+ "@types/react-refresh": "0.14.7",
53
+ "react": "19.2.7",
54
+ "typescript": "7.0.2"
55
+ }
56
+ }