Fixing Typings
This commit is contained in:
parent
03b38f7f66
commit
eda224bd55
@ -31,12 +31,12 @@ import {
|
||||
INopeRpcManager,
|
||||
INopeStatusInfo,
|
||||
TValidAsssignmentChecker,
|
||||
ValidSelectorFunction,
|
||||
ValidSelectorFunction
|
||||
} from "../../types/nope";
|
||||
import {
|
||||
INopeInstanceManager,
|
||||
TConstructorCallback,
|
||||
TGenerateWrapperCallback,
|
||||
TGenerateWrapperCallback
|
||||
} from "../../types/nope/nopeInstanceManager.interface";
|
||||
import { NopeConnectivityManager } from "../ConnectivityManager";
|
||||
import { NopeRpcManager } from "../RpcManager/NopeRpcManager";
|
||||
@ -665,13 +665,13 @@ export class NopeInstanceManager implements INopeInstanceManager {
|
||||
}
|
||||
|
||||
// See interface description
|
||||
public async createInstance<I extends INopeModule = IGenericNopeModule>(
|
||||
public async createInstance<I = IGenericNopeModule>(
|
||||
description: Partial<IInstanceCreationMsg>,
|
||||
options: {
|
||||
selector?: ValidSelectorFunction;
|
||||
assignmentValid?: TValidAsssignmentChecker;
|
||||
} = {}
|
||||
): Promise<I> {
|
||||
): Promise<I & IGenericNopeModule> {
|
||||
// Define the Default Description
|
||||
// which will lead to an error.
|
||||
const _defDescription: IInstanceCreationMsg = {
|
||||
@ -785,7 +785,7 @@ export class NopeInstanceManager implements INopeInstanceManager {
|
||||
const wrapper = (await this._internalWrapperGenerators.get(_type)(
|
||||
this._core,
|
||||
definedInstance.description
|
||||
)) as I;
|
||||
)) as IGenericNopeModule;
|
||||
|
||||
if (this._logger?.enabledFor(DEBUG)) {
|
||||
this._logger.debug(
|
||||
@ -799,7 +799,7 @@ export class NopeInstanceManager implements INopeInstanceManager {
|
||||
usedBy: [_description.dispatcherId],
|
||||
});
|
||||
|
||||
return wrapper;
|
||||
return wrapper as I & IGenericNopeModule;
|
||||
}
|
||||
|
||||
throw Error("No internal generator Available!");
|
||||
|
@ -9,13 +9,13 @@
|
||||
import { INopeCore, INopeModule } from ".";
|
||||
import {
|
||||
IAvailableInstancesMsg,
|
||||
IInstanceCreationMsg,
|
||||
IInstanceCreationMsg
|
||||
} from "./nopeCommunication.interface";
|
||||
import { INopeStatusInfo } from "./nopeConnectivityManager.interface";
|
||||
import { IMapBasedMergeData } from "./nopeHelpers.interface";
|
||||
import {
|
||||
IGenericNopeModule,
|
||||
INopeModuleDescription,
|
||||
INopeModuleDescription
|
||||
} from "./nopeModule.interface";
|
||||
import { INopeObservable } from "./nopeObservable.interface";
|
||||
import { ValidSelectorFunction } from "./nopeRpcManager.interface";
|
||||
@ -136,13 +136,13 @@ export interface INopeInstanceManager {
|
||||
* @return {Promise<I>}
|
||||
* @memberof INopeInstanceManager
|
||||
*/
|
||||
createInstance<I extends INopeModule = IGenericNopeModule>(
|
||||
createInstance<I = IGenericNopeModule>(
|
||||
description: Partial<IInstanceCreationMsg>,
|
||||
options?: {
|
||||
selector?: ValidSelectorFunction;
|
||||
assignmentValid?: TValidAsssignmentChecker;
|
||||
}
|
||||
): Promise<I>;
|
||||
): Promise<I & IGenericNopeModule>;
|
||||
|
||||
/**
|
||||
* Creates Wrappers for the Type of the given element.
|
||||
|
Loading…
Reference in New Issue
Block a user