electron-reactive-event-cli 1.0.61 → 1.0.63

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 (142) hide show
  1. package/Distribution/Command.d.ts +12 -0
  2. package/Distribution/Command.d.ts.map +1 -0
  3. package/Distribution/Command.js +99 -0
  4. package/Distribution/Command.js.map +1 -0
  5. package/Distribution/Config.Types.d.ts +27 -0
  6. package/Distribution/Config.Types.d.ts.map +1 -0
  7. package/Distribution/Config.Types.js +8 -0
  8. package/Distribution/Config.Types.js.map +1 -0
  9. package/Distribution/Config.d.ts +8 -0
  10. package/Distribution/Config.d.ts.map +1 -0
  11. package/Distribution/Config.js +104 -0
  12. package/Distribution/Config.js.map +1 -0
  13. package/Distribution/DeclareEvents.Command.d.ts +2 -0
  14. package/Distribution/DeclareEvents.Command.d.ts.map +1 -0
  15. package/Distribution/DeclareEvents.Command.js +16 -0
  16. package/Distribution/DeclareEvents.Command.js.map +1 -0
  17. package/Distribution/DeclareEvents.Types.d.ts +9 -0
  18. package/Distribution/DeclareEvents.Types.d.ts.map +1 -0
  19. package/Distribution/DeclareEvents.Types.js +8 -0
  20. package/Distribution/DeclareEvents.Types.js.map +1 -0
  21. package/Distribution/DeclareEvents.d.ts +2 -0
  22. package/Distribution/DeclareEvents.d.ts.map +1 -0
  23. package/Distribution/DeclareEvents.js +178 -0
  24. package/Distribution/DeclareEvents.js.map +1 -0
  25. package/Distribution/GenerateScopedTypes.Command.d.ts +2 -0
  26. package/Distribution/GenerateScopedTypes.Command.d.ts.map +1 -0
  27. package/Distribution/GenerateScopedTypes.Command.js +32 -0
  28. package/Distribution/GenerateScopedTypes.Command.js.map +1 -0
  29. package/Distribution/GenerateScopedTypes.Types.d.ts +19 -0
  30. package/Distribution/GenerateScopedTypes.Types.d.ts.map +1 -0
  31. package/Distribution/GenerateScopedTypes.Types.js +8 -0
  32. package/Distribution/GenerateScopedTypes.Types.js.map +1 -0
  33. package/Distribution/GenerateScopedTypes.d.ts +9 -0
  34. package/Distribution/GenerateScopedTypes.d.ts.map +1 -0
  35. package/Distribution/GenerateScopedTypes.js +215 -0
  36. package/Distribution/GenerateScopedTypes.js.map +1 -0
  37. package/Distribution/Setup.d.ts +0 -1
  38. package/Distribution/Setup.js +32 -2
  39. package/Distribution/Setup.js.map +1 -1
  40. package/Distribution/WriteTypesToClipboard.d.ts +2 -0
  41. package/Distribution/WriteTypesToClipboard.d.ts.map +1 -0
  42. package/Distribution/WriteTypesToClipboard.js +190 -0
  43. package/Distribution/WriteTypesToClipboard.js.map +1 -0
  44. package/package.json +43 -54
  45. package/Distribution/Initialize.Types.d.ts +0 -4
  46. package/Distribution/Initialize.Types.d.ts.map +0 -1
  47. package/Distribution/Initialize.Types.js +0 -7
  48. package/Distribution/Initialize.Types.js.map +0 -1
  49. package/Distribution/Initialize.d.ts +0 -2
  50. package/Distribution/Initialize.d.ts.map +0 -1
  51. package/Distribution/Initialize.js +0 -288
  52. package/Distribution/Initialize.js.map +0 -1
  53. package/Distribution/Main.d.ts +0 -2
  54. package/Distribution/Main.d.ts.map +0 -1
  55. package/Distribution/Main.js +0 -8
  56. package/Distribution/Main.js.map +0 -1
  57. package/Distribution/Provider.d.ts +0 -2
  58. package/Distribution/Provider.d.ts.map +0 -1
  59. package/Distribution/Provider.js +0 -8
  60. package/Distribution/Provider.js.map +0 -1
  61. package/Distribution/Register/RegisterCommand.Types.d.ts +0 -27
  62. package/Distribution/Register/RegisterCommand.Types.d.ts.map +0 -1
  63. package/Distribution/Register/RegisterCommand.Types.js +0 -7
  64. package/Distribution/Register/RegisterCommand.Types.js.map +0 -1
  65. package/Distribution/Register/RegisterCommand.d.ts +0 -3
  66. package/Distribution/Register/RegisterCommand.d.ts.map +0 -1
  67. package/Distribution/Register/RegisterCommand.js +0 -403
  68. package/Distribution/Register/RegisterCommand.js.map +0 -1
  69. package/Distribution/Register/RegisterCommandBin.d.ts +0 -2
  70. package/Distribution/Register/RegisterCommandBin.d.ts.map +0 -1
  71. package/Distribution/Register/RegisterCommandBin.js +0 -8
  72. package/Distribution/Register/RegisterCommandBin.js.map +0 -1
  73. package/Distribution/Register/index.d.ts +0 -2
  74. package/Distribution/Register/index.d.ts.map +0 -1
  75. package/Distribution/Register/index.js +0 -7
  76. package/Distribution/Register/index.js.map +0 -1
  77. package/Distribution/Register.Types.d.ts +0 -2
  78. package/Distribution/Register.Types.d.ts.map +0 -1
  79. package/Distribution/Register.Types.js +0 -2
  80. package/Distribution/Register.Types.js.map +0 -1
  81. package/Distribution/Register.d.ts +0 -3
  82. package/Distribution/Register.d.ts.map +0 -1
  83. package/Distribution/Register.js +0 -19
  84. package/Distribution/Register.js.map +0 -1
  85. package/Distribution/Schema.Types.d.ts +0 -19
  86. package/Distribution/Schema.Types.d.ts.map +0 -1
  87. package/Distribution/Schema.Types.js +0 -10
  88. package/Distribution/Schema.Types.js.map +0 -1
  89. package/Distribution/Select.Types.d.ts +0 -2
  90. package/Distribution/Select.Types.d.ts.map +0 -1
  91. package/Distribution/Select.Types.js +0 -7
  92. package/Distribution/Select.Types.js.map +0 -1
  93. package/Distribution/Select.d.ts +0 -2
  94. package/Distribution/Select.d.ts.map +0 -1
  95. package/Distribution/Select.js +0 -7
  96. package/Distribution/Select.js.map +0 -1
  97. package/Distribution/Setup/Prompt.Types.d.ts +0 -7
  98. package/Distribution/Setup/Prompt.Types.d.ts.map +0 -1
  99. package/Distribution/Setup/Prompt.Types.js +0 -7
  100. package/Distribution/Setup/Prompt.Types.js.map +0 -1
  101. package/Distribution/Setup/Prompt.d.ts +0 -10
  102. package/Distribution/Setup/Prompt.d.ts.map +0 -1
  103. package/Distribution/Setup/Prompt.js +0 -220
  104. package/Distribution/Setup/Prompt.js.map +0 -1
  105. package/Distribution/Setup/SetupCommand.Types.d.ts +0 -5
  106. package/Distribution/Setup/SetupCommand.Types.d.ts.map +0 -1
  107. package/Distribution/Setup/SetupCommand.Types.js +0 -7
  108. package/Distribution/Setup/SetupCommand.Types.js.map +0 -1
  109. package/Distribution/Setup/SetupCommand.d.ts +0 -3
  110. package/Distribution/Setup/SetupCommand.d.ts.map +0 -1
  111. package/Distribution/Setup/SetupCommand.js +0 -248
  112. package/Distribution/Setup/SetupCommand.js.map +0 -1
  113. package/Distribution/Setup/TsConfig.Types.d.ts +0 -10
  114. package/Distribution/Setup/TsConfig.Types.d.ts.map +0 -1
  115. package/Distribution/Setup/TsConfig.Types.js +0 -7
  116. package/Distribution/Setup/TsConfig.Types.js.map +0 -1
  117. package/Distribution/Setup/TsConfig.d.ts +0 -8
  118. package/Distribution/Setup/TsConfig.d.ts.map +0 -1
  119. package/Distribution/Setup/TsConfig.js +0 -67
  120. package/Distribution/Setup/TsConfig.js.map +0 -1
  121. package/Distribution/Setup/index.d.ts +0 -6
  122. package/Distribution/Setup/index.d.ts.map +0 -1
  123. package/Distribution/Setup/index.js +0 -11
  124. package/Distribution/Setup/index.js.map +0 -1
  125. package/Distribution/Shared.d.ts +0 -2
  126. package/Distribution/Shared.d.ts.map +0 -1
  127. package/Distribution/Shared.js +0 -7
  128. package/Distribution/Shared.js.map +0 -1
  129. package/Distribution/Utility.Types.d.ts +0 -2
  130. package/Distribution/Utility.Types.d.ts.map +0 -1
  131. package/Distribution/Utility.Types.js +0 -7
  132. package/Distribution/Utility.Types.js.map +0 -1
  133. package/Distribution/Utility.d.ts +0 -3
  134. package/Distribution/Utility.d.ts.map +0 -1
  135. package/Distribution/Utility.js +0 -17
  136. package/Distribution/Utility.js.map +0 -1
  137. package/Distribution/index.d.ts +0 -8
  138. package/Distribution/index.d.ts.map +0 -1
  139. package/Distribution/index.js +0 -13
  140. package/Distribution/index.js.map +0 -1
  141. package/License.md +0 -21
  142. package/ReadMe.md +0 -7
