import type { IRouter } from './routers'; /** * Read-only projection of a page: every read method of {@link IPage}, without the * mutators. Returned by `pages.list()` and the base shape of `pages.getCurrent()` * for pages that are not connected to a router owned by the calling app. */ export interface IReadOnlyPage { getExtensionId(): Promise; getTitle(): Promise; getSlug(): Promise; getPageId(): Promise; equals(other: IReadOnlyPage): boolean; } export interface IPage extends IReadOnlyPage { updateTitle(title: string): Promise; updateSlug(slug: string): Promise; } /** * Read-only projection of a router-connected page: the read-only page surface plus * the page's role within its router and read-only access to the router itself. */ export interface IReadOnlyRouterPage extends IReadOnlyPage { getPageRole(): Promise; getRouter(): Promise; } export interface IRouterPage extends IReadOnlyRouterPage, IPage { updatePageRole(pageRole: string): Promise; isConnected(): Promise; connect(pageRole: string): Promise; disconnect(): Promise; } export interface AddExtensionOptions { title?: string; slug?: string; addToSiteMenu?: boolean; } export interface AddTemplateOptions extends AddExtensionOptions { slug: string; }