mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
MISC: Add generic type as returned type for action and checking (#1748)
This commit is contained in:
parent
36eb12098f
commit
60c4be0496
@ -31,6 +31,10 @@ export interface IReturnStatus {
|
||||
msg?: string;
|
||||
}
|
||||
|
||||
type SuccessResult<T extends object> = { success: true; message?: string } & T;
|
||||
type FailureResult = { success: false; message: string };
|
||||
export type Result<T extends object = object> = SuccessResult<T> | FailureResult;
|
||||
|
||||
/** Defines the minimum and maximum values for a range.
|
||||
* It is up to the consumer if these values are inclusive or exclusive.
|
||||
* It is up to the implementor to ensure max > min. */
|
||||
|
Loading…
Reference in New Issue
Block a user