this repo has no description
1import { Logger } from "./logger";
2import { Config, ConfigExtension } from "./config";
3import {
4 DetectedExtension,
5 IdentifiedPatch,
6 IdentifiedWebpackModule,
7 ProcessedExtensions
8} from "./extension";
9import EventEmitter from "events";
10
11export type MoonlightHost = {
12 asarPath: string;
13 config: Config;
14 events: EventEmitter;
15 extensions: DetectedExtension[];
16 processedExtensions: ProcessedExtensions;
17
18 getConfig: (ext: string) => ConfigExtension["config"];
19 getConfigOption: <T>(ext: string, name: string) => T | undefined;
20 getLogger: (id: string) => Logger;
21};
22
23export type MoonlightNode = {
24 config: Config;
25 extensions: DetectedExtension[];
26 processedExtensions: ProcessedExtensions;
27 nativesCache: Record<string, any>;
28
29 getConfig: (ext: string) => ConfigExtension["config"];
30 getConfigOption: <T>(ext: string, name: string) => T | undefined;
31 getNatives: (ext: string) => any | undefined;
32 getLogger: (id: string) => Logger;
33
34 getExtensionDir: (ext: string) => string;
35 writeConfig: (config: Config) => void;
36};
37
38export type MoonlightWeb = {
39 unpatched: Set<IdentifiedPatch>;
40 pendingModules: Set<IdentifiedWebpackModule>;
41 enabledExtensions: Set<string>;
42
43 getConfig: (ext: string) => ConfigExtension["config"];
44 getConfigOption: <T>(ext: string, name: string) => T | undefined;
45 getNatives: (ext: string) => any | undefined;
46 getLogger: (id: string) => Logger;
47};
48
49export enum MoonlightEnv {
50 Injector = "injector",
51 NodePreload = "node-preload",
52 WebPreload = "web-preload"
53}