this repo has no description
at v1.1.0 2.1 kB view raw
1import type { Logger } from "./logger"; 2import type { Config, ConfigExtension } from "./config"; 3import type { 4 DetectedExtension, 5 IdentifiedPatch, 6 IdentifiedWebpackModule, 7 ProcessedExtensions 8} from "./extension"; 9import type EventEmitter from "events"; 10import type LunAST from "@moonlight-mod/lunast"; 11import type Moonmap from "@moonlight-mod/moonmap"; 12import { EventPayloads, EventType, MoonlightEventEmitter } from "./core/event"; 13 14export type MoonlightHost = { 15 asarPath: string; 16 config: Config; 17 events: EventEmitter; 18 extensions: DetectedExtension[]; 19 processedExtensions: ProcessedExtensions; 20 21 getConfig: (ext: string) => ConfigExtension["config"]; 22 getConfigOption: <T>(ext: string, name: string) => T | undefined; 23 getLogger: (id: string) => Logger; 24}; 25 26export type MoonlightNode = { 27 config: Config; 28 extensions: DetectedExtension[]; 29 processedExtensions: ProcessedExtensions; 30 nativesCache: Record<string, any>; 31 32 getConfig: (ext: string) => ConfigExtension["config"]; 33 getConfigOption: <T>(ext: string, name: string) => T | undefined; 34 getNatives: (ext: string) => any | undefined; 35 getLogger: (id: string) => Logger; 36 37 getExtensionDir: (ext: string) => string; 38 writeConfig: (config: Config) => void; 39}; 40 41export type MoonlightWeb = { 42 unpatched: Set<IdentifiedPatch>; 43 pendingModules: Set<IdentifiedWebpackModule>; 44 enabledExtensions: Set<string>; 45 apiLevel: number; 46 events: MoonlightEventEmitter<EventType, EventPayloads>; 47 patchingInternals: { 48 onModuleLoad: ( 49 moduleId: string | string[], 50 callback: (moduleId: string) => void 51 ) => void; 52 registerPatch: (patch: IdentifiedPatch) => void; 53 registerWebpackModule: (module: IdentifiedWebpackModule) => void; 54 }; 55 56 getConfig: (ext: string) => ConfigExtension["config"]; 57 getConfigOption: <T>(ext: string, name: string) => T | undefined; 58 getNatives: (ext: string) => any | undefined; 59 getLogger: (id: string) => Logger; 60 lunast: LunAST; 61 moonmap: Moonmap; 62}; 63 64export enum MoonlightEnv { 65 Injector = "injector", 66 NodePreload = "node-preload", 67 WebPreload = "web-preload" 68}