From f3223924b518eb957e99ec2556f642b03c4cda88 Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:48:27 +0900 Subject: [PATCH 1/2] feat(api): update event interfaces for page leave and infobox reload --- websocket/event.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/websocket/event.ts b/websocket/event.ts index 5ce5922..ee451cb 100644 --- a/websocket/event.ts +++ b/websocket/event.ts @@ -28,6 +28,7 @@ export interface EmitEventMap { | { error: { name: string; message?: string } }, ) => void, ) => void; + "page-leave": (req: { projectId: ProjectId, pageId: PageId }) => void; cursor: (req: Omit) => void; } @@ -94,7 +95,7 @@ export interface ListenEventMap { "quick-search:commit": (event: QuickSearchCommit) => void; "quick-search:replace-link": QuickSearchReplaceLink; "infobox:updating": boolean; - "infobox:reload": void; + "infobox:reload": (event: { updating: boolean }) => void; "literal-database:reload": void; } @@ -106,15 +107,15 @@ export interface ProjectUpdatesStreamCommit { pageId: PageId; userId: UserId; changes: - | ( - | InsertChange - | UpdateChange - | DeleteChange - | TitleChange - | LinksChange - | IconsChange - )[] - | [DeletePageChange]; + | ( + | InsertChange + | UpdateChange + | DeleteChange + | TitleChange + | LinksChange + | IconsChange + )[] + | [DeletePageChange]; cursor: null; freeze: true; } @@ -125,8 +126,8 @@ export interface CommitNotification extends PageCommit { export interface QuickSearchCommit extends Omit { changes: - | (TitleChange | LinksChange | DescriptionsChange | ImageChange)[] - | [DeletePageChange]; + | (TitleChange | LinksChange | DescriptionsChange | ImageChange)[] + | [DeletePageChange]; } export interface QuickSearchReplaceLink { From 4e856beab2221c49623fa2d42c1af040c3d52970 Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:50:30 +0900 Subject: [PATCH 2/2] style: deno fmt --- websocket/event.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/websocket/event.ts b/websocket/event.ts index ee451cb..402013b 100644 --- a/websocket/event.ts +++ b/websocket/event.ts @@ -28,7 +28,7 @@ export interface EmitEventMap { | { error: { name: string; message?: string } }, ) => void, ) => void; - "page-leave": (req: { projectId: ProjectId, pageId: PageId }) => void; + "page-leave": (req: { projectId: ProjectId; pageId: PageId }) => void; cursor: (req: Omit) => void; } @@ -107,15 +107,15 @@ export interface ProjectUpdatesStreamCommit { pageId: PageId; userId: UserId; changes: - | ( - | InsertChange - | UpdateChange - | DeleteChange - | TitleChange - | LinksChange - | IconsChange - )[] - | [DeletePageChange]; + | ( + | InsertChange + | UpdateChange + | DeleteChange + | TitleChange + | LinksChange + | IconsChange + )[] + | [DeletePageChange]; cursor: null; freeze: true; } @@ -126,8 +126,8 @@ export interface CommitNotification extends PageCommit { export interface QuickSearchCommit extends Omit { changes: - | (TitleChange | LinksChange | DescriptionsChange | ImageChange)[] - | [DeletePageChange]; + | (TitleChange | LinksChange | DescriptionsChange | ImageChange)[] + | [DeletePageChange]; } export interface QuickSearchReplaceLink {