From d5af182ce3963dcabef83a32cb01a8431d7b09da Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Thu, 12 Sep 2024 14:45:06 +0900 Subject: [PATCH] Revise the codes --- .eslintignore | 4 ++-- packages/sdk/src/document/document.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.eslintignore b/.eslintignore index c102076d9..c02d9da25 100644 --- a/.eslintignore +++ b/.eslintignore @@ -9,5 +9,5 @@ packages/sdk/src/api/yorkie/v1/resources_pb.d.ts packages/sdk/test/vitest.d.ts packages/sdk/lib -# react-tldraw -examples/react-tldraw/src/tldraw.d.ts \ No newline at end of file +# examples +examples/react-tldraw/src/tldraw.d.ts diff --git a/packages/sdk/src/document/document.ts b/packages/sdk/src/document/document.ts index 056b3e4b0..311f91d3c 100644 --- a/packages/sdk/src/document/document.ts +++ b/packages/sdk/src/document/document.ts @@ -420,21 +420,26 @@ export type DocEventTopic = keyof DocEventCallbackMap; export type DocEventCallback

= DocEventCallbackMap

[DocEventTopic]; -export type Json = JsonScalar | JsonArray | JsonObject; +/** + * `Json` represents the JSON data type. It is used to represent the data + * structure of the document. + */ +export type Json = JsonPrimitive | JsonArray | JsonObject; // eslint-disable-next-line @typescript-eslint/ban-types -type JsonScalar = string | number | boolean | null; +type JsonPrimitive = string | number | boolean | null; type JsonArray = Array; type JsonObject = { [key: string]: Json | undefined }; /** - * Indexable key, value + * `Indexable` represents the type of the indexable object. It is used to + * represent the presence information of the client. * @public */ export type Indexable = Record; /** - * Document key type + * `DocumentKey` represents the key of the document. * @public */ export type DocumentKey = string;