mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
client-ts: Add some small adjustments
This commit is contained in:
parent
f1896c3f5f
commit
28f633d903
@ -23,6 +23,10 @@ interface RequestData {
|
|||||||
silentNotFound: boolean;
|
silentNotFound: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface StandardResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
async function getHeaders(headers?: Headers) {
|
async function getHeaders(headers?: Headers) {
|
||||||
const appContext = (await import('../components/app_context.js')).default;
|
const appContext = (await import('../components/app_context.js')).default;
|
||||||
const activeNoteContext = appContext.tabManager ? appContext.tabManager.getActiveContext() : null;
|
const activeNoteContext = appContext.tabManager ? appContext.tabManager.getActiveContext() : null;
|
||||||
@ -62,7 +66,7 @@ async function post<T>(url: string, data?: unknown, componentId?: string) {
|
|||||||
return await call<T>('POST', url, componentId, { data });
|
return await call<T>('POST', url, componentId, { data });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function put<T>(url: string, data: unknown, componentId?: string) {
|
async function put<T>(url: string, data?: unknown, componentId?: string) {
|
||||||
return await call<T>('PUT', url, componentId, { data });
|
return await call<T>('PUT', url, componentId, { data });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
src/public/app/types.d.ts
vendored
1
src/public/app/types.d.ts
vendored
@ -2,6 +2,7 @@ import FNote from "./entities/fnote";
|
|||||||
|
|
||||||
interface ElectronProcess {
|
interface ElectronProcess {
|
||||||
type: string;
|
type: string;
|
||||||
|
platform: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CustomGlobals {
|
interface CustomGlobals {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user