aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Document.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r--src/fields/Document.ts15
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