@noxfly/noxus 2.1.1 → 2.3.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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @copyright 2025 NoxFly
3
+ * @license MIT
4
+ * @author NoxFly
5
+ */
6
+
7
+ import { Type } from "./types";
8
+
9
+ /**
10
+ * A function that returns a type.
11
+ * Used for forward references to types that are not yet defined.
12
+ */
13
+ export interface ForwardRefFn<T = any> {
14
+ (): Type<T>;
15
+ }
16
+
17
+ /**
18
+ * A wrapper class for forward referenced types.
19
+ */
20
+ export class ForwardReference<T = any> {
21
+ constructor(public readonly forwardRefFn: ForwardRefFn<T>) {}
22
+ }
23
+
24
+ /**
25
+ * Creates a forward reference to a type.
26
+ * @param fn A function that returns the type.
27
+ * @returns A ForwardReference instance.
28
+ */
29
+ export function forwardRef<T = any>(fn: ForwardRefFn<T>): ForwardReference<T> {
30
+ return new ForwardReference(fn);
31
+ }
package/tsup.config.ts CHANGED
@@ -12,6 +12,7 @@ export default defineConfig({
12
12
  entry: {
13
13
  renderer: "src/index.ts",
14
14
  main: "src/main.ts",
15
+ child: "src/non-electron-process.ts",
15
16
  },
16
17
  keepNames: true,
17
18
  minifyIdentifiers: false,