diff options
Diffstat (limited to 'src/client/util/Scripting.ts')
-rw-r--r-- | src/client/util/Scripting.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts index f97d91d10..57d22eaf8 100644 --- a/src/client/util/Scripting.ts +++ b/src/client/util/Scripting.ts @@ -24,6 +24,8 @@ export interface ScriptError { export type ScriptResult = ScriptSucccess | ScriptError; +export type ScriptParam = { [name: string]: string }; + export interface CompiledScript { readonly compiled: true; readonly originalScript: string; @@ -37,6 +39,12 @@ export interface CompileError { } export type CompileResult = CompiledScript | CompileError; +export function isCompileError(toBeDetermined: CompileResult): toBeDetermined is CompileError { + if ((toBeDetermined as CompileError).errors) { + return true + } + return false +} export namespace Scripting { export function addGlobal(global: { name: string }): void; |