110 lines
2.6 KiB
TypeScript
110 lines
2.6 KiB
TypeScript
declare const __env__: "development" | "production";
|
|
|
|
declare namespace Zotero {
|
|
let OrgExportAnnotations: import("../src/addon").OrgExportAnnotationsAddon & {
|
|
hooks: import("../src/hooks").Hooks;
|
|
};
|
|
|
|
const BetterNotes:
|
|
| {
|
|
api: {
|
|
convert: {
|
|
note2md(note: Zotero.Item, outputDir: string): Promise<string>;
|
|
};
|
|
};
|
|
}
|
|
| undefined;
|
|
}
|
|
|
|
interface Window {
|
|
OrgExportAnnotationsPrefs?: {
|
|
init(): void;
|
|
browseNotesPath(): Promise<void>;
|
|
browsePandocPath(): Promise<void>;
|
|
testPandoc(): Promise<void>;
|
|
exportAllNow(): Promise<void>;
|
|
forceExportAllNow(): Promise<void>;
|
|
};
|
|
}
|
|
|
|
interface MenuManagerMenu {
|
|
menuType: "menuitem" | "separator" | "submenu";
|
|
l10nID?: string;
|
|
label?: string;
|
|
icon?: string;
|
|
onCommand?: (event: Event, context: MenuManagerContext) => void;
|
|
onShowing?: (event: Event, context: MenuManagerContext) => void;
|
|
menus?: MenuManagerMenu[];
|
|
}
|
|
|
|
interface MenuManagerContext {
|
|
collectionTreeRow?: unknown;
|
|
items?: Zotero.Item[];
|
|
tabType?: string;
|
|
tabSubType?: string;
|
|
tabID?: string;
|
|
menuElem?: Element;
|
|
setL10nArgs?(l10nArgs: string): void;
|
|
setEnabled?(enabled: boolean): void;
|
|
setVisible?(visible: boolean): void;
|
|
setIcon?(icon: string, darkIcon?: string): void;
|
|
}
|
|
|
|
interface MenuManagerRegistration {
|
|
menuID: string;
|
|
pluginID: string;
|
|
target: string;
|
|
menus: MenuManagerMenu[];
|
|
}
|
|
|
|
declare namespace Zotero {
|
|
const MenuManager:
|
|
| {
|
|
registerMenu(options: MenuManagerRegistration): void;
|
|
unregisterMenu(menuID: string): void;
|
|
updateMenuPopup(
|
|
menu: Element,
|
|
target: string,
|
|
options: { getContext: () => MenuManagerContext }
|
|
): void;
|
|
}
|
|
| undefined;
|
|
}
|
|
|
|
declare namespace IOUtils {
|
|
function remove(path: string): Promise<void>;
|
|
function exists(path: string): Promise<boolean>;
|
|
function makeDirectory(path: string, options?: { ignoreExisting?: boolean }): Promise<void>;
|
|
}
|
|
|
|
declare namespace PathUtils {
|
|
function normalize(path: string): string;
|
|
function join(...parts: string[]): string;
|
|
function filename(path: string): string;
|
|
const profileDir: string;
|
|
}
|
|
|
|
// Gecko/XPCOM globals available in Zotero 7 runtime
|
|
declare const Services: {
|
|
dirsvc: {
|
|
get(prop: string, iface: unknown): { path: string };
|
|
};
|
|
io: {
|
|
newURI(spec: string): unknown;
|
|
};
|
|
scriptloader: {
|
|
loadSubScript(url: string): void;
|
|
};
|
|
};
|
|
|
|
declare const Ci: {
|
|
nsIFile: unknown;
|
|
amIAddonManagerStartup: unknown;
|
|
};
|
|
|
|
declare const Cc: {
|
|
[contractID: string]: {
|
|
getService(iface: unknown): unknown;
|
|
};
|
|
};
|