diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-04-09 02:31:19 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-04-09 02:31:19 -0400 |
commit | df170f53e2c88bd77a552e42b2eba5470b15cb03 (patch) | |
tree | 1d7b375e255c3dfe4b08eb6646c81fdae82c4ecb /src/client/util/Scripting.ts | |
parent | 6cc17bfccef7ec0e2ec25706c1f27ee56ca2fc5b (diff) |
cleaned up some scriptingBox code -- added parameters
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; |