Update examples

This commit is contained in:
Chomp 2022-05-28 09:58:18 +01:00
parent 183276e857
commit 98286c0da3
5 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,6 @@
import type { DependencyContainer } from "tsyringe"; import type { DependencyContainer } from "tsyringe";
import { IMod } from "../types/models/external/mod"; import type { IMod } from "../types/models/external/mod";
import type { DatabaseServer } from "../types/servers/DatabaseServer"; import type { DatabaseServer } from "../types/servers/DatabaseServer";
class Mod implements IMod class Mod implements IMod

View File

@ -1,9 +1,10 @@
import type { DependencyContainer } from "tsyringe"; import type { DependencyContainer } from "tsyringe";
import { IMod } from "../types/models/external/mod"; import type { IMod } from "../types/models/external/mod";
import type { ILogger } from "../types/models/spt/utils/ILogger"; import type { ILogger } from "../types/models/spt/utils/ILogger";
import { ConfigServer, ConfigTypes } from "../types/servers/ConfigServer"; import type { ConfigServer } from "../types/servers/ConfigServer";
import { IBotConfig } from "../types/models/spt/config/IBotConfig"; import { ConfigTypes } from "../types/models/enums/ConfigTypes";
import type { IBotConfig } from "../types/models/spt/config/IBotConfig";
class Mod implements IMod class Mod implements IMod
{ {

View File

@ -1,6 +1,6 @@
import type { DependencyContainer } from "tsyringe"; import type { DependencyContainer } from "tsyringe";
import { IMod } from "../types/models/external/mod"; import type { IMod } from "../types/models/external/mod";
import type { ILogger } from "../types/models/spt/utils/ILogger"; import type { ILogger } from "../types/models/spt/utils/ILogger";
class Mod implements IMod class Mod implements IMod

View File

@ -1,6 +1,6 @@
import type { DependencyContainer } from "tsyringe"; import type { DependencyContainer } from "tsyringe";
import { IMod } from "../types/models/external/mod"; import type { IMod } from "../types/models/external/mod";
import type { ILogger } from "../types/models/spt/utils/ILogger"; import type { ILogger } from "../types/models/spt/utils/ILogger";
import {MoreCode } from "./MoreCode"; import {MoreCode } from "./MoreCode";

View File

@ -1,7 +1,7 @@
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
import { IMod } from "../types/models/external/mod" import type { IMod } from "../types/models/external/mod"
import { ILogger } from "../types/models/spt/utils/ILogger" import type { ILogger } from "../types/models/spt/utils/ILogger"
import { OnLoadModService } from "../types/services/mod/onLoad/OnLoadModService" import type { OnLoadModService } from "../types/services/mod/onLoad/OnLoadModService"
class Mod implements IMod class Mod implements IMod
{ {
@ -10,7 +10,7 @@ class Mod implements IMod
const logger = container.resolve<ILogger>("WinstonLogger"); const logger = container.resolve<ILogger>("WinstonLogger");
const onLoadModService = container.resolve<OnLoadModService>("OnLoadModService"); const onLoadModService = container.resolve<OnLoadModService>("OnLoadModService");
onLoadModService.registerOnLoad( onLoadModService.registerOnLoad(
"MyCustomMod", "MyCustomMod", // route key
() => this.customFunctionThatRunsOnLoad(logger), () => this.customFunctionThatRunsOnLoad(logger),
() => "custom-mod" // new route name () => "custom-mod" // new route name
) )