diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-02-11 20:25:15 -0500 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-02-11 20:25:15 -0500 |
commit | 867fd2bffb67be06e889d3ac0fb6603bc8c4d92a (patch) | |
tree | 6b045d218d8211b5e0ac9f2b7fdb9e45dfe30515 /src/fields/Key.ts | |
parent | 448f8880b50dc50090a596cafaf68d2f444ce3db (diff) |
asdkjfl
Diffstat (limited to 'src/fields/Key.ts')
-rw-r--r-- | src/fields/Key.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fields/Key.ts b/src/fields/Key.ts index 993102613..a7303f351 100644 --- a/src/fields/Key.ts +++ b/src/fields/Key.ts @@ -1,6 +1,7 @@ -import { Field } from "./Field" +import { Field, FIELD_ID } from "./Field" import { Utils } from "../Utils"; import { observable } from "mobx"; +import { Types } from "../server/Message"; export class Key extends Field { private name: string; @@ -31,6 +32,13 @@ export class Key extends Field { return name; } + ToJson(): { type: Types, data: string, id: string } { + return { + type: Types.Key, + data: this.name, + id: this.Id as string + } + } } export namespace KeyStore { @@ -50,4 +58,8 @@ export namespace KeyStore { export const LayoutKeys = new Key("LayoutKeys"); export const LayoutFields = new Key("LayoutFields"); export const ColumnsKey = new Key("SchemaColumns"); + + export function Get(name: string): Key { + return new Key(name) + } }
\ No newline at end of file |