Replaced tabs with spaces

master
WolverinDEV 2021-02-19 23:04:02 +01:00
parent c4575b21b5
commit 1a78bf8d57
6 changed files with 244 additions and 202 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "web/native-codec/libraries/opus"]
path = web/native-codec/libraries/opus
url = https://github.com/xiph/opus.git
[submodule "vendor/TeaEventBus"]
path = vendor/TeaEventBus
url = https://github.com/WolverinDEV/TeaEventBus.git

View File

@ -15,6 +15,8 @@
"tc-backend/web/*": ["web/app/*"], /* specific web part */
"tc-backend/*": ["shared/backend.d/*"],
"tc-loader": ["loader/exports/loader.d.ts"],
"tc-events": ["vendor/TeaEventBus/src/index.ts"],
"tc-services": ["vendor/TeaClientServices/src/index.ts"],
"svg-sprites/*": ["shared/svg-sprites/*"],
"vendor/xbbcode/*": ["vendor/xbbcode/src/*"]

34
vendor/TeaClientServices/src/Action.ts vendored Normal file
View File

@ -0,0 +1,34 @@
import {MessageCommandErrorResult} from "./Messages";
import {clientServiceLogger} from "./Logging";
export type ActionResult<T> = {
unwrap() : T;
} & ({
status: "success",
result: T
} | {
status: "error",
result: MessageCommandErrorResult
});
export function createErrorResult<T>(result: MessageCommandErrorResult) : ActionResult<T> {
return {
status: "error",
result: result,
unwrap(): T {
clientServiceLogger.logError("Tried to unwrap an action which failed: %o", result);
throw "action failed with " + result.type;
}
}
}
export function createResult<T>(result: T) : ActionResult<T> {
return {
status: "success",
result: result,
unwrap(): T {
return result;
}
}
}

1
vendor/TeaEventBus vendored Submodule

@ -0,0 +1 @@
Subproject commit 9caad3399af830606e25e66f51ee40239bc3b457

View File

@ -230,7 +230,9 @@ export const config = async (target: "web" | "client"): Promise<Configuration> =
resolve: {
extensions: ['.tsx', '.ts', '.js', ".scss", ".css", ".wasm"],
alias: {
"vendor/xbbcode": path.resolve(__dirname, "vendor/xbbcode/src")
"vendor/xbbcode": path.resolve(__dirname, "vendor/xbbcode/src"),
"tc-events": path.resolve(__dirname, "vendor/TeaEventBus/src/index.ts"),
"tc-services": path.resolve(__dirname, "vendor/TeaClientServices/src/index.ts"),
},
},
externals: [