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/Document.ts | |
parent | 448f8880b50dc50090a596cafaf68d2f444ce3db (diff) |
asdkjfl
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r-- | src/fields/Document.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 6f9752a8e..e32e03070 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -6,6 +6,7 @@ import { TextField } from "./TextField"; import { ListField } from "./ListField"; import { findDOMNode } from "react-dom"; import { Server } from "../client/Server"; +import { Types } from "../server/Message"; export class Document extends Field { public fields: ObservableMap<Key, Opt<Field>> = new ObservableMap(); @@ -155,5 +156,19 @@ export class Document extends Field { throw new Error("Method not implemented."); } + ToJson(): { type: Types, data: [string, string][], id: string } { + let fields: [string, string][] = [] + this._proxies.forEach((field, key) => { + if (field) { + fields.push([key.Name, field as string]) + } + }); + + return { + type: Types.Document, + data: fields, + id: this.Id as string + } + } }
\ No newline at end of file |