shipClazz的声明加了泛型
This commit is contained in:
parent
87d5f351f5
commit
1c9d3ad826
|
|
@ -1,9 +1,10 @@
|
|||
import { EntityDict } from '../oak-app-domain';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
export default interface ShipClazz {
|
||||
available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean>;
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../context/BackendRuntimeContext';
|
||||
export default interface ShipClazz<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> {
|
||||
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
syncState(shipId: string): Promise<EntityDict['ship']['OpSchema']['iState']>;
|
||||
syncPaths(shipId: string): Promise<EntityDict['ship']['OpSchema']['extraPaths']>;
|
||||
getPrintInfo(shipId: string): Promise<{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { BRC } from "../../../types/RuntimeCxt";
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import DebugClazz from './WechatMpShip.debug';
|
||||
export default class WechatMpShip extends DebugClazz {
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
export default class WechatMpShip<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> extends DebugClazz<ED, Context> {
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,31 @@
|
|||
import { EntityDict } from "../../../oak-app-domain";
|
||||
import { BRC } from "../../../types/RuntimeCxt";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import ShipClazz from "../../../types/ShipClazz";
|
||||
import { WechatMpInstance } from "oak-external-sdk";
|
||||
import { AddExpressOrderData } from 'oak-external-sdk/lib/types/Wechat';
|
||||
type ExtraAddExpressOrderData = Omit<AddExpressOrderData, 'order_id' | 'openid' | 'delivery_id' | 'add_source' | 'sender' | 'receiver' | 'service' | 'expect_time'>;
|
||||
export default class WechatMpShipDebug implements ShipClazz {
|
||||
export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> implements ShipClazz<ED, Context> {
|
||||
private wechatMpShipId;
|
||||
private wechatMpShip?;
|
||||
private getReceiverInfo;
|
||||
private getExtraData;
|
||||
constructor(wechatMpShipId: string, getReceiverInfo: (orderIds: string[], applicationId: string, context: BRC) => Promise<{
|
||||
constructor(wechatMpShipId: string, getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
||||
openId?: string;
|
||||
appWxId?: string;
|
||||
}>, getExtraData: (shipId: string, context: BRC) => Promise<ExtraAddExpressOrderData>);
|
||||
}>, getExtraData: (shipId: string, context: Context) => Promise<ExtraAddExpressOrderData>);
|
||||
private getWechatMpShip;
|
||||
available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean>;
|
||||
protected getInstance(context: BRC): Promise<WechatMpInstance>;
|
||||
protected prepareOrder(shipId: string, context: BRC): Promise<AddExpressOrderData>;
|
||||
protected prepareCancelOrder(shipId: string, context: BRC): Promise<{
|
||||
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
||||
protected getInstance(context: Context): Promise<WechatMpInstance>;
|
||||
protected prepareOrder(shipId: string, context: Context): Promise<AddExpressOrderData>;
|
||||
protected prepareCancelOrder(shipId: string, context: Context): Promise<{
|
||||
openid: string | undefined;
|
||||
delivery_id: string;
|
||||
waybill_id: string;
|
||||
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
||||
order_id: string;
|
||||
}>;
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
syncState(shipId: string): Promise<EntityDict["ship"]["OpSchema"]["iState"]>;
|
||||
syncPaths(extraShipId: string): Promise<EntityDict["ship"]["OpSchema"]["extraPaths"]>;
|
||||
getPrintInfo(shipId: string): Promise<{
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
|||
import ShipClazz from '../../types/ShipClazz';
|
||||
import { BRC } from '../../types/RuntimeCxt';
|
||||
import { StorageSchema } from 'oak-domain/lib/types/Storage';
|
||||
type ShipClazzConstructor = (entityId: string, context: BRC) => Promise<ShipClazz>;
|
||||
export declare function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(entity: T, clazzConstructor: ShipClazzConstructor, schema: StorageSchema<ED>): void;
|
||||
export declare function getShipClazz(entity: NonNullable<EntityDict['ship']['OpSchema']['entity']>, entityId: NonNullable<EntityDict['ship']['OpSchema']['entityId']>, context: BRC): Promise<ShipClazz>;
|
||||
import BackendRuntimeContext from '../../context/BackendRuntimeContext';
|
||||
type ShipClazzConstructor<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> = (entityId: string, context: Context) => Promise<ShipClazz<ED, Context>>;
|
||||
export declare function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Context extends BackendRuntimeContext<ED>>(entity: T, clazzConstructor: ShipClazzConstructor<ED, Context>, schema: StorageSchema<ED>): void;
|
||||
export declare function getShipClazz(entity: NonNullable<EntityDict['ship']['OpSchema']['entity']>, entityId: NonNullable<EntityDict['ship']['OpSchema']['entityId']>, context: BRC): Promise<ShipClazz<any, any>>;
|
||||
/**
|
||||
* 创建ship时,根据系统物流的配置去对接对应的物流系统
|
||||
* @param shipId
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { EntityDict } from '../oak-app-domain';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
export default interface ShipClazz {
|
||||
available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean>;
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../context/BackendRuntimeContext';
|
||||
export default interface ShipClazz<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> {
|
||||
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
syncState(shipId: string): Promise<EntityDict['ship']['OpSchema']['iState']>;
|
||||
syncPaths(shipId: string): Promise<EntityDict['ship']['OpSchema']['extraPaths']>;
|
||||
getPrintInfo(shipId: string): Promise<{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { BRC } from "../../../types/RuntimeCxt";
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import DebugClazz from './WechatMpShip.debug';
|
||||
export default class WechatMpShip extends DebugClazz {
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
export default class WechatMpShip<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> extends DebugClazz<ED, Context> {
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,31 @@
|
|||
import { EntityDict } from "../../../oak-app-domain";
|
||||
import { BRC } from "../../../types/RuntimeCxt";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import ShipClazz from "../../../types/ShipClazz";
|
||||
import { WechatMpInstance } from "oak-external-sdk";
|
||||
import { AddExpressOrderData } from 'oak-external-sdk/lib/types/Wechat';
|
||||
type ExtraAddExpressOrderData = Omit<AddExpressOrderData, 'order_id' | 'openid' | 'delivery_id' | 'add_source' | 'sender' | 'receiver' | 'service' | 'expect_time'>;
|
||||
export default class WechatMpShipDebug implements ShipClazz {
|
||||
export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> implements ShipClazz<ED, Context> {
|
||||
private wechatMpShipId;
|
||||
private wechatMpShip?;
|
||||
private getReceiverInfo;
|
||||
private getExtraData;
|
||||
constructor(wechatMpShipId: string, getReceiverInfo: (orderIds: string[], applicationId: string, context: BRC) => Promise<{
|
||||
constructor(wechatMpShipId: string, getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
||||
openId?: string;
|
||||
appWxId?: string;
|
||||
}>, getExtraData: (shipId: string, context: BRC) => Promise<ExtraAddExpressOrderData>);
|
||||
}>, getExtraData: (shipId: string, context: Context) => Promise<ExtraAddExpressOrderData>);
|
||||
private getWechatMpShip;
|
||||
available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean>;
|
||||
protected getInstance(context: BRC): Promise<WechatMpInstance>;
|
||||
protected prepareOrder(shipId: string, context: BRC): Promise<AddExpressOrderData>;
|
||||
protected prepareCancelOrder(shipId: string, context: BRC): Promise<{
|
||||
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
||||
protected getInstance(context: Context): Promise<WechatMpInstance>;
|
||||
protected prepareOrder(shipId: string, context: Context): Promise<AddExpressOrderData>;
|
||||
protected prepareCancelOrder(shipId: string, context: Context): Promise<{
|
||||
openid: string | undefined;
|
||||
delivery_id: string;
|
||||
waybill_id: string;
|
||||
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
||||
order_id: string;
|
||||
}>;
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
syncState(shipId: string): Promise<EntityDict["ship"]["OpSchema"]["iState"]>;
|
||||
syncPaths(extraShipId: string): Promise<EntityDict["ship"]["OpSchema"]["extraPaths"]>;
|
||||
getPrintInfo(shipId: string): Promise<{
|
||||
|
|
|
|||
|
|
@ -3,9 +3,10 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
|||
import ShipClazz from '../../types/ShipClazz';
|
||||
import { BRC } from '../../types/RuntimeCxt';
|
||||
import { StorageSchema } from 'oak-domain/lib/types/Storage';
|
||||
type ShipClazzConstructor = (entityId: string, context: BRC) => Promise<ShipClazz>;
|
||||
export declare function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(entity: T, clazzConstructor: ShipClazzConstructor, schema: StorageSchema<ED>): void;
|
||||
export declare function getShipClazz(entity: NonNullable<EntityDict['ship']['OpSchema']['entity']>, entityId: NonNullable<EntityDict['ship']['OpSchema']['entityId']>, context: BRC): Promise<ShipClazz>;
|
||||
import BackendRuntimeContext from '../../context/BackendRuntimeContext';
|
||||
type ShipClazzConstructor<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> = (entityId: string, context: Context) => Promise<ShipClazz<ED, Context>>;
|
||||
export declare function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Context extends BackendRuntimeContext<ED>>(entity: T, clazzConstructor: ShipClazzConstructor<ED, Context>, schema: StorageSchema<ED>): void;
|
||||
export declare function getShipClazz(entity: NonNullable<EntityDict['ship']['OpSchema']['entity']>, entityId: NonNullable<EntityDict['ship']['OpSchema']['entityId']>, context: BRC): Promise<ShipClazz<any, any>>;
|
||||
/**
|
||||
* 创建ship时,根据系统物流的配置去对接对应的物流系统
|
||||
* @param shipId
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
import { EntityDict } from '../oak-app-domain';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../context/BackendRuntimeContext';
|
||||
|
||||
export default interface ShipClazz {
|
||||
export default interface ShipClazz<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> {
|
||||
// 是否可以使用这个接口下单
|
||||
available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean>;
|
||||
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
||||
|
||||
// 下单
|
||||
eOrder(shipId: string, context: BRC): Promise<string>;
|
||||
eOrder(shipId: string, context: Context): Promise<string>;
|
||||
|
||||
// 取消
|
||||
cancelOrder(shipId: string, context: BRC): Promise<void>;
|
||||
cancelOrder(shipId: string, context: Context): Promise<void>;
|
||||
|
||||
// 同步状态
|
||||
syncState(shipId: string): Promise<EntityDict['ship']['OpSchema']['iState']>;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { EntityDict } from "@project/oak-app-domain";
|
||||
import { BRC } from "@project/types/RuntimeCxt";
|
||||
import ShipClazz from "@project/types/ShipClazz";
|
||||
import { EntityDict } from "../../../oak-app-domain";
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import ShipClazz from "../../../types/ShipClazz";
|
||||
import assert from "assert";
|
||||
import { WechatMpConfig } from "oak-general-business/lib/entities/Application";
|
||||
import WechatSDK from 'oak-external-sdk/lib/WechatSDK';
|
||||
import { WechatMpInstance } from "oak-external-sdk";
|
||||
import { AddExpressOrderData } from 'oak-external-sdk/lib/types/Wechat';
|
||||
|
|
@ -26,29 +26,29 @@ const ShipServiceCodeDict = {
|
|||
'sto-bzkd': 1,
|
||||
}
|
||||
|
||||
export default class WechatMpShipDebug implements ShipClazz {
|
||||
export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> implements ShipClazz<ED, Context> {
|
||||
private wechatMpShipId: string;
|
||||
private wechatMpShip?: EntityDict['wechatMpShip']['Schema'];
|
||||
private getReceiverInfo: (orderIds: string[], applicationId: string, context: BRC) => Promise<{
|
||||
private getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
||||
openId?: string;
|
||||
appWxId?: string;
|
||||
}>;
|
||||
private getExtraData: (shipId: string, context: BRC) => Promise<ExtraAddExpressOrderData>;
|
||||
private getExtraData: (shipId: string, context: Context) => Promise<ExtraAddExpressOrderData>;
|
||||
|
||||
constructor(
|
||||
wechatMpShipId: string,
|
||||
getReceiverInfo: (orderIds: string[], applicationId: string, context: BRC) => Promise<{
|
||||
getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
||||
openId?: string;
|
||||
appWxId?: string; // todo
|
||||
}>,
|
||||
getExtraData: (shipId: string, context: BRC) => Promise<ExtraAddExpressOrderData>
|
||||
getExtraData: (shipId: string, context: Context) => Promise<ExtraAddExpressOrderData>
|
||||
) {
|
||||
this.wechatMpShipId = wechatMpShipId;
|
||||
this.getReceiverInfo = getReceiverInfo;
|
||||
this.getExtraData = getExtraData;
|
||||
}
|
||||
|
||||
private async getWechatMpShip(context: BRC) {
|
||||
private async getWechatMpShip(context: Context) {
|
||||
if (this.wechatMpShip) {
|
||||
return this.wechatMpShip;
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ export default class WechatMpShipDebug implements ShipClazz {
|
|||
return this.wechatMpShip!;
|
||||
}
|
||||
|
||||
async available(shipServiceId: string, orderIds: string[], context: BRC): Promise<boolean> {
|
||||
async available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean> {
|
||||
if (!ShipServiceCodeDict.hasOwnProperty(shipServiceId!)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ export default class WechatMpShipDebug implements ShipClazz {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected async getInstance(context: BRC) {
|
||||
protected async getInstance(context: Context) {
|
||||
const wechatMpShip = await this.getWechatMpShip(context);
|
||||
const { config } = wechatMpShip!.application!;
|
||||
assert(config.type === 'wechatMp');
|
||||
|
|
@ -95,7 +95,7 @@ export default class WechatMpShipDebug implements ShipClazz {
|
|||
}
|
||||
|
||||
|
||||
protected async prepareOrder(shipId: string, context: BRC): Promise<AddExpressOrderData> {
|
||||
protected async prepareOrder(shipId: string, context: Context): Promise<AddExpressOrderData> {
|
||||
const [ship] = await context.select('ship', {
|
||||
data: {
|
||||
id: 1,
|
||||
|
|
@ -207,7 +207,7 @@ export default class WechatMpShipDebug implements ShipClazz {
|
|||
return data;
|
||||
}
|
||||
|
||||
protected async prepareCancelOrder(shipId: string, context: BRC) {
|
||||
protected async prepareCancelOrder(shipId: string, context: Context) {
|
||||
const [ship] = await context.select('ship', {
|
||||
data: {
|
||||
id: 1,
|
||||
|
|
@ -244,14 +244,14 @@ export default class WechatMpShipDebug implements ShipClazz {
|
|||
}
|
||||
|
||||
|
||||
async eOrder(shipId: string, context: BRC): Promise<string> {
|
||||
async eOrder(shipId: string, context: Context): Promise<string> {
|
||||
const data = await this.prepareOrder(shipId, context);
|
||||
console.log('mock eOrder to wechatMpShip, data:', data);
|
||||
|
||||
return 'mockExtraShipId';
|
||||
}
|
||||
|
||||
async cancelOrder(shipId: string, context: BRC): Promise<void> {
|
||||
async cancelOrder(shipId: string, context: Context): Promise<void> {
|
||||
const data = await this.prepareCancelOrder(shipId, context);
|
||||
console.log('mock cancelOrder to wechatMpShip, data:', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import { BRC } from "@project/types/RuntimeCxt";
|
||||
import DebugClazz from './WechatMpShip.debug';
|
||||
import { assert } from "console";
|
||||
|
||||
export default class WechatMpShip extends DebugClazz {
|
||||
async eOrder(shipId: string, context: BRC): Promise<string> {
|
||||
export default class WechatMpShip<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> extends DebugClazz<ED, Context> {
|
||||
async eOrder(shipId: string, context: Context): Promise<string> {
|
||||
const data = await this.prepareOrder(shipId, context);
|
||||
const instance = await this.getInstance(context);
|
||||
const result = await instance.addExpressOrder(data);
|
||||
return result.waybill_id;
|
||||
}
|
||||
|
||||
async cancelOrder(shipId: string, context: BRC): Promise<void> {
|
||||
async cancelOrder(shipId: string, context: Context): Promise<void> {
|
||||
const instance = await this.getInstance(context);
|
||||
const data = await this.prepareCancelOrder(shipId, context);
|
||||
await instance.cancelExpressOrder(data);
|
||||
|
|
|
|||
|
|
@ -4,15 +4,16 @@ import ShipClazz from '../../types/ShipClazz';
|
|||
import { BRC } from '../../types/RuntimeCxt';
|
||||
import assert from 'assert';
|
||||
import { StorageSchema } from 'oak-domain/lib/types/Storage';
|
||||
import BackendRuntimeContext from '../../context/BackendRuntimeContext';
|
||||
let MODULE_USED = false;
|
||||
|
||||
type ShipClazzConstructor = (entityId: string, context: BRC) => Promise<ShipClazz>;
|
||||
const ShipClazzDict: Record<string, ShipClazz> = {};
|
||||
const ShipClazzEntityDict: Record<string, ShipClazzConstructor> = {};
|
||||
type ShipClazzConstructor<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> = (entityId: string, context: Context) => Promise<ShipClazz<ED, Context>>;
|
||||
const ShipClazzDict: Record<string, ShipClazz<any, any>> = {};
|
||||
const ShipClazzEntityDict: Record<string, ShipClazzConstructor<any, any>> = {};
|
||||
|
||||
export function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED>(
|
||||
export function registerShipClazzEntity<ED extends EntityDict & BaseEntityDict, T extends keyof ED, Context extends BackendRuntimeContext<ED>>(
|
||||
entity: T,
|
||||
clazzConstructor: ShipClazzConstructor,
|
||||
clazzConstructor: ShipClazzConstructor<ED, Context>,
|
||||
schema: StorageSchema<ED>
|
||||
) {
|
||||
assert(!MODULE_USED);
|
||||
|
|
|
|||
Loading…
Reference in New Issue