mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
chore(client/ts): port services/frontend_script_api
This commit is contained in:
@@ -14,6 +14,7 @@ import MainTreeExecutors from "./main_tree_executors.js";
|
|||||||
import toast from "../services/toast.js";
|
import toast from "../services/toast.js";
|
||||||
import ShortcutComponent from "./shortcut_component.js";
|
import ShortcutComponent from "./shortcut_component.js";
|
||||||
import { t, initLocale } from "../services/i18n.js";
|
import { t, initLocale } from "../services/i18n.js";
|
||||||
|
import NoteDetailWidget from "../widgets/note_detail.js";
|
||||||
|
|
||||||
interface Layout {
|
interface Layout {
|
||||||
getRootWidget: (appContext: AppContext) => RootWidget;
|
getRootWidget: (appContext: AppContext) => RootWidget;
|
||||||
@@ -27,11 +28,18 @@ interface BeforeUploadListener extends Component {
|
|||||||
beforeUnloadEvent(): boolean;
|
beforeUnloadEvent(): boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TriggerData {
|
export type TriggerData = {
|
||||||
noteId?: string;
|
noteId?: string;
|
||||||
noteIds?: string[];
|
noteIds?: string[];
|
||||||
messages?: unknown[];
|
messages?: unknown[];
|
||||||
callback?: () => void;
|
callback?: () => void;
|
||||||
|
} | {
|
||||||
|
ntxId: string;
|
||||||
|
notePath: string;
|
||||||
|
} | {
|
||||||
|
text: string;
|
||||||
|
} | {
|
||||||
|
callback: (value: NoteDetailWidget | PromiseLike<NoteDetailWidget>) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppContext extends Component {
|
class AppContext extends Component {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
type Callback = () => Promise<void>;
|
type Callback = () => Promise<void> | void;
|
||||||
|
|
||||||
export default class SpacedUpdate {
|
export default class SpacedUpdate {
|
||||||
private updater: Callback;
|
private updater: Callback;
|
||||||
|
|||||||
4
src/public/app/types.d.ts
vendored
4
src/public/app/types.d.ts
vendored
@@ -34,6 +34,7 @@ interface CustomGlobals {
|
|||||||
maxEntityChangeIdAtLoad: number;
|
maxEntityChangeIdAtLoad: number;
|
||||||
maxEntityChangeSyncIdAtLoad: number;
|
maxEntityChangeSyncIdAtLoad: number;
|
||||||
assetPath: string;
|
assetPath: string;
|
||||||
|
instanceName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequireMethod = (moduleName: string) => any;
|
type RequireMethod = (moduleName: string) => any;
|
||||||
@@ -64,7 +65,7 @@ declare global {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface JQuery {
|
interface JQuery {
|
||||||
autocomplete: (action: "close" | "open" | "destroy" | AutoCompleteConfig, args?: AutoCompleteArg[]) => void;
|
autocomplete: (action: "close" | "open" | "destroy" | AutoCompleteConfig, args?: AutoCompleteArg[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
var logError: (message: string) => void;
|
var logError: (message: string) => void;
|
||||||
@@ -83,4 +84,5 @@ declare global {
|
|||||||
language: string
|
language: string
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var dayjs: {};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user