import type http from "node:http"; /** Standardized test result for mocked updater checks. */ export type MockUpdateCheckResult = { updateAvailable: boolean; currentVersion: string; latestVersion: string | null; channel: string; distTag: string; cached: boolean; error: string | null; }; /** Snapshot and restore the configured environment variables around a test. */ export declare function createEnvSandbox(keys: readonly string[]): { clear: () => void; restore: () => void; }; export type PluginModuleShape = { [key: string]: unknown; default?: unknown; plugin?: unknown; }; /** Loose plugin-shape predicate used in dynamic test imports across suites. */ export declare function looksLikePlugin(value: unknown): value is { name: string; }; /** Extract a plugin-like object from a dynamic module export shape. */ export declare function extractPlugin(mod: PluginModuleShape): { name: string; } | null; /** Check whether a package name can be resolved for dynamic import. */ export declare function isPackageImportResolvable(packageName: string): boolean; /** Check whether a dependency specifier should be treated as a workspace-local version. */ export declare function isWorkspaceDependency(version: string | undefined): boolean; /** * Resolve the Discord plugin import specifier. * Prefers package resolution, then falls back to local plugin checkout paths. */ export declare function resolveDiscordPluginImportSpecifier(): string | null; /** Build a mock update check result with deterministic defaults. */ export declare function buildMockUpdateCheckResult(overrides?: Partial): MockUpdateCheckResult; /** Small utility to wait for asynchronous side-effects in tests. */ export declare function waitMs(ms: number): Promise; type MockResponsePayload = { res: http.ServerResponse & { _status: number; _body: string; writeHead: (statusCode: number) => void; }; getStatus: () => number; getJson: () => T; }; type MockBodyChunk = string | Buffer; export type MockRequestOptions = { method?: string; url?: string; headers?: Record; body?: unknown; bodyChunks?: MockBodyChunk[]; json?: boolean; }; /** Create a lightweight mocked HTTP response used by handler tests. */ export declare function createMockHttpResponse(): MockResponsePayload; export declare function createMockHeadersRequest(headers?: Record, options?: Omit): http.IncomingMessage & { destroy: () => void; }; export declare function createMockIncomingMessage({ method, url, headers, body, bodyChunks, json, }: MockRequestOptions): http.IncomingMessage & { destroy: () => void; }; export declare function createMockJsonRequest(body: unknown, options?: Omit): http.IncomingMessage & { destroy: () => void; }; /** Return true when optional plugin imports are intentionally unavailable in this env. */ export declare function isOptionalImportError(error: unknown, extraMarkers?: readonly string[]): boolean; /** Safely import optional plugin modules while allowing hard failures to bubble. */ export declare function tryOptionalDynamicImport(moduleName: string, markers?: readonly string[]): Promise; export {}; //# sourceMappingURL=test-helpers.d.ts.map