Skip to content

Commit

Permalink
Revise the codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Sep 12, 2024
1 parent b8b571e commit d5af182
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
# examples
examples/react-tldraw/src/tldraw.d.ts
13 changes: 9 additions & 4 deletions packages/sdk/src/document/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,26 @@ export type DocEventTopic = keyof DocEventCallbackMap<never>;
export type DocEventCallback<P extends Indexable> =
DocEventCallbackMap<P>[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<Json>;
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<string, Json>;

/**
* Document key type
* `DocumentKey` represents the key of the document.
* @public
*/
export type DocumentKey = string;
Expand Down

0 comments on commit d5af182

Please sign in to comment.