@@ -0,0 +1,12 @@
1
+ export declare function GetCommand(): string;
2
+ export declare function GetHeader(FileName: string, PrincipalCommand: string): string;
3
+ export declare class TryError extends Error {
4
+ constructor(Result: string | undefined, OriginalError?: unknown);
5
+ TheResult: string | undefined;
6
+ TheOriginalError: Error | undefined;
7
+ }
8
+ export declare function SetCommand(CommandName: string): void;
9
+ export declare function Try(Label: string, SuccessLabel: ((Result: string) => string), Function: (() => Promise<string>)): Promise<string>;
10
+ export declare function Try<Type>(Label: string, SuccessLabel: string, Function: (() => Promise<Type>)): Promise<Type>;
11
+ export declare function Try<Type>(Label: string, SuccessLabel: ((Result: string) => string), Function: (() => Promise<Type>)): Promise<Type>;
12
+ //# sourceMappingURL=Command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../Source/Command.ts"],"names":[],"mappings":"AAaA,wBAAgB,UAAU,IAAI,MAAM,CAGnC;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAgB5E;AAED,qBAAa,QAAS,SAAQ,KAAK;gBAEZ,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO;IAY/D,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAE9B,gBAAgB,EAAE,KAAK,GAAG,SAAS,CAAC;CAC9C;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAGpD;AAED,wBAAsB,GAAG,CACrB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,EAC1C,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,GAClC,OAAO,CAAC,MAAM,CAAC,CAAC;AACnB,wBAAsB,GAAG,CAAC,IAAI,EAC1B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC;AACjB,wBAAsB,GAAG,CAAC,IAAI,EAC1B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,EAC1C,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ /* File: Command.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.TryError = void 0;
12
+ exports.GetCommand = GetCommand;
13
+ exports.GetHeader = GetHeader;
14
+ exports.SetCommand = SetCommand;
15
+ exports.Try = Try;
16
+ const ora_1 = __importDefault(require("ora"));
17
+ let Command = "generate";
18
+ function GetCommand() {
19
+ return Command;
20
+ }
21
+ function GetHeader(FileName, PrincipalCommand) {
22
+ return `/**
23
+ * File: ${FileName}
24
+ * Author: \`electron-reactive-event\`
25
+ *
26
+ * ********************************************
27
+ *
28
+ * Generated with the ${GetCommand()} command.
29
+ * Regenerate this file by running,
30
+ *
31
+ * \`npm exec electron-reactive-event ${PrincipalCommand}\`
32
+ *
33
+ * in this directory.
34
+ *
35
+ */\n\n/* eslint-disable */\n`;
36
+ }
37
+ class TryError extends Error {
38
+ constructor(Result, OriginalError) {
39
+ super();
40
+ this.TheResult = Result;
41
+ if (OriginalError !== undefined && OriginalError instanceof Error) {
42
+ this.TheOriginalError = OriginalError;
43
+ }
44
+ }
45
+ TheResult;
46
+ TheOriginalError;
47
+ }
48
+ exports.TryError = TryError;
49
+ ;
50
+ function SetCommand(CommandName) {
51
+ Command = CommandName;
52
+ }
53
+ async function Try(Label, SuccessLabel, Function) {
54
+ const OraAugmentation = (0, ora_1.default)({
55
+ spinner: "point",
56
+ text: Label
57
+ }).start();
58
+ try {
59
+ const Result = await Function();
60
+ if (typeof SuccessLabel === "function") {
61
+ if (typeof Result === "string") {
62
+ OraAugmentation.succeed(SuccessLabel(Result));
63
+ }
64
+ else {
65
+ /* eslint-disable-next-line @stylistic/max-len */
66
+ throw new Error("Try was given a SuccessLabel function, but the result type was not a string!");
67
+ }
68
+ }
69
+ else {
70
+ OraAugmentation.succeed(SuccessLabel);
71
+ }
72
+ return Result;
73
+ }
74
+ catch (Error) {
75
+ if (Error instanceof TryError) {
76
+ if (Error.TheResult !== undefined) {
77
+ if (Error.TheOriginalError !== undefined) {
78
+ console.error(Error.TheOriginalError, `\n\n🚨 ${Error.TheResult} The error is printed above.`);
79
+ }
80
+ else {
81
+ console.error(`\n\n🚨 ${Error.TheResult}`);
82
+ }
83
+ }
84
+ else {
85
+ if (Error.TheOriginalError !== undefined) {
86
+ console.error(Error.TheOriginalError, `\n\n🚨 The ${GetCommand()} command failed. The error is printed above.`);
87
+ }
88
+ else {
89
+ console.error(`\n\n🚨 The ${GetCommand()} command failed.`);
90
+ }
91
+ }
92
+ }
93
+ else {
94
+ console.error(Error, `\n\n🚨 The ${GetCommand()} command failed. The error is printed above.`);
95
+ }
96
+ process.exit(1);
97
+ }
98
+ }
99
+ //# sourceMappingURL=Command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Command.js","sourceRoot":"","sources":["../Source/Command.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AASH,gCAGC;AAED,8BAgBC;AAqBD,gCAGC;AAiBD,kBA2EC;AA7ID,8CAAsB;AAEtB,IAAI,OAAO,GAAW,UAAU,CAAC;AAEjC,SAAgB,UAAU;IAEtB,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAAgB,SAAS,CAAC,QAAgB,EAAE,gBAAwB;IAEhE,OAAO;aACG,QAAS;;;;;wBAKE,UAAU,EAAG;;;2CAGM,gBAAiB;;;;8BAI/B,CAAC;AAC/B,CAAC;AAED,MAAa,QAAS,SAAQ,KAAK;IAE/B,YAAmB,MAA0B,EAAE,aAAuB;QA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KAAK,CAAC,SAAU,+BAA+B,CAC7D,CAAC;gBACN,CAAC;qBAED,CAAC;oBACG,OAAO,CAAC,KAAK,CAAC,UAAW,KAAK,CAAC,SAAU,EAAE,CAAC,CAAC;gBACjD,CAAC;YACL,CAAC;iBAED,CAAC;gBACG,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,EACxC,CAAC;oBACG,OAAO,CAAC,KAAK,CACT,KAAK,CAAC,gBAAgB,EACtB,cAAe,UAAU,EAAG,+CAA+C,CAC9E,CAAC;gBACN,CAAC;qBAED,CAAC;oBACG,OAAO,CAAC,KAAK,CAAC,cAAe,UAAU,EAAG,kBAAkB,CAAC,CAAC;gBAClE,CAAC;YACL,CAAC;QACL,CAAC;aAED,CAAC;YACG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,cAAe,UAAU,EAAG,+CAA+C,CAAC,CAAC;QACtG,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The format of the JSON config file for using the CLI commands
3
+ * offered by `electron-reactive-event`.
4
+ */
5
+ export type CliConfig = {
6
+ "$schema": string;
7
+ /**
8
+ * The path to the file containing the `declare module` block that augments
9
+ * the `Registrar` type with your event declarations. This path should be
10
+ * included in your `tsconfig.json`.
11
+ */
12
+ AugmentationModulePath: string;
13
+ /**
14
+ * The unique identifier for your package. This allows `electron-reactive-event`
15
+ * to be used by your package *and* any dependencies simultaneously.
16
+ */
17
+ PackageKey: string;
18
+ /**
19
+ * The path to the file that exports types scoped to your `PackageKey`.
20
+ * Every type exported by `electron-reactive-event/scoped` is imported here,
21
+ * and a new type of the same name is defined, with your `PackageKey` filled in
22
+ * for the `PackageKey` type parameter. This path should be included in your
23
+ * `tsconfig.json`.
24
+ */
25
+ ScopedModulePath: string;
26
+ };
27
+ //# sourceMappingURL=Config.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.Types.d.ts","sourceRoot":"","sources":["../Source/Config.Types.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB;IACI,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* File: Config.Types.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=Config.Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.Types.js","sourceRoot":"","sources":["../Source/Config.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,8 @@
1
+ import type { CliConfig } from "./Config.Types";
2
+ export declare const ConfigFileName: string;
3
+ export declare function HasConfig(): Promise<boolean>;
4
+ export declare function IsConfigValid(): Promise<boolean>;
5
+ export declare function GetConfig(): Promise<CliConfig>;
6
+ export declare function GetDefaultConfig(): Promise<CliConfig>;
7
+ export declare function GetConfigSafe(): Promise<CliConfig>;
8
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../Source/Config.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,eAAO,MAAM,cAAc,EAAE,MAA8C,CAAC;AAE5E,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAIlD;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CA4BtD;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,CAMpD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,SAAS,CAAC,CA2C3D;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC,CAoCxD"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ /* File: Config.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ConfigFileName = void 0;
9
+ exports.HasConfig = HasConfig;
10
+ exports.IsConfigValid = IsConfigValid;
11
+ exports.GetConfig = GetConfig;
12
+ exports.GetDefaultConfig = GetDefaultConfig;
13
+ exports.GetConfigSafe = GetConfigSafe;
14
+ /* eslint-disable jsdoc/require-jsdoc */
15
+ const fs_1 = require("fs");
16
+ const promises_1 = require("fs/promises");
17
+ const utilities_1 = require("@sorrell/utilities");
18
+ const path_1 = require("path");
19
+ exports.ConfigFileName = "electron-reactive-event.config.json";
20
+ async function HasConfig() {
21
+ const Root = await (0, utilities_1.GetPackageRootDirectory)();
22
+ return (0, fs_1.existsSync)((0, path_1.resolve)(Root, exports.ConfigFileName));
23
+ }
24
+ async function IsConfigValid() {
25
+ if (!(await HasConfig())) {
26
+ return false;
27
+ }
28
+ try {
29
+ const Config = await GetConfig();
30
+ return (typeof Config === "object" &&
31
+ Config !== null &&
32
+ "$schema" in Config &&
33
+ typeof Config.$schema === "string" &&
34
+ "AugmentationModulePath" in Config &&
35
+ typeof Config.AugmentationModulePath === "string" &&
36
+ "PackageKey" in Config &&
37
+ typeof Config.PackageKey === "string" &&
38
+ "ScopedModulePath" in Config &&
39
+ typeof Config.ScopedModulePath === "string");
40
+ }
41
+ catch {
42
+ return false;
43
+ }
44
+ }
45
+ async function GetConfig() {
46
+ const Root = await (0, utilities_1.GetPackageRootDirectory)();
47
+ const File = await (0, promises_1.readFile)((0, path_1.resolve)(Root, exports.ConfigFileName), { encoding: "utf-8" });
48
+ return JSON.parse(File);
49
+ }
50
+ async function GetDefaultConfig() {
51
+ const Root = await (0, utilities_1.GetPackageRootDirectory)();
52
+ const SourcePath = await (async () => {
53
+ const Directories = (await (0, promises_1.readdir)(Root, { withFileTypes: true }))
54
+ .filter((Entry) => Entry.isDirectory())
55
+ .map((Entry) => Entry.name);
56
+ if (Directories.includes("src")) {
57
+ return (0, path_1.resolve)(Root, "src");
58
+ }
59
+ else if (Directories.includes("Source")) {
60
+ return (0, path_1.resolve)(Root, "Source");
61
+ }
62
+ else {
63
+ return Root;
64
+ }
65
+ })();
66
+ const DefaultAugmentationFileName = "Reactive.Events.Generated.ts";
67
+ const DefaultScopedModuleFileName = "Reactive.Types.Generated.ts";
68
+ const DefaultPackageKey = await (async () => {
69
+ const PackageJson = JSON.parse(await (0, promises_1.readFile)((0, path_1.resolve)(Root, "package.json"), { encoding: "utf-8" }));
70
+ return PackageJson.name.replace("@", "").replaceAll("/", "").replaceAll("-", "");
71
+ })();
72
+ return {
73
+ $schema: "https://electron-reactive-event.sorrell.sh/CliConfig.Schema.json",
74
+ AugmentationModulePath: (0, path_1.resolve)(SourcePath, DefaultAugmentationFileName),
75
+ PackageKey: DefaultPackageKey,
76
+ ScopedModulePath: (0, path_1.resolve)(SourcePath, DefaultScopedModuleFileName)
77
+ };
78
+ }
79
+ async function GetConfigSafe() {
80
+ try {
81
+ const Config = await GetConfig();
82
+ const Default = await GetDefaultConfig();
83
+ if (typeof Config === "object" && Config !== null) {
84
+ const Out = { ...Default };
85
+ if ("AugmentationModulePath" in Config && typeof Config.AugmentationModulePath === "string") {
86
+ Out.AugmentationModulePath = Config.AugmentationModulePath;
87
+ }
88
+ if ("PackageKey" in Config && typeof Config.PackageKey === "string") {
89
+ Out.PackageKey = Config.PackageKey;
90
+ }
91
+ if ("ScopedModulePath" in Config && typeof Config.ScopedModulePath === "string") {
92
+ Out.ScopedModulePath = Config.ScopedModulePath;
93
+ }
94
+ return Out;
95
+ }
96
+ else {
97
+ return GetDefaultConfig();
98
+ }
99
+ }
100
+ catch {
101
+ return GetDefaultConfig();
102
+ }
103
+ }
104
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../Source/Config.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAYH,8BAIC;AAED,sCA4BC;AAED,8BAMC;AAED,4CA2CC;AAED,sCAoCC;AAvID,wCAAwC;AAExC,2BAA6C;AAC7C,0CAAgD;AAEhD,kDAA6D;AAC7D,+BAA+B;AAElB,QAAA,cAAc,GAAW,qCAAqC,CAAC;AAErE,KAAK,UAAU,SAAS;IAE3B,MAAM,IAAI,GAAW,MAAM,IAAA,mCAAuB,GAAE,CAAC;IACrD,OAAO,IAAA,eAAU,EAAC,IAAA,cAAO,EAAC,IAAI,EAAE,sBAAc,CAAC,CAAC,CAAC;AACrD,CAAC;AAEM,KAAK,UAAU,aAAa;IAE/B,IAAI,CAAC,CAAC,MAAM,SAAS,EAAE,CAAC,EACxB,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IACA,CAAC;QACG,MAAM,MAAM,GAAY,MAAM,SAAS,EAAE,CAAC;QAE1C,OAAO,CACH,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,KAAK,IAAI;YACf,SAAS,IAAI,MAAM;YACnB,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;YAClC,wBAAwB,IAAI,MAAM;YAClC,OAAO,MAAM,CAAC,sBAAsB,KAAK,QAAQ;YACjD,YAAY,IAAI,MAAM;YACtB,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ;YACrC,kBAAkB,IAAI,MAAM;YAC5B,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAC9C,CAAC;IACN,CAAC;IACD,MACA,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,SAAS;IAE3B,MAAM,IAAI,GAAW,MAAM,IAAA,mCAAuB,GAAE,CAAC;IAErD,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,CAAC;YACG,OAAO,gBAAgB,EAAE,CAAC;QAC9B,CAAC;IACL,CAAC;IACD,MACA,CAAC;QACG,OAAO,gBAAgB,EAAE,CAAC;IAC9B,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DeclareEvents.Command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.Command.d.ts","sourceRoot":"","sources":["../Source/DeclareEvents.Command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /* File: DeclareEvents.Command.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ /* eslint-disable jsdoc/require-jsdoc */
9
+ const DeclareEvents_1 = require("./DeclareEvents");
10
+ const Command_1 = require("./Command");
11
+ async function Main() {
12
+ (0, Command_1.SetCommand)("declare-events");
13
+ await (0, DeclareEvents_1.DeclareEvents)();
14
+ }
15
+ Main();
16
+ //# sourceMappingURL=DeclareEvents.Command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.Command.js","sourceRoot":"","sources":["../Source/DeclareEvents.Command.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,wCAAwC;AAExC,mDAAgD;AAChD,uCAAuC;AAEvC,KAAK,UAAU,IAAI;IAEf,IAAA,oBAAU,EAAC,gBAAgB,CAAC,CAAC;IAC7B,MAAM,IAAA,6BAAa,GAAE,CAAC;AAC1B,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type EventOwnerString = "Main" | "Renderer";
2
+ export type EventDeclaringModule = {
3
+ Declarations: Array<{
4
+ Name: string;
5
+ Owner: EventOwnerString;
6
+ }>;
7
+ Path: string;
8
+ };
9
+ //# sourceMappingURL=DeclareEvents.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.Types.d.ts","sourceRoot":"","sources":["../Source/DeclareEvents.Types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAC5B;IACI,YAAY,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,gBAAgB,CAAC;KAC3B,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* File: DeclareEvents.Types.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=DeclareEvents.Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.Types.js","sourceRoot":"","sources":["../Source/DeclareEvents.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
@@ -0,0 +1,2 @@
1
+ export declare function DeclareEvents(): Promise<void>;
2
+ //# sourceMappingURL=DeclareEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.d.ts","sourceRoot":"","sources":["../Source/DeclareEvents.ts"],"names":[],"mappings":"AAqRA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAsBnD"}
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ /* File: DeclareEvents.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.DeclareEvents = DeclareEvents;
12
+ const Config_1 = require("./Config");
13
+ const Command_1 = require("./Command");
14
+ const path_1 = require("path");
15
+ const utilities_1 = require("@sorrell/utilities");
16
+ const typescript_1 = __importDefault(require("typescript"));
17
+ const promises_1 = require("fs/promises");
18
+ /* eslint-disable jsdoc/require-jsdoc */
19
+ function GetEventDeclarationOwner(TypeNode) {
20
+ if (TypeNode === undefined || !typescript_1.default.isTypeReferenceNode(TypeNode)) {
21
+ return undefined;
22
+ }
23
+ if (!typescript_1.default.isIdentifier(TypeNode.typeName) || TypeNode.typeName.text !== "EventDecl") {
24
+ return undefined;
25
+ }
26
+ const TypeArguments = TypeNode.typeArguments ?? [];
27
+ for (const TypeArgument of TypeArguments) {
28
+ console.log(JSON.stringify(TypeArgument, null, 4));
29
+ if (!typescript_1.default.isLiteralTypeNode(TypeArgument)) {
30
+ continue;
31
+ }
32
+ if (!typescript_1.default.isStringLiteral(TypeArgument.literal)) {
33
+ continue;
34
+ }
35
+ if (TypeArgument.literal.text === "Main"
36
+ || TypeArgument.literal.text === "Renderer") {
37
+ return TypeArgument.literal.text;
38
+ }
39
+ }
40
+ return undefined;
41
+ }
42
+ function CreateFormatDiagnosticsHost() {
43
+ return {
44
+ getCanonicalFileName(FilePath) {
45
+ return FilePath;
46
+ },
47
+ getCurrentDirectory() {
48
+ return process.cwd();
49
+ },
50
+ getNewLine() {
51
+ return typescript_1.default.sys.newLine;
52
+ }
53
+ };
54
+ }
55
+ function IsPathWithinDirectory(CandidatePath, DirectoryPath) {
56
+ const NormalizedCandidatePath = (0, path_1.resolve)(CandidatePath);
57
+ const NormalizedDirectoryPath = (0, path_1.resolve)(DirectoryPath);
58
+ if (process.platform === "win32") {
59
+ const LowerCandidatePath = NormalizedCandidatePath.toLowerCase();
60
+ const LowerDirectoryPath = NormalizedDirectoryPath.toLowerCase();
61
+ return LowerCandidatePath === LowerDirectoryPath
62
+ || LowerCandidatePath.startsWith(LowerDirectoryPath + path_1.sep);
63
+ }
64
+ return NormalizedCandidatePath === NormalizedDirectoryPath
65
+ || NormalizedCandidatePath.startsWith(NormalizedDirectoryPath + path_1.sep);
66
+ }
67
+ function IsSymbolExportedFromSourceFile(TypeChecker, SourceFile, SymbolToCheck) {
68
+ if (SymbolToCheck === undefined) {
69
+ return false;
70
+ }
71
+ const ModuleSymbol = TypeChecker.getSymbolAtLocation(SourceFile);
72
+ if (ModuleSymbol === undefined) {
73
+ return false;
74
+ }
75
+ const ExportSymbols = TypeChecker.getExportsOfModule(ModuleSymbol);
76
+ for (const ExportSymbol of ExportSymbols) {
77
+ const ResolvedExportSymbol = (ExportSymbol.flags & typescript_1.default.SymbolFlags.Alias) !== 0
78
+ ? TypeChecker.getAliasedSymbol(ExportSymbol)
79
+ : ExportSymbol;
80
+ if (ResolvedExportSymbol === SymbolToCheck) {
81
+ return true;
82
+ }
83
+ }
84
+ return false;
85
+ }
86
+ async function FindExportedEventDeclTypes() {
87
+ const PackageRootDirectoryPathResolved = await (0, utilities_1.GetPackageRootDirectory)();
88
+ const TsConfigFilePath = (0, path_1.resolve)(PackageRootDirectoryPathResolved, "tsconfig.json");
89
+ const ConfigFileResult = typescript_1.default.readConfigFile(TsConfigFilePath, typescript_1.default.sys.readFile);
90
+ if (ConfigFileResult.error !== undefined) {
91
+ throw new Error(typescript_1.default.formatDiagnosticsWithColorAndContext([ConfigFileResult.error], CreateFormatDiagnosticsHost()));
92
+ }
93
+ const ParsedCommandLine = typescript_1.default.parseJsonConfigFileContent(ConfigFileResult.config, typescript_1.default.sys, PackageRootDirectoryPathResolved, undefined, TsConfigFilePath);
94
+ if (ParsedCommandLine.errors.length > 0) {
95
+ throw new Error(typescript_1.default.formatDiagnosticsWithColorAndContext(ParsedCommandLine.errors, CreateFormatDiagnosticsHost()));
96
+ }
97
+ const Program = typescript_1.default.createProgram({
98
+ options: ParsedCommandLine.options,
99
+ projectReferences: ParsedCommandLine.projectReferences || [],
100
+ rootNames: ParsedCommandLine.fileNames
101
+ });
102
+ const TypeChecker = Program.getTypeChecker();
103
+ const MatchesByPath = new Map();
104
+ for (const SourceFile of Program.getSourceFiles()) {
105
+ if (SourceFile.isDeclarationFile) {
106
+ continue;
107
+ }
108
+ if (!IsPathWithinDirectory(SourceFile.fileName, PackageRootDirectoryPathResolved)) {
109
+ continue;
110
+ }
111
+ for (const Statement of SourceFile.statements) {
112
+ if (!typescript_1.default.isTypeAliasDeclaration(Statement)) {
113
+ continue;
114
+ }
115
+ const Owner = GetEventDeclarationOwner(Statement.type);
116
+ if (Owner === undefined) {
117
+ continue;
118
+ }
119
+ const DeclarationSymbol = TypeChecker.getSymbolAtLocation(Statement.name);
120
+ if (!IsSymbolExportedFromSourceFile(TypeChecker, SourceFile, DeclarationSymbol)) {
121
+ continue;
122
+ }
123
+ const ExistingMatch = MatchesByPath.get(SourceFile.fileName);
124
+ if (ExistingMatch === undefined) {
125
+ MatchesByPath.set(SourceFile.fileName, {
126
+ Declarations: [
127
+ {
128
+ Name: Statement.name.text,
129
+ Owner
130
+ }
131
+ ],
132
+ Path: SourceFile.fileName
133
+ });
134
+ }
135
+ else {
136
+ ExistingMatch.Declarations.push({
137
+ Name: Statement.name.text,
138
+ Owner
139
+ });
140
+ }
141
+ }
142
+ }
143
+ return [...MatchesByPath.values()];
144
+ }
145
+ function DeclareEventsInner(Config) {
146
+ return async function () {
147
+ const FileName = (0, path_1.basename)(Config.AugmentationModulePath);
148
+ const Header = (0, Command_1.GetHeader)(FileName, "declare-events");
149
+ const EventDeclarations = await FindExportedEventDeclTypes();
150
+ console.log(EventDeclarations);
151
+ const Contents = Header + `\ndeclare module "electron-reactive-event/registrar"
152
+ {
153
+ interface Registrar
154
+ {
155
+ ${Config.PackageKey}:
156
+ {
157
+
158
+ };
159
+ }
160
+ };\n`;
161
+ await (0, promises_1.writeFile)(Config.AugmentationModulePath, Contents, { encoding: "utf-8" });
162
+ };
163
+ }
164
+ async function DeclareEvents() {
165
+ const Config = await (0, Config_1.GetConfigSafe)();
166
+ const DefaultConfig = await (0, Config_1.GetDefaultConfig)();
167
+ const DefaultLabelAugmentationPath = Config.AugmentationModulePath === DefaultConfig.AugmentationModulePath
168
+ ? "default"
169
+ : "";
170
+ if (!(await (0, Config_1.HasConfig)())) {
171
+ /* eslint-disable-next-line @stylistic/max-len */
172
+ console.log("\nšŸ’” Tip: You can create a default config file by running\n\n npm exec electron-reactive-event setup\n");
173
+ }
174
+ await (0, Command_1.Try)(
175
+ /* eslint-disable-next-line @stylistic/max-len */
176
+ `Writing augmentation module at ${DefaultLabelAugmentationPath} path ${Config.AugmentationModulePath}...`, (Result) => `Successfully augmented the registrar with ${Result} event declarations!`, DeclareEventsInner(Config));
177
+ }
178
+ //# sourceMappingURL=DeclareEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeclareEvents.js","sourceRoot":"","sources":["../Source/DeclareEvents.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;AAiRH,sCAsBC;AAlSD,qCAAsE;AACtE,uCAA2C;AAC3C,+BAA8C;AAE9C,kDAA6D;AAC7D,4DAAoC;AACpC,0CAAwC;AAExC,wCAAwC;AAExC,SAAS,wBAAwB,CAC7B,QAAyC;IAGzC,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,oBAAU,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EACvE,CAAC;QACG,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,CAAC,oBAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW,EACzF,CAAC;QACG,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,aAAa,GAAuC,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAC;IAEvF,KAAK,MAAM,YAAY,IAAI,aAAa,EACxC,CAAC;QACG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEnD,IAAI,CAAC,oBAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAC/C,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,GAAE,CAAC;IAChD,MAAM,aAAa,GAAc,MAAM,IAAA,yBAAgB,GAAE,CAAC;IAE1D,MAAM,4BAA4B,GAC9B,MAAM,CAAC,sBAAsB,KAAK,aAAa,CAAC,sBAAsB;QAClE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,CAAC;IAEb,IAAI,CAAC,CAAC,MAAM,IAAA,kBAAS,GAAE,CAAC,EACxB,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,2GAA2G,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,IAAA,aAAG;IACL,iDAAiD;IACjD,kCAAmC,4BAA6B,SAAU,MAAM,CAAC,sBAAuB,KAAK,EAC7G,CAAC,MAAc,EAAE,EAAE,CAAC,6CAA8C,MAAO,sBAAsB,EAC/F,kBAAkB,CAAC,MAAM,CAAC,CAC7B,CAAC;AACN,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GenerateScopedTypes.Command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateScopedTypes.Command.d.ts","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Command.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /* File: GenerateScopedTypes.Command.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ /* eslint-disable jsdoc/require-jsdoc, no-console */
9
+ const Config_1 = require("./Config");
10
+ const Command_1 = require("./Command");
11
+ const GenerateScopedTypes_1 = require("./GenerateScopedTypes");
12
+ async function Main() {
13
+ (0, Command_1.SetCommand)("generate-scoped-types");
14
+ const Config = await (0, Config_1.GetConfigSafe)();
15
+ const DefaultConfig = await (0, Config_1.GetDefaultConfig)();
16
+ if (!(await (0, Config_1.HasConfig)())) {
17
+ /* eslint-disable-next-line @stylistic/max-len */
18
+ console.log("\nšŸ’” Tip: You can create a default config file by running\n\n npm exec electron-reactive-event setup\n");
19
+ }
20
+ const DefaultLabelScopedModulePath = Config.ScopedModulePath === DefaultConfig.ScopedModulePath
21
+ ? "default"
22
+ : "";
23
+ if (!(await (0, Config_1.HasConfig)())) {
24
+ /* eslint-disable-next-line @stylistic/max-len */
25
+ console.log("\nšŸ’” Tip: You can create a default config file by running\n\n npm exec electron-reactive-event setup\n");
26
+ }
27
+ await (0, Command_1.Try)(
28
+ /* eslint-disable-next-line @stylistic/max-len */
29
+ `Writing scoped types module at ${DefaultLabelScopedModulePath} path ${Config.ScopedModulePath}...`, `Successfully created scoped types for PackageKey ${Config.PackageKey}!`, GenerateScopedTypes_1.GenerateScopedTypes);
30
+ }
31
+ Main();
32
+ //# sourceMappingURL=GenerateScopedTypes.Command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateScopedTypes.Command.js","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Command.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,oDAAoD;AAEpD,qCAAsE;AACtE,uCAA4C;AAE5C,+DAA4D;AAE5D,KAAK,UAAU,IAAI;IAEf,IAAA,oBAAU,EAAC,uBAAuB,CAAC,CAAC;IAEpC,MAAM,MAAM,GAAc,MAAM,IAAA,sBAAa,GAAE,CAAC;IAChD,MAAM,aAAa,GAAc,MAAM,IAAA,yBAAgB,GAAE,CAAC;IAE1D,IAAI,CAAC,CAAC,MAAM,IAAA,kBAAS,GAAE,CAAC,EACxB,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,2GAA2G,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,4BAA4B,GAC9B,MAAM,CAAC,gBAAgB,KAAK,aAAa,CAAC,gBAAgB;QACtD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,CAAC;IAEb,IAAI,CAAC,CAAC,MAAM,IAAA,kBAAS,GAAE,CAAC,EACxB,CAAC;QACG,iDAAiD;QACjD,OAAO,CAAC,GAAG,CAAC,2GAA2G,CAAC,CAAC;IAC7H,CAAC;IAED,MAAM,IAAA,aAAG;IACL,iDAAiD;IACjD,kCAAmC,4BAA6B,SAAU,MAAM,CAAC,gBAAiB,KAAK,EACvG,oDAAqD,MAAM,CAAC,UAAW,GAAG,EAC1E,yCAAmB,CACtB,CAAC;AACN,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ export type ScopedTypeDefinition<PackageKey extends string, KeyType extends string> = `export type ${KeyType}<${PackageKey}${string}> = ${KeyType}Imported<${PackageKey}${string}>;`;
2
+ export type Channels = {
3
+ Any: string;
4
+ Response: string;
5
+ NoResponse: string;
6
+ Request: string;
7
+ NoRequest: string;
8
+ Error: string;
9
+ NoError: string;
10
+ ErrorPayload: string;
11
+ ErrorMessageOnly: string;
12
+ Handler: Record<string, string>;
13
+ Listener: Record<string, string>;
14
+ };
15
+ export type ExportedType = "AnyCallback" | "EmptyEventParameter" | "EventDecl" | "EventErrorAdvancedDecl" | "EventErrorAdvancedDeclParameter" | "EventErrorDecl" | "EventErrorRecord" | "EventErrorTuple" | "EventOwner" | "EventRequest" | "Handle" | "HandleOnce" | "Handler" | "HandlerNoRequest" | "HandlerRequest" | "HandlerWithRequest" | "InvokeEventDeferred" | "InvokeResponse" | "IpcMainReactive" | "Listener" | "ListenerNoRequest" | "ListenerRequest" | "ListenerWithRequest" | "MainListener" | "MainOwner" | "Off" | "OffEventDeferred" | "On" | "OnEventDeferred" | "Once" | "OnceEventDeferred" | "RawResponse" | "RawResponseError" | "RawResponseSuccess" | "ReactiveEventContext" | "ReactiveEventErrorData" | "ReactiveEventFunctions" | "ReactiveEventHooks" | "ReactiveEventProviderProps" | "RemoveAllListeners" | "RemoveHandler" | "RendererListener" | "RendererOwner" | "Response" | "ResponseError" | "ResponseIndeterminate" | "ResponseSettled" | "ResponseSuccess" | "ResponseSync" | "Send" | "SendEventDeferred" | "SendableEventHandler" | "UseInvokeEvent" | "UseInvokeEventDeferred" | "UseOffEventDeferred" | "UseOnEvent" | "UseOnEventDeferred" | "UseOnceEvent" | "UseOnceEventDeferred" | "UseSendEvent" | "UseSendEventDeferred";
16
+ export type Types = {
17
+ [Key in ExportedType]: string | symbol;
18
+ };
19
+ //# sourceMappingURL=GenerateScopedTypes.Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateScopedTypes.Types.d.ts","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,oBAAoB,CAC5B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,MAAM,IAGtB,eAAgB,OAAQ,IAAK,UAAW,GAAI,MAAO,OAAQ,OAAQ,YAAa,UAAW,GAAI,MAAO,IAAI,CAAC;AAE/G,MAAM,MAAM,QAAQ,GAChB;IACI,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEN,MAAM,MAAM,YAAY,GAClB,aAAa,GACb,qBAAqB,GACrB,WAAW,GACX,wBAAwB,GACxB,iCAAiC,GACjC,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,YAAY,GACZ,cAAc,GACd,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,gBAAgB,GAChB,oBAAoB,GACpB,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,mBAAmB,GACnB,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,WAAW,GACX,KAAK,GACL,kBAAkB,GAClB,IAAI,GACJ,iBAAiB,GACjB,MAAM,GACN,mBAAmB,GACnB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,sBAAsB,GACtB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,GACpB,4BAA4B,GAC5B,oBAAoB,GACpB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,eAAe,GACf,uBAAuB,GACvB,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,GACd,MAAM,GACN,mBAAmB,GACnB,sBAAsB,GACtB,gBAAgB,GAChB,wBAAwB,GACxB,qBAAqB,GACrB,YAAY,GACZ,oBAAoB,GACpB,cAAc,GACd,sBAAsB,GACtB,cAAc,GACd,sBAAsB,CAAC;AAE7B,MAAM,MAAM,KAAK,GACb;KACM,GAAG,IAAI,YAAY,GAAI,MAAM,GAAG,MAAM;CAC3C,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ /* File: GenerateScopedTypes.Types.ts
3
+ * Author: Gage Sorrell <gage@sorrell.sh>
4
+ * Copyright: (c) 2026 Gage Sorrell
5
+ * License: MIT
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ //# sourceMappingURL=GenerateScopedTypes.Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateScopedTypes.Types.js","sourceRoot":"","sources":["../Source/GenerateScopedTypes.Types.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}