mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +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 ShortcutComponent from "./shortcut_component.js";
|
||||
import { t, initLocale } from "../services/i18n.js";
|
||||
import NoteDetailWidget from "../widgets/note_detail.js";
|
||||
|
||||
interface Layout {
|
||||
getRootWidget: (appContext: AppContext) => RootWidget;
|
||||
@@ -27,11 +28,18 @@ interface BeforeUploadListener extends Component {
|
||||
beforeUnloadEvent(): boolean;
|
||||
}
|
||||
|
||||
interface TriggerData {
|
||||
export type TriggerData = {
|
||||
noteId?: string;
|
||||
noteIds?: string[];
|
||||
messages?: unknown[];
|
||||
messages?: unknown[];
|
||||
callback?: () => void;
|
||||
} | {
|
||||
ntxId: string;
|
||||
notePath: string;
|
||||
} | {
|
||||
text: string;
|
||||
} | {
|
||||
callback: (value: NoteDetailWidget | PromiseLike<NoteDetailWidget>) => void
|
||||
}
|
||||
|
||||
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 {
|
||||
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;
|
||||
maxEntityChangeSyncIdAtLoad: number;
|
||||
assetPath: string;
|
||||
instanceName: string;
|
||||
}
|
||||
|
||||
type RequireMethod = (moduleName: string) => any;
|
||||
@@ -64,7 +65,7 @@ declare global {
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -83,4 +84,5 @@ declare global {
|
||||
language: string
|
||||
});
|
||||
};
|
||||
var dayjs: {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user