electron-ipc-module
    Preparing search index...

    Function createIpcContainer

    • Create a registry that loads, unloads, and observes named IPC modules.

      Mutating lifecycle calls are executed in invocation order through one queue. This makes overlap deterministic across module names as well as for the same name. dispose() is terminal: calls requested after it reject.

      Returns {
          dispose: () => Promise<void>;
          getChannels: (name: string) => string[];
          has: (name: string) => boolean;
          load: (
              name: string,
              register: IpcModuleRegister,
              ipc?: IpcMain,
          ) => Promise<string[]>;
          loadAll: (
              entries: Record<string, IpcModuleRegister>,
              ipc?: IpcMain,
          ) => Promise<Record<string, string[]>>;
          off: <K extends keyof IpcContainerEvents>(
              event: K,
              listener: (...args: IpcContainerEvents[K]) => void,
          ) => this;
          on: <K extends keyof IpcContainerEvents>(
              event: K,
              listener: (...args: IpcContainerEvents[K]) => void,
          ) => this;
          once: <K extends keyof IpcContainerEvents>(
              event: K,
              listener: (...args: IpcContainerEvents[K]) => void,
          ) => this;
          unload: (name: string) => Promise<boolean>;
          unloadAll: () => Promise<void>;
          get allChannels(): string[];
          get names(): string[];
          get size(): number;
      }

      • dispose: () => Promise<void>

        Unload every module and permanently reject later lifecycle calls.

      • getChannels: (name: string) => string[]
      • has: (name: string) => boolean
      • load: (name: string, register: IpcModuleRegister, ipc?: IpcMain) => Promise<string[]>

        Load or replace one module. Resolves after all earlier lifecycle calls.

      • loadAll: (
            entries: Record<string, IpcModuleRegister>,
            ipc?: IpcMain,
        ) => Promise<Record<string, string[]>>

        Insert a transactional batch and return channels keyed by module name. Existing names are rejected before any registration starts.

      • off: <K extends keyof IpcContainerEvents>(
            event: K,
            listener: (...args: IpcContainerEvents[K]) => void,
        ) => this
      • on: <K extends keyof IpcContainerEvents>(
            event: K,
            listener: (...args: IpcContainerEvents[K]) => void,
        ) => this
      • once: <K extends keyof IpcContainerEvents>(
            event: K,
            listener: (...args: IpcContainerEvents[K]) => void,
        ) => this
      • unload: (name: string) => Promise<boolean>

        Unload one module after all earlier lifecycle calls.

      • unloadAll: () => Promise<void>

        Unload every module; the container remains reusable.

      • get allChannels(): string[]
      • get names(): string[]
      • get size(): number