@noxfly/noxus 3.0.0-dev.1 → 3.0.0-dev.11
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 +121 -8
- package/dist/child.d.mts +8 -2
- package/dist/child.d.ts +8 -2
- package/dist/child.js +405 -862
- package/dist/child.js.map +1 -0
- package/dist/child.mjs +396 -854
- package/dist/child.mjs.map +1 -0
- package/dist/main.d.mts +180 -132
- package/dist/main.d.ts +180 -132
- package/dist/main.js +1087 -926
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +1038 -877
- package/dist/main.mjs.map +1 -0
- package/dist/preload.js.map +1 -0
- package/dist/preload.mjs.map +1 -0
- package/dist/renderer.d.mts +30 -4
- package/dist/renderer.d.ts +30 -4
- package/dist/renderer.js +191 -128
- package/dist/renderer.js.map +1 -0
- package/dist/renderer.mjs +180 -116
- package/dist/renderer.mjs.map +1 -0
- package/package.json +18 -9
- package/.editorconfig +0 -16
- package/.github/copilot-instructions.md +0 -32
- package/.vscode/settings.json +0 -3
- package/eslint.config.js +0 -109
- package/scripts/postbuild.js +0 -31
- package/src/DI/app-injector.ts +0 -151
- package/src/DI/injector-explorer.ts +0 -143
- package/src/DI/token.ts +0 -53
- package/src/decorators/controller.decorator.ts +0 -58
- package/src/decorators/guards.decorator.ts +0 -15
- package/src/decorators/injectable.decorator.ts +0 -81
- package/src/decorators/method.decorator.ts +0 -66
- package/src/decorators/middleware.decorator.ts +0 -15
- package/src/index.ts +0 -10
- package/src/internal/app.ts +0 -217
- package/src/internal/bootstrap.ts +0 -108
- package/src/internal/exceptions.ts +0 -57
- package/src/internal/preload-bridge.ts +0 -75
- package/src/internal/renderer-client.ts +0 -338
- package/src/internal/renderer-events.ts +0 -110
- package/src/internal/request.ts +0 -97
- package/src/internal/router.ts +0 -353
- package/src/internal/routes.ts +0 -78
- package/src/internal/socket.ts +0 -73
- package/src/main.ts +0 -26
- package/src/non-electron-process.ts +0 -22
- package/src/preload.ts +0 -10
- package/src/renderer.ts +0 -13
- package/src/utils/forward-ref.ts +0 -31
- package/src/utils/logger.ts +0 -430
- package/src/utils/radix-tree.ts +0 -210
- package/src/utils/types.ts +0 -21
- package/src/window/window-manager.ts +0 -255
- package/tsconfig.json +0 -29
- package/tsup.config.ts +0 -50
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/forward-ref.ts","../src/DI/token.ts","../src/utils/logger.ts","../src/DI/injector-explorer.ts","../src/DI/app-injector.ts","../src/non-electron-process.ts","../src/internal/exceptions.ts","../src/decorators/injectable.decorator.ts"],"sourcesContent":["/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport { Type } from \"./types\";\r\n\r\n/**\r\n * A function that returns a type.\r\n * Used for forward references to types that are not yet defined.\r\n */\r\nexport interface ForwardRefFn<T = any> {\r\n (): Type<T>;\r\n}\r\n\r\n/**\r\n * A wrapper class for forward referenced types.\r\n */\r\nexport class ForwardReference<T = any> {\r\n constructor(public readonly forwardRefFn: ForwardRefFn<T>) {}\r\n}\r\n\r\n/**\r\n * Creates a forward reference to a type.\r\n * @param fn A function that returns the type.\r\n * @returns A ForwardReference instance.\r\n */\r\nexport function forwardRef<T = any>(fn: ForwardRefFn<T>): ForwardReference<T> {\r\n return new ForwardReference(fn);\r\n}\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport { Type } from '../utils/types';\r\n\r\n/**\r\n * A DI token uniquely identifies a dependency.\r\n * It can wrap a class (Type<T>) or be a named symbol token.\r\n *\r\n * Using tokens instead of reflect-metadata means dependencies are\r\n * declared explicitly — no magic type inference, no emitDecoratorMetadata.\r\n *\r\n * @example\r\n * // Class token (most common)\r\n * const MY_SERVICE = token(MyService);\r\n *\r\n * // Named symbol token (for interfaces or non-class values)\r\n * const DB_URL = token<string>('DB_URL');\r\n */\r\nexport class Token<T> {\r\n public readonly description: string;\r\n\r\n constructor(\r\n public readonly target: Type<T> | string,\r\n ) {\r\n this.description = typeof target === 'string' ? target : target.name;\r\n }\r\n\r\n public toString(): string {\r\n return `Token(${this.description})`;\r\n }\r\n}\r\n\r\n/**\r\n * Creates a DI token for a class type or a named value.\r\n *\r\n * @example\r\n * export const MY_SERVICE = token(MyService);\r\n * export const DB_URL = token<string>('DB_URL');\r\n */\r\nexport function token<T>(target: Type<T> | string): Token<T> {\r\n return new Token<T>(target);\r\n}\r\n\r\n/**\r\n * The key used to look up a class token in the registry.\r\n * For class tokens, the key is the class constructor itself.\r\n * For named tokens, the key is the Token instance.\r\n */\r\nexport type TokenKey<T = unknown> = Type<T> | Token<T>;\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport * as fs from 'fs';\r\nimport * as path from 'path';\r\n\r\n/**\r\n * Logger is a utility class for logging messages to the console.\r\n */\r\nexport type LogLevel =\r\n | 'debug'\r\n | 'comment'\r\n | 'log'\r\n | 'info'\r\n | 'warn'\r\n | 'error'\r\n | 'critical'\r\n;\r\n\r\ninterface FileLogState {\r\n queue: string[];\r\n isWriting: boolean;\r\n}\r\n\r\n\r\n\r\n/**\r\n * Returns a formatted timestamp for logging.\r\n */\r\nfunction getPrettyTimestamp(): string {\r\n const now = new Date();\r\n return `${now.getDate().toString().padStart(2, '0')}/${(now.getMonth() + 1).toString().padStart(2, '0')}/${now.getFullYear()}`\r\n + ` ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`;\r\n}\r\n\r\n/**\r\n * Generates a log prefix for the console output.\r\n * @param callee - The name of the function or class that is logging the message.\r\n * @param messageType - The type of message being logged (e.g., 'log', 'info', 'warn', 'error', 'debug').\r\n * @param color - The color to use for the log message.\r\n * @returns A formatted string that includes the timestamp, process ID, message type, and callee name.\r\n */\r\nfunction getLogPrefix(callee: string, messageType: string, color?: string): string {\r\n const timestamp = getPrettyTimestamp();\r\n\r\n const spaces = \" \".repeat(10 - messageType.length);\r\n\r\n let colReset = Logger.colors.initial;\r\n let colCallee = Logger.colors.yellow;\r\n\r\n if(color === undefined) {\r\n color = \"\";\r\n colReset = \"\";\r\n colCallee = \"\";\r\n }\r\n\r\n return `${color}[APP] ${process.pid} - ${colReset}`\r\n + `${timestamp}${spaces}`\r\n + `${color}${messageType.toUpperCase()}${colReset} `\r\n + `${colCallee}[${callee}]${colReset}`;\r\n}\r\n\r\n/**\r\n * Formats an object into a string representation for logging.\r\n * It converts the object to JSON and adds indentation for readability.\r\n * @param prefix - The prefix to use for the formatted object.\r\n * @param arg - The object to format.\r\n * @returns A formatted string representation of the object, with each line prefixed by the specified prefix.\r\n */\r\nfunction formatObject(prefix: string, arg: object, enableColor: boolean = true): string {\r\n const json = JSON.stringify(arg, null, 2);\r\n\r\n let colStart = \"\";\r\n let colLine = \"\";\r\n let colReset = \"\";\r\n\r\n if(enableColor) {\r\n colStart = Logger.colors.darkGrey;\r\n colLine = Logger.colors.grey;\r\n colReset = Logger.colors.initial;\r\n }\r\n\r\n const prefixedJson = json\r\n .split('\\n')\r\n .map((line, idx) => idx === 0 ? `${colStart}${line}` : `${prefix} ${colLine}${line}`)\r\n .join('\\n') + colReset;\r\n\r\n return prefixedJson;\r\n}\r\n\r\n/**\r\n * Formats the arguments for logging.\r\n * It colors strings and formats objects with indentation.\r\n * This function is used to prepare the arguments for console output.\r\n * @param prefix - The prefix to use for the formatted arguments.\r\n * @param args - The arguments to format.\r\n * @param color - The color to use for the formatted arguments.\r\n * @returns An array of formatted arguments, where strings are colored and objects are formatted with indentation.\r\n */\r\nfunction formattedArgs(prefix: string, args: any[], color?: string): any[] {\r\n let colReset = Logger.colors.initial;\r\n\r\n if(color === undefined) {\r\n color = \"\";\r\n colReset = \"\";\r\n }\r\n\r\n return args.map(arg => {\r\n if(typeof arg === \"string\") {\r\n return `${color}${arg}${colReset}`;\r\n }\r\n\r\n else if(typeof arg === \"object\") {\r\n return formatObject(prefix, arg, color !== \"\");\r\n }\r\n\r\n return arg;\r\n });\r\n}\r\n\r\n/**\r\n * Gets the name of the caller function or class from the stack trace.\r\n * This function is used to determine the context of the log message.\r\n * @returns The name of the caller function or class.\r\n */\r\nfunction getCallee(): string {\r\n const stack = new Error().stack?.split('\\n') ?? [];\r\n const caller = stack[3]\r\n ?.trim()\r\n .match(/at (.+?)(?:\\..+)? .+$/)\r\n ?.[1]\r\n ?.replace(\"Object\", \"\")\r\n .replace(/^_/, \"\")\r\n || \"App\";\r\n return caller;\r\n}\r\n\r\n/**\r\n * Checks if the current log level allows logging the specified level.\r\n * This function compares the current log level with the specified level to determine if logging should occur.\r\n * @param level - The log level to check.\r\n * @returns A boolean indicating whether the log level is enabled.\r\n */\r\nfunction canLog(level: LogLevel): boolean {\r\n return logLevels.has(level);\r\n}\r\n\r\n/**\r\n * Writes a log message to a file asynchronously to avoid blocking the event loop.\r\n * It batches messages if writing is already in progress.\r\n * @param filepath - The path to the log file.\r\n */\r\nfunction processLogQueue(filepath: string): void {\r\n const state = fileStates.get(filepath);\r\n\r\n if(!state || state.isWriting || state.queue.length === 0) {\r\n return;\r\n }\r\n\r\n state.isWriting = true;\r\n\r\n // Optimization: Grab all pending messages to write in one go\r\n const messagesToWrite = state.queue.join('\\n') + '\\n';\r\n state.queue = []; // Clear the queue immediately\r\n\r\n const dir = path.dirname(filepath);\r\n\r\n // Using async IO to allow other operations\r\n fs.mkdir(dir, { recursive: true }, (err) => {\r\n if(err) {\r\n console.error(`[Logger] Failed to create directory ${dir}`, err);\r\n state.isWriting = false;\r\n return;\r\n }\r\n\r\n fs.appendFile(filepath, messagesToWrite, { encoding: \"utf-8\" }, (err) => {\r\n state.isWriting = false;\r\n\r\n if(err) {\r\n console.error(`[Logger] Failed to write log to ${filepath}`, err);\r\n }\r\n\r\n // If new messages arrived while we were writing, process them now\r\n if(state.queue.length > 0) {\r\n processLogQueue(filepath);\r\n }\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Adds a message to the file queue and triggers processing.\r\n */\r\nfunction enqueue(filepath: string, message: string): void {\r\n if(!fileStates.has(filepath)) {\r\n fileStates.set(filepath, { queue: [], isWriting: false });\r\n }\r\n\r\n const state = fileStates.get(filepath)!;\r\n state.queue.push(message);\r\n\r\n processLogQueue(filepath);\r\n}\r\n\r\n/**\r\n *\r\n */\r\nfunction output(level: LogLevel, args: any[]): void {\r\n if(!canLog(level)) {\r\n return;\r\n }\r\n\r\n const callee = getCallee();\r\n\r\n {\r\n const prefix = getLogPrefix(callee, level, logLevelColors[level]);\r\n const data = formattedArgs(prefix, args, logLevelColors[level]);\r\n\r\n logLevelChannel[level](prefix, ...data);\r\n }\r\n\r\n {\r\n const prefix = getLogPrefix(callee, level);\r\n const data = formattedArgs(prefix, args);\r\n\r\n const filepath = fileSettings.get(level)?.filepath;\r\n\r\n if(filepath) {\r\n const message = prefix + \" \" + data.join(\" \").replace(/\\x1b\\[[0-9;]*m/g, ''); // Remove ANSI codes\r\n enqueue(filepath, message);\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\nexport namespace Logger {\r\n\r\n /**\r\n * Sets the log level for the logger.\r\n * This function allows you to change the log level dynamically at runtime.\r\n * This won't affect the startup logs.\r\n *\r\n * If the parameter is a single LogLevel, all log levels with equal or higher severity will be enabled.\r\n\r\n * If the parameter is an array of LogLevels, only the specified levels will be enabled.\r\n *\r\n * @param level Sets the log level for the logger.\r\n */\r\n export function setLogLevel(level: LogLevel | LogLevel[]): void {\r\n logLevels.clear();\r\n\r\n if(Array.isArray(level)) {\r\n for(const lvl of level) {\r\n logLevels.add(lvl);\r\n }\r\n }\r\n else {\r\n const targetRank = logLevelRank[level];\r\n\r\n for(const [lvl, rank] of Object.entries(logLevelRank) as [LogLevel, number][]) {\r\n if(rank >= targetRank) {\r\n logLevels.add(lvl);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level LOG.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function log(...args: any[]): void {\r\n output(\"log\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level INFO.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function info(...args: any[]): void {\r\n output(\"info\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level WARN.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function warn(...args: any[]): void {\r\n output(\"warn\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level ERROR.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function error(...args: any[]): void {\r\n output(\"error\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level ERROR and a grey color scheme.\r\n */\r\n export function errorStack(...args: any[]): void {\r\n output(\"error\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level DEBUG.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function debug(...args: any[]): void {\r\n output(\"debug\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level COMMENT.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function comment(...args: any[]): void {\r\n output(\"comment\", args);\r\n }\r\n\r\n /**\r\n * Logs a message to the console with log level CRITICAL.\r\n * This function formats the message with a timestamp, process ID, and the name of the caller function or class.\r\n * It uses different colors for different log levels to enhance readability.\r\n * @param args The arguments to log.\r\n */\r\n export function critical(...args: any[]): void {\r\n output(\"critical\", args);\r\n }\r\n\r\n /**\r\n * Enables logging to a file output for the specified log levels.\r\n * @param filepath The path to the log file.\r\n * @param levels The log levels to enable file logging for. Defaults to all levels.\r\n */\r\n export function enableFileLogging(filepath: string, levels: LogLevel[] = [\"debug\", \"comment\", \"log\", \"info\", \"warn\", \"error\", \"critical\"]): void {\r\n for(const level of levels) {\r\n fileSettings.set(level, { filepath });\r\n }\r\n }\r\n\r\n /**\r\n * Disables logging to a file output for the specified log levels.\r\n * @param levels The log levels to disable file logging for. Defaults to all levels.\r\n */\r\n export function disableFileLogging(levels: LogLevel[] = [\"debug\", \"comment\", \"log\", \"info\", \"warn\", \"error\", \"critical\"]): void {\r\n for(const level of levels) {\r\n fileSettings.delete(level);\r\n }\r\n }\r\n\r\n\r\n export const colors = {\r\n black: \"\\x1b[0;30m\",\r\n grey: \"\\x1b[0;37m\",\r\n red: \"\\x1b[0;31m\",\r\n green: \"\\x1b[0;32m\",\r\n brown: \"\\x1b[0;33m\",\r\n blue: \"\\x1b[0;34m\",\r\n purple: \"\\x1b[0;35m\",\r\n\r\n darkGrey: \"\\x1b[1;30m\",\r\n lightRed: \"\\x1b[1;31m\",\r\n lightGreen: \"\\x1b[1;32m\",\r\n yellow: \"\\x1b[1;33m\",\r\n lightBlue: \"\\x1b[1;34m\",\r\n magenta: \"\\x1b[1;35m\",\r\n cyan: \"\\x1b[1;36m\",\r\n white: \"\\x1b[1;37m\",\r\n\r\n initial: \"\\x1b[0m\"\r\n };\r\n}\r\n\r\n\r\nconst fileSettings: Map<LogLevel, { filepath: string }> = new Map();\r\nconst fileStates: Map<string, FileLogState> = new Map(); // filepath -> state\r\n\r\nconst logLevels: Set<LogLevel> = new Set();\r\n\r\nconst logLevelRank: Record<LogLevel, number> = {\r\n debug: 0,\r\n comment: 1,\r\n log: 2,\r\n info: 3,\r\n warn: 4,\r\n error: 5,\r\n critical: 6,\r\n};\r\n\r\nconst logLevelColors: Record<LogLevel, string> = {\r\n debug: Logger.colors.purple,\r\n comment: Logger.colors.grey,\r\n log: Logger.colors.green,\r\n info: Logger.colors.blue,\r\n warn: Logger.colors.brown,\r\n error: Logger.colors.red,\r\n critical: Logger.colors.lightRed,\r\n};\r\n\r\nconst logLevelChannel: Record<LogLevel, (message?: any, ...optionalParams: any[]) => void> = {\r\n debug: console.debug,\r\n comment: console.debug,\r\n log: console.log,\r\n info: console.info,\r\n warn: console.warn,\r\n error: console.error,\r\n critical: console.error,\r\n};\r\n\r\n\r\nLogger.setLogLevel(\"debug\");\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport { Lifetime, RootInjector } from './app-injector';\r\nimport { TokenKey } from './token';\r\nimport { Type } from '../utils/types';\r\nimport { Logger } from '../utils/logger';\r\nimport { Guard } from '../decorators/guards.decorator';\r\nimport { Middleware } from '../decorators/middleware.decorator';\r\n\r\nexport interface PendingRegistration {\r\n key: TokenKey;\r\n implementation: Type<unknown>;\r\n lifetime: Lifetime;\r\n deps: ReadonlyArray<TokenKey>;\r\n isController: boolean;\r\n pathPrefix?: string;\r\n}\r\n\r\n/**\r\n * Callback invoked for each controller registration discovered during flush.\r\n * Decouples InjectorExplorer from the Router to avoid circular imports.\r\n */\r\nexport type ControllerRegistrar = (\r\n controllerClass: Type<unknown>,\r\n pathPrefix: string,\r\n routeGuards: Guard[],\r\n routeMiddlewares: Middleware[],\r\n) => void;\r\n\r\n/**\r\n * InjectorExplorer accumulates registrations emitted by decorators\r\n * at import time, then flushes them in two phases (bind → resolve)\r\n * once bootstrapApplication triggers processing.\r\n *\r\n * Because deps are now explicit arrays (no reflect-metadata), this class\r\n * no longer needs to introspect constructor parameter types.\r\n */\r\nexport class InjectorExplorer {\r\n private static readonly pending: PendingRegistration[] = [];\r\n private static processed = false;\r\n private static accumulating = false;\r\n private static loadingLock: Promise<void> = Promise.resolve();\r\n private static controllerRegistrar: ControllerRegistrar | null = null;\r\n\r\n // -------------------------------------------------------------------------\r\n // Public API\r\n // -------------------------------------------------------------------------\r\n\r\n /**\r\n * Sets the callback used to register controllers.\r\n * Must be called once before processPending (typically by bootstrapApplication).\r\n */\r\n public static setControllerRegistrar(registrar: ControllerRegistrar): void {\r\n InjectorExplorer.controllerRegistrar = registrar;\r\n }\r\n\r\n public static enqueue(reg: PendingRegistration): void {\r\n if (InjectorExplorer.processed && !InjectorExplorer.accumulating) {\r\n InjectorExplorer._registerImmediate(reg);\r\n return;\r\n }\r\n InjectorExplorer.pending.push(reg);\r\n }\r\n\r\n /**\r\n * Two-phase flush of all pending registrations collected at startup.\r\n * Called by bootstrapApplication after app.whenReady().\r\n */\r\n public static processPending(singletonOverrides?: Map<TokenKey, unknown>): void {\r\n const queue = [...InjectorExplorer.pending];\r\n InjectorExplorer.pending.length = 0;\r\n\r\n InjectorExplorer._phaseOne(queue);\r\n InjectorExplorer._phaseTwo(queue, singletonOverrides);\r\n\r\n InjectorExplorer.processed = true;\r\n }\r\n\r\n /** Enters accumulation mode for lazy-loaded batches. */\r\n public static beginAccumulate(): void {\r\n InjectorExplorer.accumulating = true;\r\n }\r\n\r\n /**\r\n * Exits accumulation mode and flushes queued registrations\r\n * with the same two-phase guarantee as processPending.\r\n * Serialised through a lock to prevent concurrent lazy loads from corrupting the queue.\r\n */\r\n public static flushAccumulated(\r\n routeGuards: Guard[] = [],\r\n routeMiddlewares: Middleware[] = [],\r\n pathPrefix = '',\r\n ): Promise<void> {\r\n InjectorExplorer.loadingLock = InjectorExplorer.loadingLock.then(() => {\r\n InjectorExplorer.accumulating = false;\r\n const queue = [...InjectorExplorer.pending];\r\n InjectorExplorer.pending.length = 0;\r\n InjectorExplorer._phaseOne(queue);\r\n\r\n // Stamp the path prefix on controller registrations\r\n for (const reg of queue) {\r\n if (reg.isController) reg.pathPrefix = pathPrefix;\r\n }\r\n\r\n InjectorExplorer._phaseTwo(queue, undefined, routeGuards, routeMiddlewares);\r\n });\r\n\r\n return InjectorExplorer.loadingLock;\r\n }\r\n\r\n /**\r\n * Returns a Promise that resolves once all pending flushAccumulated calls\r\n * have completed. Useful for awaiting lazy-load serialisation.\r\n */\r\n public static waitForFlush(): Promise<void> {\r\n return InjectorExplorer.loadingLock;\r\n }\r\n\r\n /**\r\n * Resets the explorer state. Intended for tests only.\r\n */\r\n public static reset(): void {\r\n InjectorExplorer.pending.length = 0;\r\n InjectorExplorer.processed = false;\r\n InjectorExplorer.accumulating = false;\r\n InjectorExplorer.loadingLock = Promise.resolve();\r\n InjectorExplorer.controllerRegistrar = null;\r\n }\r\n\r\n // -------------------------------------------------------------------------\r\n // Private helpers\r\n // -------------------------------------------------------------------------\r\n\r\n /** Phase 1: register all bindings without instantiating anything. */\r\n private static _phaseOne(queue: PendingRegistration[]): void {\r\n for (const reg of queue) {\r\n RootInjector.register(reg.key, reg.implementation, reg.lifetime, reg.deps);\r\n }\r\n }\r\n\r\n /** Phase 2: validate deps, resolve singletons and register controllers via the registrar callback. */\r\n private static _phaseTwo(\r\n queue: PendingRegistration[],\r\n overrides?: Map<TokenKey, unknown>,\r\n routeGuards: Guard[] = [],\r\n routeMiddlewares: Middleware[] = [],\r\n ): void {\r\n // Early dependency validation: warn about deps that have no binding\r\n for (const reg of queue) {\r\n for (const dep of reg.deps) {\r\n if (!RootInjector.bindings.has(dep as any) && !RootInjector.singletons.has(dep as any)) {\r\n Logger.warn(`[Noxus DI] \"${reg.implementation.name}\" declares dep \"${(dep as any).name ?? dep}\" which has no binding`);\r\n }\r\n }\r\n }\r\n\r\n for (const reg of queue) {\r\n // Apply value overrides (e.g. singleton instances provided via bootstrapApplication config)\r\n if (overrides?.has(reg.key)) {\r\n const override = overrides.get(reg.key);\r\n RootInjector.singletons.set(reg.key as any, override);\r\n Logger.log(`Registered ${reg.implementation.name} as singleton (overridden)`);\r\n continue;\r\n }\r\n\r\n if (reg.lifetime === 'singleton') {\r\n RootInjector.resolve(reg.key);\r\n }\r\n\r\n if (reg.isController) {\r\n if (!InjectorExplorer.controllerRegistrar) {\r\n throw new Error('[Noxus DI] No controller registrar set. Call InjectorExplorer.setControllerRegistrar() before processing.');\r\n }\r\n InjectorExplorer.controllerRegistrar(\r\n reg.implementation,\r\n reg.pathPrefix ?? '',\r\n routeGuards,\r\n routeMiddlewares,\r\n );\r\n } else if (reg.lifetime !== 'singleton') {\r\n Logger.log(`Registered ${reg.implementation.name} as ${reg.lifetime}`);\r\n }\r\n }\r\n }\r\n\r\n private static _registerImmediate(reg: PendingRegistration): void {\r\n RootInjector.register(reg.key, reg.implementation, reg.lifetime, reg.deps);\r\n\r\n if (reg.lifetime === 'singleton') {\r\n RootInjector.resolve(reg.key);\r\n }\r\n\r\n if (reg.isController && InjectorExplorer.controllerRegistrar) {\r\n InjectorExplorer.controllerRegistrar(reg.implementation, '', [], []);\r\n }\r\n }\r\n}\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport { ForwardReference } from '../utils/forward-ref';\r\nimport { Type } from '../utils/types';\r\nimport { Token, TokenKey } from './token';\r\n\r\n/**\r\n * Lifetime of a binding in the DI container.\r\n * - singleton: created once, shared for the lifetime of the app.\r\n * - scope: created once per request scope.\r\n * - transient: new instance every time it is resolved.\r\n */\r\nexport type Lifetime = 'singleton' | 'scope' | 'transient';\r\n\r\n/**\r\n * Internal representation of a registered binding.\r\n */\r\nexport interface IBinding<T = unknown> {\r\n lifetime: Lifetime;\r\n implementation: Type<T>;\r\n /** Explicit constructor dependencies, declared by the class itself. */\r\n deps: ReadonlyArray<TokenKey>;\r\n instance?: T;\r\n}\r\n\r\nfunction keyOf<T>(k: TokenKey<T>): Type<T> | Token<T> {\r\n return k;\r\n}\r\n\r\n/**\r\n * AppInjector is the core DI container.\r\n * It no longer uses reflect-metadata — all dependency information\r\n * comes from explicitly declared `deps` arrays on each binding.\r\n */\r\nexport class AppInjector {\r\n public readonly bindings = new Map<Type<unknown> | Token<unknown>, IBinding<unknown>>();\r\n public readonly singletons = new Map<Type<unknown> | Token<unknown>, unknown>();\r\n public readonly scoped = new Map<Type<unknown> | Token<unknown>, unknown>();\r\n\r\n constructor(public readonly name: string | null = null) {}\r\n\r\n /**\r\n * Creates a child scope for per-request lifetime resolution.\r\n */\r\n public createScope(): AppInjector {\r\n const scope = new AppInjector();\r\n (scope as any).bindings = this.bindings;\r\n (scope as any).singletons = this.singletons;\r\n return scope;\r\n }\r\n\r\n /**\r\n * Registers a binding explicitly.\r\n */\r\n public register<T>(\r\n key: TokenKey<T>,\r\n implementation: Type<T>,\r\n lifetime: Lifetime,\r\n deps: ReadonlyArray<TokenKey> = [],\r\n ): void {\r\n const k = keyOf(key) as TokenKey<unknown>;\r\n if (!this.bindings.has(k)) {\r\n this.bindings.set(k, { lifetime, implementation: implementation as Type<unknown>, deps });\r\n }\r\n }\r\n\r\n /**\r\n * Resolves a dependency by token or class reference.\r\n */\r\n public resolve<T>(target: TokenKey<T> | ForwardReference<T>): T {\r\n if (target instanceof ForwardReference) {\r\n return this._resolveForwardRef(target);\r\n }\r\n\r\n const k = keyOf(target) as TokenKey<unknown>;\r\n\r\n if (this.singletons.has(k)) {\r\n return this.singletons.get(k) as T;\r\n }\r\n\r\n const binding = this.bindings.get(k);\r\n\r\n if (!binding) {\r\n const name = target instanceof Token\r\n ? target.description\r\n : (target as Type<unknown>).name\r\n ?? 'unknown';\r\n\r\n throw new Error(\r\n `[Noxus DI] No binding found for \"${name}\".\\n`\r\n + `Did you forget to declare it in @Injectable({ deps }) or in bootstrapApplication({ singletons })?`,\r\n );\r\n }\r\n\r\n switch (binding.lifetime) {\r\n case 'transient':\r\n return this._instantiate(binding) as T;\r\n\r\n case 'scope': {\r\n if (this.scoped.has(k)) return this.scoped.get(k) as T;\r\n const inst = this._instantiate(binding);\r\n this.scoped.set(k, inst);\r\n return inst as T;\r\n }\r\n\r\n case 'singleton': {\r\n if (this.singletons.has(k)) return this.singletons.get(k) as T;\r\n const inst = this._instantiate(binding);\r\n this.singletons.set(k, inst);\r\n if (binding.instance === undefined) {\r\n (binding as IBinding<unknown>).instance = inst as unknown;\r\n }\r\n return inst as T;\r\n }\r\n }\r\n }\r\n\r\n // -------------------------------------------------------------------------\r\n\r\n private _resolveForwardRef<T>(ref: ForwardReference<T>): T {\r\n let resolved: T | undefined;\r\n return new Proxy({} as object, {\r\n get: (_obj, prop, receiver) => {\r\n resolved ??= this.resolve(ref.forwardRefFn()) as T;\r\n const value = Reflect.get(resolved as object, prop, receiver);\r\n return typeof value === 'function' ? (value as Function).bind(resolved) : value;\r\n },\r\n set: (_obj, prop, value, receiver) => {\r\n resolved ??= this.resolve(ref.forwardRefFn()) as T;\r\n return Reflect.set(resolved as object, prop, value, receiver);\r\n },\r\n getPrototypeOf: () => {\r\n resolved ??= this.resolve(ref.forwardRefFn()) as T;\r\n return Object.getPrototypeOf(resolved);\r\n },\r\n }) as T;\r\n }\r\n\r\n private _instantiate<T>(binding: IBinding<T>): T {\r\n const resolvedDeps = binding.deps.map((dep) => this.resolve(dep));\r\n return new binding.implementation(...resolvedDeps) as T;\r\n }\r\n}\r\n\r\n/**\r\n * The global root injector. All singletons live here.\r\n */\r\nexport const RootInjector = new AppInjector('root');\r\n\r\n/**\r\n * Resets the root injector to a clean state.\r\n * **Intended for testing only** — clears all bindings, singletons, and scoped instances\r\n * so that each test can start from a fresh DI container without restarting the process.\r\n */\r\nexport function resetRootInjector(): void {\r\n RootInjector.bindings.clear();\r\n RootInjector.singletons.clear();\r\n RootInjector.scoped.clear();\r\n // Lazy import to avoid circular dependency (InjectorExplorer → app-injector → InjectorExplorer)\r\n const { InjectorExplorer } = require('./injector-explorer') as typeof import('./injector-explorer');\r\n InjectorExplorer.reset();\r\n}\r\n\r\n/**\r\n * Convenience function: resolve a token from the root injector.\r\n */\r\nexport function inject<T>(t: TokenKey<T> | ForwardReference<T>): T {\r\n return RootInjector.resolve(t);\r\n}\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\n/**\r\n * Entry point for nodeJS non-electron process consumers.\r\n * For instance, if main process creates a child process that\r\n * wants to use Logger and DI.\r\n * Child processes must not try to communicate with the renderer\r\n * process.\r\n * order of exports here matters and can affect module resolution.\r\n * Please be cautious when modifying.\r\n */\r\n\r\nexport * from './DI/app-injector';\r\nexport * from './internal/exceptions';\r\nexport * from './decorators/injectable.decorator';\r\nexport * from './utils/logger';\r\nexport * from './utils/types';\r\nexport * from './utils/forward-ref';\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nexport class ResponseException extends Error {\r\n public readonly status: number = 0;\r\n\r\n constructor(message?: string);\r\n constructor(statusCode?: number, message?: string);\r\n constructor(statusOrMessage?: number | string, message?: string) {\r\n let statusCode: number | undefined;\r\n \r\n if(typeof statusOrMessage === 'number') {\r\n statusCode = statusOrMessage;\r\n }\r\n else if(typeof statusOrMessage === 'string') {\r\n message = statusOrMessage;\r\n }\r\n\r\n super(message ?? \"\");\r\n\r\n if(statusCode !== undefined) {\r\n this.status = statusCode;\r\n }\r\n \r\n this.name = this.constructor.name\r\n .replace(/([A-Z])/g, ' $1');\r\n }\r\n}\r\n\r\n// 4XX\r\nexport class BadRequestException extends ResponseException { public override readonly status = 400; }\r\nexport class UnauthorizedException extends ResponseException { public override readonly status = 401; }\r\nexport class PaymentRequiredException extends ResponseException { public override readonly status = 402; }\r\nexport class ForbiddenException extends ResponseException { public override readonly status = 403; }\r\nexport class NotFoundException extends ResponseException { public override readonly status = 404; }\r\nexport class MethodNotAllowedException extends ResponseException { public override readonly status = 405; }\r\nexport class NotAcceptableException extends ResponseException { public override readonly status = 406; }\r\nexport class RequestTimeoutException extends ResponseException { public override readonly status = 408; }\r\nexport class ConflictException extends ResponseException { public override readonly status = 409; }\r\nexport class UpgradeRequiredException extends ResponseException { public override readonly status = 426; }\r\nexport class TooManyRequestsException extends ResponseException { public override readonly status = 429; }\r\n// 5XX\r\nexport class InternalServerException extends ResponseException { public override readonly status = 500; }\r\nexport class NotImplementedException extends ResponseException { public override readonly status = 501; }\r\nexport class BadGatewayException extends ResponseException { public override readonly status = 502; }\r\nexport class ServiceUnavailableException extends ResponseException { public override readonly status = 503; }\r\nexport class GatewayTimeoutException extends ResponseException { public override readonly status = 504; }\r\nexport class HttpVersionNotSupportedException extends ResponseException { public override readonly status = 505; }\r\nexport class VariantAlsoNegotiatesException extends ResponseException { public override readonly status = 506; }\r\nexport class InsufficientStorageException extends ResponseException { public override readonly status = 507; }\r\nexport class LoopDetectedException extends ResponseException { public override readonly status = 508; }\r\nexport class NotExtendedException extends ResponseException { public override readonly status = 510; }\r\nexport class NetworkAuthenticationRequiredException extends ResponseException { public override readonly status = 511; }\r\nexport class NetworkConnectTimeoutException extends ResponseException { public override readonly status = 599; }\r\n","/**\r\n * @copyright 2025 NoxFly\r\n * @license MIT\r\n * @author NoxFly\r\n */\r\n\r\nimport { Lifetime } from '../DI/app-injector';\r\nimport { InjectorExplorer } from '../DI/injector-explorer';\r\nimport { Token, TokenKey } from '../DI/token';\r\nimport { Type } from '../utils/types';\r\n\r\nexport interface InjectableOptions {\r\n /**\r\n * Lifetime of this injectable.\r\n * @default 'scope'\r\n */\r\n lifetime?: Lifetime;\r\n\r\n /**\r\n * Explicit list of constructor dependencies, in the same order as the constructor parameters.\r\n * Each entry is either a class constructor or a Token created with token().\r\n *\r\n * This replaces reflect-metadata / emitDecoratorMetadata entirely.\r\n *\r\n * @example\r\n * @Injectable({ lifetime: 'singleton', deps: [MyRepo, DB_URL] })\r\n * class MyService {\r\n * constructor(private repo: MyRepo, private dbUrl: string) {}\r\n * }\r\n */\r\n deps?: ReadonlyArray<TokenKey>;\r\n}\r\n\r\n/**\r\n * Marks a class as injectable into the Noxus DI container.\r\n *\r\n * Unlike the v2 @Injectable, this decorator:\r\n * - Does NOT require reflect-metadata or emitDecoratorMetadata.\r\n * - Requires you to declare deps explicitly when the class has constructor parameters.\r\n * - Supports standalone usage — no module declaration needed.\r\n *\r\n * @example\r\n * // No dependencies\r\n * @Injectable()\r\n * class Logger {}\r\n *\r\n * // With dependencies\r\n * @Injectable({ lifetime: 'singleton', deps: [Logger, MyRepo] })\r\n * class MyService {\r\n * constructor(private logger: Logger, private repo: MyRepo) {}\r\n * }\r\n *\r\n * // With a named token\r\n * const DB_URL = token<string>('DB_URL');\r\n *\r\n * @Injectable({ deps: [DB_URL] })\r\n * class DbService {\r\n * constructor(private url: string) {}\r\n * }\r\n */\r\nexport function Injectable(options: InjectableOptions = {}) {\r\n const { lifetime = 'scope', deps = [] } = options;\r\n\r\n return <T extends new (...args: any[]) => unknown>(target: T, _context: ClassDecoratorContext): T | void => {\r\n const key = target as unknown as Type<unknown>;\r\n\r\n InjectorExplorer.enqueue({\r\n key,\r\n implementation: key,\r\n lifetime,\r\n deps,\r\n isController: false,\r\n });\r\n };\r\n}\r\n\r\nexport { Token, TokenKey };\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BO,SAAS,WAAoB,IAA0C;AAC1E,SAAO,IAAI,iBAAiB,EAAE;AAClC;AA9BA,IAmBa;AAnBb;AAAA;AAAA;AAmBO,IAAM,oBAAN,MAAM,kBAA0B;AAAA,MACnC,YAA4B,cAA+B;AAA/B;AAAA,MAAgC;AAAA,IAChE;AAFuC;AAAhC,IAAM,mBAAN;AASS;AAAA;AAAA;;;AC5BhB,IAsBa;AAtBb;AAAA;AAAA;AAsBO,IAAM,SAAN,MAAM,OAAS;AAAA,MAGlB,YACoB,QAClB;AADkB;AAHpB,4BAAgB;AAKZ,aAAK,cAAc,OAAO,WAAW,WAAW,SAAS,OAAO;AAAA,MACpE;AAAA,MAEO,WAAmB;AACtB,eAAO,SAAS,KAAK,WAAW;AAAA,MACpC;AAAA,IACJ;AAZsB;AAAf,IAAM,QAAN;AAAA;AAAA;;;AChBP,YAAY,QAAQ;AACpB,YAAY,UAAU;AAyBtB,SAAS,qBAA6B;AAClC,QAAM,MAAM,oBAAI,KAAK;AACrB,SAAO,GAAG,IAAI,QAAQ,EAAE,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B,UAAS;AAAA;AAAK;AAAzC;AAAtD,IAAM,wBAAN;AACA,IAAM,wBAAN,MAAM,8BAA6B,kBAAkB;AAAA,EAArD;AAAA;AAAuD,wBAAyB,UAAS;AAAA;AAAK;AAAzC;AAArD,IAAM,uBAAN;AACA,IAAM,0CAAN,MAAM,gDAA+C,kBAAkB;AAAA,EAAvE;AAAA;AAAyE,wBAAyB,UAAS;AAAA;AAAK;AAAzC;AAAvE,IAAM,yCAAN;AACA,IAAM,kCAAN,MAAM,wCAAuC,kBAAkB;AAAA,EAA/D;AAAA;AAAiE,wBAAyB,UAAS;AAAA;AAAK;AAAzC;AAA/D,IAAM,iCAAN;;;ACjDP;AACA;AAoDO,SAAS,WAAW,UAA6B,CAAC,GAAG;AACxD,QAAM,EAAE,WAAW,SAAS,OAAO,CAAC,EAAE,IAAI;AAE1C,SAAO,CAA4C,QAAW,aAA8C;AACxG,UAAM,MAAM;AAEZ,qBAAiB,QAAQ;AAAA,MACrB;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,MACA;AAAA,MACA,cAAc;AAAA,IAClB,CAAC;AAAA,EACL;AACJ;AAdgB;;;AFzChB;AAEA;","names":["err","Logger","InjectorExplorer"]}
|
package/dist/main.d.mts
CHANGED
|
@@ -119,6 +119,12 @@ declare class AppInjector {
|
|
|
119
119
|
* The global root injector. All singletons live here.
|
|
120
120
|
*/
|
|
121
121
|
declare const RootInjector: AppInjector;
|
|
122
|
+
/**
|
|
123
|
+
* Resets the root injector to a clean state.
|
|
124
|
+
* **Intended for testing only** — clears all bindings, singletons, and scoped instances
|
|
125
|
+
* so that each test can start from a fresh DI container without restarting the process.
|
|
126
|
+
*/
|
|
127
|
+
declare function resetRootInjector(): void;
|
|
122
128
|
/**
|
|
123
129
|
* Convenience function: resolve a token from the root injector.
|
|
124
130
|
*/
|
|
@@ -154,11 +160,11 @@ interface IRouteMetadata {
|
|
|
154
160
|
middlewares: Middleware[];
|
|
155
161
|
}
|
|
156
162
|
declare function getRouteMetadata(target: object): IRouteMetadata[];
|
|
157
|
-
declare const Get: (path: string, options?: IRouteOptions) =>
|
|
158
|
-
declare const Post: (path: string, options?: IRouteOptions) =>
|
|
159
|
-
declare const Put: (path: string, options?: IRouteOptions) =>
|
|
160
|
-
declare const Patch: (path: string, options?: IRouteOptions) =>
|
|
161
|
-
declare const Delete: (path: string, options?: IRouteOptions) =>
|
|
163
|
+
declare const Get: (path: string, options?: IRouteOptions) => (value: Function, context: ClassMethodDecoratorContext) => void;
|
|
164
|
+
declare const Post: (path: string, options?: IRouteOptions) => (value: Function, context: ClassMethodDecoratorContext) => void;
|
|
165
|
+
declare const Put: (path: string, options?: IRouteOptions) => (value: Function, context: ClassMethodDecoratorContext) => void;
|
|
166
|
+
declare const Patch: (path: string, options?: IRouteOptions) => (value: Function, context: ClassMethodDecoratorContext) => void;
|
|
167
|
+
declare const Delete: (path: string, options?: IRouteOptions) => (value: Function, context: ClassMethodDecoratorContext) => void;
|
|
162
168
|
|
|
163
169
|
|
|
164
170
|
/**
|
|
@@ -172,10 +178,11 @@ declare class Request {
|
|
|
172
178
|
readonly id: string;
|
|
173
179
|
readonly method: HttpMethod;
|
|
174
180
|
readonly path: string;
|
|
175
|
-
readonly body:
|
|
181
|
+
readonly body: unknown;
|
|
176
182
|
readonly context: AppInjector;
|
|
177
183
|
readonly params: Record<string, string>;
|
|
178
|
-
|
|
184
|
+
readonly query: Record<string, unknown>;
|
|
185
|
+
constructor(event: Electron.MessageEvent, senderId: number, id: string, method: HttpMethod, path: string, body: unknown, query?: Record<string, unknown>);
|
|
179
186
|
}
|
|
180
187
|
/**
|
|
181
188
|
* The IRequest interface defines the structure of a request object.
|
|
@@ -188,12 +195,14 @@ interface IRequest<TBody = unknown> {
|
|
|
188
195
|
path: string;
|
|
189
196
|
method: HttpMethod;
|
|
190
197
|
body?: TBody;
|
|
198
|
+
query?: Record<string, unknown>;
|
|
191
199
|
}
|
|
192
200
|
interface IBatchRequestItem<TBody = unknown> {
|
|
193
201
|
requestId?: string;
|
|
194
202
|
path: string;
|
|
195
203
|
method: AtomicHttpMethod;
|
|
196
204
|
body?: TBody;
|
|
205
|
+
query?: Record<string, unknown>;
|
|
197
206
|
}
|
|
198
207
|
interface IBatchRequestPayload {
|
|
199
208
|
requests: IBatchRequestItem[];
|
|
@@ -249,9 +258,18 @@ declare class Router {
|
|
|
249
258
|
private readonly routes;
|
|
250
259
|
private readonly rootMiddlewares;
|
|
251
260
|
private readonly lazyRoutes;
|
|
261
|
+
private lazyLoadLock;
|
|
252
262
|
registerController(controllerClass: Type<unknown>, pathPrefix: string, routeGuards?: Guard[], routeMiddlewares?: Middleware[]): this;
|
|
253
263
|
registerLazyRoute(pathPrefix: string, load: () => Promise<unknown>, guards?: Guard[], middlewares?: Middleware[]): this;
|
|
254
264
|
defineRootMiddleware(middleware: Middleware): this;
|
|
265
|
+
getRegisteredRoutes(): Array<{
|
|
266
|
+
method: string;
|
|
267
|
+
path: string;
|
|
268
|
+
}>;
|
|
269
|
+
getLazyRoutes(): Array<{
|
|
270
|
+
prefix: string;
|
|
271
|
+
loaded: boolean;
|
|
272
|
+
}>;
|
|
255
273
|
handle(request: Request): Promise<IResponse>;
|
|
256
274
|
private handleAtomic;
|
|
257
275
|
private handleBatch;
|
|
@@ -290,6 +308,11 @@ interface WindowRecord {
|
|
|
290
308
|
window: BrowserWindow;
|
|
291
309
|
id: number;
|
|
292
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* @description
|
|
313
|
+
* The events emitted by WindowManager when windows are created, closed, focused, or blurred.
|
|
314
|
+
*/
|
|
315
|
+
type WindowEvent = 'created' | 'closed' | 'focused' | 'blurred';
|
|
293
316
|
/**
|
|
294
317
|
* WindowManager is a singleton service that centralizes BrowserWindow lifecycle.
|
|
295
318
|
*
|
|
@@ -314,6 +337,7 @@ interface WindowRecord {
|
|
|
314
337
|
*/
|
|
315
338
|
declare class WindowManager {
|
|
316
339
|
private readonly _windows;
|
|
340
|
+
private readonly listeners;
|
|
317
341
|
private _mainWindowId;
|
|
318
342
|
/**
|
|
319
343
|
* Creates a BrowserWindow, optionally performs an animated expand to the
|
|
@@ -347,6 +371,7 @@ declare class WindowManager {
|
|
|
347
371
|
*/
|
|
348
372
|
createSplash(options?: Electron.BrowserWindowConstructorOptions & {
|
|
349
373
|
animationDuration?: number;
|
|
374
|
+
expandToWorkArea?: boolean;
|
|
350
375
|
}): Promise<BrowserWindow>;
|
|
351
376
|
/** Returns all currently open windows. */
|
|
352
377
|
getAll(): BrowserWindow[];
|
|
@@ -371,6 +396,8 @@ declare class WindowManager {
|
|
|
371
396
|
* Broadcasts a message to all open windows.
|
|
372
397
|
*/
|
|
373
398
|
broadcast(channel: string, ...args: unknown[]): void;
|
|
399
|
+
on(event: WindowEvent, handler: (win: BrowserWindow) => void): () => void;
|
|
400
|
+
private _emit;
|
|
374
401
|
private _register;
|
|
375
402
|
/**
|
|
376
403
|
* Animates the window to the full work area of the primary display.
|
|
@@ -380,6 +407,20 @@ declare class WindowManager {
|
|
|
380
407
|
private _expandToWorkArea;
|
|
381
408
|
}
|
|
382
409
|
|
|
410
|
+
interface RendererChannels {
|
|
411
|
+
request: Electron.MessageChannelMain;
|
|
412
|
+
socket: Electron.MessageChannelMain;
|
|
413
|
+
}
|
|
414
|
+
declare class NoxSocket {
|
|
415
|
+
private readonly channels;
|
|
416
|
+
register(senderId: number, requestChannel: Electron.MessageChannelMain, socketChannel: Electron.MessageChannelMain): void;
|
|
417
|
+
get(senderId: number): RendererChannels | undefined;
|
|
418
|
+
unregister(senderId: number): void;
|
|
419
|
+
getSenderIds(): number[];
|
|
420
|
+
emit<TPayload = unknown>(eventName: string, payload?: TPayload, targetSenderIds?: number[]): void;
|
|
421
|
+
emitToRenderer<TPayload = unknown>(senderId: number, eventName: string, payload?: TPayload): boolean;
|
|
422
|
+
}
|
|
423
|
+
|
|
383
424
|
|
|
384
425
|
/**
|
|
385
426
|
* Your application service should implement IApp.
|
|
@@ -409,10 +450,11 @@ interface IApp {
|
|
|
409
450
|
onActivated(): Promise<void>;
|
|
410
451
|
}
|
|
411
452
|
declare class NoxApp {
|
|
412
|
-
private appService;
|
|
413
453
|
private readonly router;
|
|
414
454
|
private readonly socket;
|
|
415
455
|
readonly windowManager: WindowManager;
|
|
456
|
+
private appService;
|
|
457
|
+
constructor(router: Router, socket: NoxSocket, windowManager: WindowManager);
|
|
416
458
|
init(): Promise<this>;
|
|
417
459
|
/**
|
|
418
460
|
* Registers a lazy route. The file behind this prefix is dynamically
|
|
@@ -454,6 +496,107 @@ declare class NoxApp {
|
|
|
454
496
|
private shutdownChannel;
|
|
455
497
|
}
|
|
456
498
|
|
|
499
|
+
/**
|
|
500
|
+
* Logger is a utility class for logging messages to the console.
|
|
501
|
+
*/
|
|
502
|
+
type LogLevel = 'debug' | 'comment' | 'log' | 'info' | 'warn' | 'error' | 'critical';
|
|
503
|
+
declare namespace Logger {
|
|
504
|
+
/**
|
|
505
|
+
* Sets the log level for the logger.
|
|
506
|
+
* This function allows you to change the log level dynamically at runtime.
|
|
507
|
+
* This won't affect the startup logs.
|
|
508
|
+
*
|
|
509
|
+
* If the parameter is a single LogLevel, all log levels with equal or higher severity will be enabled.
|
|
510
|
+
|
|
511
|
+
* If the parameter is an array of LogLevels, only the specified levels will be enabled.
|
|
512
|
+
*
|
|
513
|
+
* @param level Sets the log level for the logger.
|
|
514
|
+
*/
|
|
515
|
+
function setLogLevel(level: LogLevel | LogLevel[]): void;
|
|
516
|
+
/**
|
|
517
|
+
* Logs a message to the console with log level LOG.
|
|
518
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
519
|
+
* It uses different colors for different log levels to enhance readability.
|
|
520
|
+
* @param args The arguments to log.
|
|
521
|
+
*/
|
|
522
|
+
function log(...args: any[]): void;
|
|
523
|
+
/**
|
|
524
|
+
* Logs a message to the console with log level INFO.
|
|
525
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
526
|
+
* It uses different colors for different log levels to enhance readability.
|
|
527
|
+
* @param args The arguments to log.
|
|
528
|
+
*/
|
|
529
|
+
function info(...args: any[]): void;
|
|
530
|
+
/**
|
|
531
|
+
* Logs a message to the console with log level WARN.
|
|
532
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
533
|
+
* It uses different colors for different log levels to enhance readability.
|
|
534
|
+
* @param args The arguments to log.
|
|
535
|
+
*/
|
|
536
|
+
function warn(...args: any[]): void;
|
|
537
|
+
/**
|
|
538
|
+
* Logs a message to the console with log level ERROR.
|
|
539
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
540
|
+
* It uses different colors for different log levels to enhance readability.
|
|
541
|
+
* @param args The arguments to log.
|
|
542
|
+
*/
|
|
543
|
+
function error(...args: any[]): void;
|
|
544
|
+
/**
|
|
545
|
+
* Logs a message to the console with log level ERROR and a grey color scheme.
|
|
546
|
+
*/
|
|
547
|
+
function errorStack(...args: any[]): void;
|
|
548
|
+
/**
|
|
549
|
+
* Logs a message to the console with log level DEBUG.
|
|
550
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
551
|
+
* It uses different colors for different log levels to enhance readability.
|
|
552
|
+
* @param args The arguments to log.
|
|
553
|
+
*/
|
|
554
|
+
function debug(...args: any[]): void;
|
|
555
|
+
/**
|
|
556
|
+
* Logs a message to the console with log level COMMENT.
|
|
557
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
558
|
+
* It uses different colors for different log levels to enhance readability.
|
|
559
|
+
* @param args The arguments to log.
|
|
560
|
+
*/
|
|
561
|
+
function comment(...args: any[]): void;
|
|
562
|
+
/**
|
|
563
|
+
* Logs a message to the console with log level CRITICAL.
|
|
564
|
+
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
565
|
+
* It uses different colors for different log levels to enhance readability.
|
|
566
|
+
* @param args The arguments to log.
|
|
567
|
+
*/
|
|
568
|
+
function critical(...args: any[]): void;
|
|
569
|
+
/**
|
|
570
|
+
* Enables logging to a file output for the specified log levels.
|
|
571
|
+
* @param filepath The path to the log file.
|
|
572
|
+
* @param levels The log levels to enable file logging for. Defaults to all levels.
|
|
573
|
+
*/
|
|
574
|
+
function enableFileLogging(filepath: string, levels?: LogLevel[]): void;
|
|
575
|
+
/**
|
|
576
|
+
* Disables logging to a file output for the specified log levels.
|
|
577
|
+
* @param levels The log levels to disable file logging for. Defaults to all levels.
|
|
578
|
+
*/
|
|
579
|
+
function disableFileLogging(levels?: LogLevel[]): void;
|
|
580
|
+
const colors: {
|
|
581
|
+
black: string;
|
|
582
|
+
grey: string;
|
|
583
|
+
red: string;
|
|
584
|
+
green: string;
|
|
585
|
+
brown: string;
|
|
586
|
+
blue: string;
|
|
587
|
+
purple: string;
|
|
588
|
+
darkGrey: string;
|
|
589
|
+
lightRed: string;
|
|
590
|
+
lightGreen: string;
|
|
591
|
+
yellow: string;
|
|
592
|
+
lightBlue: string;
|
|
593
|
+
magenta: string;
|
|
594
|
+
cyan: string;
|
|
595
|
+
white: string;
|
|
596
|
+
initial: string;
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
|
|
457
600
|
|
|
458
601
|
/**
|
|
459
602
|
* A single route entry in the application routing table.
|
|
@@ -468,10 +611,12 @@ interface RouteDefinition {
|
|
|
468
611
|
* Dynamic import function returning the controller file.
|
|
469
612
|
* The controller is loaded lazily on the first IPC request targeting this prefix.
|
|
470
613
|
*
|
|
614
|
+
* Optional when the route only serves as a parent for `children`.
|
|
615
|
+
*
|
|
471
616
|
* @example
|
|
472
617
|
* load: () => import('./modules/users/users.controller')
|
|
473
618
|
*/
|
|
474
|
-
load
|
|
619
|
+
load?: () => Promise<unknown>;
|
|
475
620
|
/**
|
|
476
621
|
* Guards applied to every action in this controller.
|
|
477
622
|
* Merged with action-level guards.
|
|
@@ -482,6 +627,11 @@ interface RouteDefinition {
|
|
|
482
627
|
* Merged with action-level middlewares.
|
|
483
628
|
*/
|
|
484
629
|
middlewares?: Middleware[];
|
|
630
|
+
/**
|
|
631
|
+
* Nested child routes. Guards and middlewares declared here are
|
|
632
|
+
* inherited (merged) by all children.
|
|
633
|
+
*/
|
|
634
|
+
children?: RouteDefinition[];
|
|
485
635
|
}
|
|
486
636
|
/**
|
|
487
637
|
* Defines the application routing table.
|
|
@@ -490,6 +640,9 @@ interface RouteDefinition {
|
|
|
490
640
|
* This is the single source of truth for routing — no path is declared
|
|
491
641
|
* in @Controller(), preventing duplicate route prefixes across controllers.
|
|
492
642
|
*
|
|
643
|
+
* Supports nested routes via the `children` property. Guards and middlewares
|
|
644
|
+
* from parent entries are inherited (merged) into each child.
|
|
645
|
+
*
|
|
493
646
|
* @example
|
|
494
647
|
* export const routes = defineRoutes([
|
|
495
648
|
* {
|
|
@@ -498,16 +651,17 @@ interface RouteDefinition {
|
|
|
498
651
|
* guards: [authGuard],
|
|
499
652
|
* },
|
|
500
653
|
* {
|
|
501
|
-
* path: '
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
654
|
+
* path: 'admin',
|
|
655
|
+
* guards: [authGuard, adminGuard],
|
|
656
|
+
* children: [
|
|
657
|
+
* { path: 'users', load: () => import('./admin/users.controller') },
|
|
658
|
+
* { path: 'products', load: () => import('./admin/products.controller') },
|
|
659
|
+
* ],
|
|
505
660
|
* },
|
|
506
661
|
* ]);
|
|
507
662
|
*/
|
|
508
663
|
declare function defineRoutes(routes: RouteDefinition[]): RouteDefinition[];
|
|
509
664
|
|
|
510
|
-
|
|
511
665
|
/**
|
|
512
666
|
* A singleton value override: provides an already-constructed instance
|
|
513
667
|
* for a given token, bypassing the DI factory.
|
|
@@ -562,6 +716,15 @@ interface BootstrapConfig {
|
|
|
562
716
|
* ]
|
|
563
717
|
*/
|
|
564
718
|
eagerLoad?: Array<() => Promise<unknown>>;
|
|
719
|
+
/**
|
|
720
|
+
* Controls framework log verbosity.
|
|
721
|
+
* - `'debug'`: all messages (default during development).
|
|
722
|
+
* - `'info'`: info, warn, error, critical only.
|
|
723
|
+
* - `'none'`: completely silent — no framework logs.
|
|
724
|
+
*
|
|
725
|
+
* You can also pass an array of specific log levels to enable.
|
|
726
|
+
*/
|
|
727
|
+
logLevel?: 'debug' | 'info' | 'none' | LogLevel[];
|
|
565
728
|
}
|
|
566
729
|
/**
|
|
567
730
|
* Bootstraps the Noxus application.
|
|
@@ -667,7 +830,7 @@ interface IControllerMetadata {
|
|
|
667
830
|
* getUserById(req: Request) { ... }
|
|
668
831
|
* }
|
|
669
832
|
*/
|
|
670
|
-
declare function Controller(options?: ControllerOptions):
|
|
833
|
+
declare function Controller(options?: ControllerOptions): <T extends new (...args: any[]) => unknown>(target: T, _context: ClassDecoratorContext) => T | void;
|
|
671
834
|
declare function getControllerMetadata(target: object): IControllerMetadata | undefined;
|
|
672
835
|
|
|
673
836
|
|
|
@@ -718,121 +881,6 @@ interface InjectableOptions {
|
|
|
718
881
|
* constructor(private url: string) {}
|
|
719
882
|
* }
|
|
720
883
|
*/
|
|
721
|
-
declare function Injectable(options?: InjectableOptions):
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Logger is a utility class for logging messages to the console.
|
|
725
|
-
*/
|
|
726
|
-
type LogLevel = 'debug' | 'comment' | 'log' | 'info' | 'warn' | 'error' | 'critical';
|
|
727
|
-
declare namespace Logger {
|
|
728
|
-
/**
|
|
729
|
-
* Sets the log level for the logger.
|
|
730
|
-
* This function allows you to change the log level dynamically at runtime.
|
|
731
|
-
* This won't affect the startup logs.
|
|
732
|
-
*
|
|
733
|
-
* If the parameter is a single LogLevel, all log levels with equal or higher severity will be enabled.
|
|
734
|
-
|
|
735
|
-
* If the parameter is an array of LogLevels, only the specified levels will be enabled.
|
|
736
|
-
*
|
|
737
|
-
* @param level Sets the log level for the logger.
|
|
738
|
-
*/
|
|
739
|
-
function setLogLevel(level: LogLevel | LogLevel[]): void;
|
|
740
|
-
/**
|
|
741
|
-
* Logs a message to the console with log level LOG.
|
|
742
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
743
|
-
* It uses different colors for different log levels to enhance readability.
|
|
744
|
-
* @param args The arguments to log.
|
|
745
|
-
*/
|
|
746
|
-
function log(...args: any[]): void;
|
|
747
|
-
/**
|
|
748
|
-
* Logs a message to the console with log level INFO.
|
|
749
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
750
|
-
* It uses different colors for different log levels to enhance readability.
|
|
751
|
-
* @param args The arguments to log.
|
|
752
|
-
*/
|
|
753
|
-
function info(...args: any[]): void;
|
|
754
|
-
/**
|
|
755
|
-
* Logs a message to the console with log level WARN.
|
|
756
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
757
|
-
* It uses different colors for different log levels to enhance readability.
|
|
758
|
-
* @param args The arguments to log.
|
|
759
|
-
*/
|
|
760
|
-
function warn(...args: any[]): void;
|
|
761
|
-
/**
|
|
762
|
-
* Logs a message to the console with log level ERROR.
|
|
763
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
764
|
-
* It uses different colors for different log levels to enhance readability.
|
|
765
|
-
* @param args The arguments to log.
|
|
766
|
-
*/
|
|
767
|
-
function error(...args: any[]): void;
|
|
768
|
-
/**
|
|
769
|
-
* Logs a message to the console with log level ERROR and a grey color scheme.
|
|
770
|
-
*/
|
|
771
|
-
function errorStack(...args: any[]): void;
|
|
772
|
-
/**
|
|
773
|
-
* Logs a message to the console with log level DEBUG.
|
|
774
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
775
|
-
* It uses different colors for different log levels to enhance readability.
|
|
776
|
-
* @param args The arguments to log.
|
|
777
|
-
*/
|
|
778
|
-
function debug(...args: any[]): void;
|
|
779
|
-
/**
|
|
780
|
-
* Logs a message to the console with log level COMMENT.
|
|
781
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
782
|
-
* It uses different colors for different log levels to enhance readability.
|
|
783
|
-
* @param args The arguments to log.
|
|
784
|
-
*/
|
|
785
|
-
function comment(...args: any[]): void;
|
|
786
|
-
/**
|
|
787
|
-
* Logs a message to the console with log level CRITICAL.
|
|
788
|
-
* This function formats the message with a timestamp, process ID, and the name of the caller function or class.
|
|
789
|
-
* It uses different colors for different log levels to enhance readability.
|
|
790
|
-
* @param args The arguments to log.
|
|
791
|
-
*/
|
|
792
|
-
function critical(...args: any[]): void;
|
|
793
|
-
/**
|
|
794
|
-
* Enables logging to a file output for the specified log levels.
|
|
795
|
-
* @param filepath The path to the log file.
|
|
796
|
-
* @param levels The log levels to enable file logging for. Defaults to all levels.
|
|
797
|
-
*/
|
|
798
|
-
function enableFileLogging(filepath: string, levels?: LogLevel[]): void;
|
|
799
|
-
/**
|
|
800
|
-
* Disables logging to a file output for the specified log levels.
|
|
801
|
-
* @param levels The log levels to disable file logging for. Defaults to all levels.
|
|
802
|
-
*/
|
|
803
|
-
function disableFileLogging(levels?: LogLevel[]): void;
|
|
804
|
-
const colors: {
|
|
805
|
-
black: string;
|
|
806
|
-
grey: string;
|
|
807
|
-
red: string;
|
|
808
|
-
green: string;
|
|
809
|
-
brown: string;
|
|
810
|
-
blue: string;
|
|
811
|
-
purple: string;
|
|
812
|
-
darkGrey: string;
|
|
813
|
-
lightRed: string;
|
|
814
|
-
lightGreen: string;
|
|
815
|
-
yellow: string;
|
|
816
|
-
lightBlue: string;
|
|
817
|
-
magenta: string;
|
|
818
|
-
cyan: string;
|
|
819
|
-
white: string;
|
|
820
|
-
initial: string;
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
interface RendererChannels {
|
|
825
|
-
request: Electron.MessageChannelMain;
|
|
826
|
-
socket: Electron.MessageChannelMain;
|
|
827
|
-
}
|
|
828
|
-
declare class NoxSocket {
|
|
829
|
-
private readonly channels;
|
|
830
|
-
register(senderId: number, requestChannel: Electron.MessageChannelMain, socketChannel: Electron.MessageChannelMain): void;
|
|
831
|
-
get(senderId: number): RendererChannels | undefined;
|
|
832
|
-
unregister(senderId: number): void;
|
|
833
|
-
getSenderIds(): number[];
|
|
834
|
-
emit<TPayload = unknown>(eventName: string, payload?: TPayload, targetSenderIds?: number[]): number;
|
|
835
|
-
emitToRenderer<TPayload = unknown>(senderId: number, eventName: string, payload?: TPayload): boolean;
|
|
836
|
-
}
|
|
884
|
+
declare function Injectable(options?: InjectableOptions): <T extends new (...args: any[]) => unknown>(target: T, _context: ClassDecoratorContext) => T | void;
|
|
837
885
|
|
|
838
|
-
export { AppInjector, type AtomicHttpMethod, BadGatewayException, BadRequestException, type BootstrapConfig, ConflictException, Controller, type ControllerAction, type ControllerOptions, Delete, ForbiddenException, type ForwardRefFn, ForwardReference, GatewayTimeoutException, Get, type Guard, type HttpMethod, HttpVersionNotSupportedException, type IApp, type IBatchRequestItem, type IBatchRequestPayload, type IBatchResponsePayload, type IBinding, type IControllerMetadata, type ILazyRoute, type IRendererEventMessage, type IRequest, type IResponse, type IRouteDefinition, type IRouteMetadata, type IRouteOptions, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, type Lifetime, type LogLevel, Logger, LoopDetectedException, type MaybeAsync, MethodNotAllowedException, type Middleware, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, type NextFunction, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, NoxApp, NoxSocket, Patch, PaymentRequiredException, Post, Put, RENDERER_EVENT_TYPE, Request, RequestTimeoutException, ResponseException, RootInjector, type RouteDefinition, Router, ServiceUnavailableException, type SingletonOverride, Token, type TokenKey, TooManyRequestsException, type Type, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException, type WindowConfig, WindowManager, type WindowRecord, bootstrapApplication, createRendererEventMessage, defineRoutes, forwardRef, getControllerMetadata, getRouteMetadata, inject, isAtomicHttpMethod, isRendererEventMessage, token };
|
|
886
|
+
export { AppInjector, type AtomicHttpMethod, BadGatewayException, BadRequestException, type BootstrapConfig, ConflictException, Controller, type ControllerAction, type ControllerOptions, Delete, ForbiddenException, type ForwardRefFn, ForwardReference, GatewayTimeoutException, Get, type Guard, type HttpMethod, HttpVersionNotSupportedException, type IApp, type IBatchRequestItem, type IBatchRequestPayload, type IBatchResponsePayload, type IBinding, type IControllerMetadata, type ILazyRoute, type IRendererEventMessage, type IRequest, type IResponse, type IRouteDefinition, type IRouteMetadata, type IRouteOptions, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, type Lifetime, type LogLevel, Logger, LoopDetectedException, type MaybeAsync, MethodNotAllowedException, type Middleware, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, type NextFunction, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, NoxApp, NoxSocket, Patch, PaymentRequiredException, Post, Put, RENDERER_EVENT_TYPE, Request, RequestTimeoutException, ResponseException, RootInjector, type RouteDefinition, Router, ServiceUnavailableException, type SingletonOverride, Token, type TokenKey, TooManyRequestsException, type Type, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException, type WindowConfig, type WindowEvent, WindowManager, type WindowRecord, bootstrapApplication, createRendererEventMessage, defineRoutes, forwardRef, getControllerMetadata, getRouteMetadata, inject, isAtomicHttpMethod, isRendererEventMessage, resetRootInjector, token };
|