Files
AFFiNE-Mirror/libs/components/board-commands/src/change-page.ts
T
2022-08-13 02:45:04 +08:00

19 lines
496 B
TypeScript

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