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