scrapbox.d.ts
code:type.d.ts
interface Line {
text: string;
id: string;
userId: string;
created: number;
created: number;
}
interface Page {
lines: Line[];
id: string;
title: string;
}
interface Project {
name: string;
pages: {
exists: boolean;
hasIcon?: boolean;
id: string;
title: string;
titleLc: string;
updated: number;
}[];
}
interface TimeStamp {
addFormat: (format: string | () => string) => void;
removeAllFormats: () => void;
}
interface PageMenu {
_onChangeListeners: function[];
addItem:
menus: Map
reset:
emitChange:
menuName: string;
}
interface PopupMenu {
addButton: (props: {title: string; onClick: (text?: string) => string | undefined;}) => void;
}
interface Scrapbox {
Page: Page;
Project: Project;
TimeStamp: TimeStamp;
Layout: 'list' | 'page' | 'stream' | 'project-settings-basic-page' | 'project-settings-members-page' | 'project-settings-billing-page' | 'settings-profile-page' | 'settings-extensions-page' | 'settings-delete-account-page';
PopupMenu: PopupMenu;
PageMenu: ((menuName?: string) => PageMenu) & {
addItem:
addMenu:
addSeparator:
name:
removeAllItems:
};
}
declare const scrapbox: Scrapbox;