mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-01 12:27:41 +08:00
chore(client/ts): port services/glob
This commit is contained in:
parent
6e8fa6d757
commit
14dd3a0021
@ -27,7 +27,7 @@ function setupGlobs() {
|
|||||||
window.glob.importMarkdownInline = async () => appContext.triggerCommand("importMarkdownInline");
|
window.glob.importMarkdownInline = async () => appContext.triggerCommand("importMarkdownInline");
|
||||||
|
|
||||||
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
window.onerror = function (msg, url, lineNo, columnNo, error) {
|
||||||
const string = msg.toLowerCase();
|
const string = String(msg).toLowerCase();
|
||||||
|
|
||||||
let message = "Uncaught error: ";
|
let message = "Uncaught error: ";
|
||||||
|
|
@ -350,7 +350,7 @@ function openHelp($button: JQuery<HTMLElement>) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initHelpButtons($el: JQuery<HTMLElement>) {
|
function initHelpButtons($el: JQuery<HTMLElement> | JQuery<Window>) {
|
||||||
// for some reason, the .on(event, listener, handler) does not work here (e.g. Options -> Sync -> Help button)
|
// for some reason, the .on(event, listener, handler) does not work here (e.g. Options -> Sync -> Help button)
|
||||||
// so we do it manually
|
// so we do it manually
|
||||||
$el.on("click", e => {
|
$el.on("click", e => {
|
||||||
|
12
src/public/app/types.d.ts
vendored
12
src/public/app/types.d.ts
vendored
@ -3,6 +3,9 @@ import type { BackendModule, i18n } from "i18next";
|
|||||||
import type { Froca } from "./services/froca-interface";
|
import type { Froca } from "./services/froca-interface";
|
||||||
import type { HttpBackendOptions } from "i18next-http-backend";
|
import type { HttpBackendOptions } from "i18next-http-backend";
|
||||||
import { Suggestion } from "./services/note_autocomplete.ts";
|
import { Suggestion } from "./services/note_autocomplete.ts";
|
||||||
|
import utils from "./services/utils.ts";
|
||||||
|
import appContext from "./components/app_context.ts";
|
||||||
|
import server from "./services/server.ts";
|
||||||
|
|
||||||
interface ElectronProcess {
|
interface ElectronProcess {
|
||||||
type: string;
|
type: string;
|
||||||
@ -10,11 +13,11 @@ interface ElectronProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface CustomGlobals {
|
interface CustomGlobals {
|
||||||
isDesktop: boolean;
|
isDesktop: typeof utils.isDesktop;
|
||||||
isMobile: boolean;
|
isMobile: typeof utils.isMobile;
|
||||||
device: "mobile" | "desktop";
|
device: "mobile" | "desktop";
|
||||||
getComponentsByEl: (el: unknown) => unknown;
|
getComponentByEl: typeof appContext.getComponentByEl;
|
||||||
getHeaders: Promise<Record<string, string>>;
|
getHeaders: typeof server.getHeaders;
|
||||||
getReferenceLinkTitle: (href: string) => Promise<string>;
|
getReferenceLinkTitle: (href: string) => Promise<string>;
|
||||||
getReferenceLinkTitleSync: (href: string) => string;
|
getReferenceLinkTitleSync: (href: string) => string;
|
||||||
getActiveContextNote: FNote;
|
getActiveContextNote: FNote;
|
||||||
@ -36,6 +39,7 @@ interface CustomGlobals {
|
|||||||
maxEntityChangeSyncIdAtLoad: number;
|
maxEntityChangeSyncIdAtLoad: number;
|
||||||
assetPath: string;
|
assetPath: string;
|
||||||
instanceName: string;
|
instanceName: string;
|
||||||
|
appCssNoteIds: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequireMethod = (moduleName: string) => any;
|
type RequireMethod = (moduleName: string) => any;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user