Initial release for SPT 3.9
This commit is contained in:
19
types/di/Container.d.ts
vendored
Normal file
19
types/di/Container.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
/**
|
||||
* Handle the registration of classes to be used by the Dependency Injection code
|
||||
*/
|
||||
export declare class Container {
|
||||
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
|
||||
static registerTypes(depContainer: DependencyContainer): void;
|
||||
static registerPrimaryDependencies(depContainer: DependencyContainer): void;
|
||||
static registerListTypes(depContainer: DependencyContainer): void;
|
||||
private static registerUtils;
|
||||
private static registerRouters;
|
||||
private static registerGenerators;
|
||||
private static registerHelpers;
|
||||
private static registerLoaders;
|
||||
private static registerCallbacks;
|
||||
private static registerServices;
|
||||
private static registerServers;
|
||||
private static registerControllers;
|
||||
}
|
||||
4
types/di/OnLoad.d.ts
vendored
Normal file
4
types/di/OnLoad.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface OnLoad {
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
}
|
||||
4
types/di/OnUpdate.d.ts
vendored
Normal file
4
types/di/OnUpdate.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface OnUpdate {
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
}
|
||||
38
types/di/Router.d.ts
vendored
Normal file
38
types/di/Router.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
|
||||
export declare class Router {
|
||||
protected handledRoutes: HandledRoute[];
|
||||
getTopLevelRoute(): string;
|
||||
protected getHandledRoutes(): HandledRoute[];
|
||||
protected getInternalHandledRoutes(): HandledRoute[];
|
||||
canHandle(url: string, partialMatch?: boolean): boolean;
|
||||
}
|
||||
export declare class StaticRouter extends Router {
|
||||
private routes;
|
||||
constructor(routes: RouteAction[]);
|
||||
handleStatic(url: string, info: any, sessionID: string, output: string): Promise<any>;
|
||||
getHandledRoutes(): HandledRoute[];
|
||||
}
|
||||
export declare class DynamicRouter extends Router {
|
||||
private routes;
|
||||
constructor(routes: RouteAction[]);
|
||||
handleDynamic(url: string, info: any, sessionID: string, output: string): Promise<any>;
|
||||
getHandledRoutes(): HandledRoute[];
|
||||
}
|
||||
export declare class ItemEventRouterDefinition extends Router {
|
||||
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string, output: IItemEventRouterResponse): Promise<any>;
|
||||
}
|
||||
export declare class SaveLoadRouter extends Router {
|
||||
handleLoad(profile: ISptProfile): ISptProfile;
|
||||
}
|
||||
export declare class HandledRoute {
|
||||
route: string;
|
||||
dynamic: boolean;
|
||||
constructor(route: string, dynamic: boolean);
|
||||
}
|
||||
export declare class RouteAction {
|
||||
url: string;
|
||||
action: (url: string, info: any, sessionID: string, output: string) => Promise<any>;
|
||||
constructor(url: string, action: (url: string, info: any, sessionID: string, output: string) => Promise<any>);
|
||||
}
|
||||
6
types/di/Serializer.d.ts
vendored
Normal file
6
types/di/Serializer.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
import { IncomingMessage, ServerResponse } from "node:http";
|
||||
export declare class Serializer {
|
||||
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
|
||||
canHandle(something: string): boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user