Files
AFFiNE-Mirror/libs/components/board-commands/src/change-page.ts
T
2022-07-22 15:49:21 +08:00

19 lines
496 B
TypeScript

import type { TldrawCommand } from '@toeverything/components/board-types';
import type { TldrawApp } from '@toeverything/components/board-state';
export function changePage(app: TldrawApp, pageId: string): TldrawCommand {
return {
id: 'change_page',
before: {
appState: {
currentPageId: app.currentPageId,
},
},
after: {
appState: {
currentPageId: pageId,
},
},
};
}