mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 02:30:42 +01:00
docs(backend_api): generate frontend script API as well
This commit is contained in:
@@ -59,7 +59,7 @@ export interface Entity {
|
||||
|
||||
type Func = ((...args: unknown[]) => unknown) | string;
|
||||
|
||||
interface Api {
|
||||
export interface Api {
|
||||
/**
|
||||
* Container of all the rendered script content
|
||||
* */
|
||||
|
||||
20
src/public/app/services/frontend_script_entrypoint.ts
Normal file
20
src/public/app/services/frontend_script_entrypoint.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* The front script API is accessible to code notes with the "JS (frontend)" language.
|
||||
*
|
||||
* All the variables listed are globally accessible to the script.
|
||||
*
|
||||
* @module Frontend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note.
|
||||
*
|
||||
* Make sure to keep in line with frontend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
import FrontendScriptApi, { type Api } from "./frontend_script_api.js";
|
||||
export type { Api } from "./frontend_script_api.js";
|
||||
|
||||
//@ts-expect-error
|
||||
export const api: Api = new FrontendScriptApi();
|
||||
@@ -6,6 +6,13 @@
|
||||
* @module Backend Script API
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file creates the entrypoint for TypeDoc that simulates the context from within a
|
||||
* script note on the server side.
|
||||
*
|
||||
* Make sure to keep in line with backend's `script_context.ts`.
|
||||
*/
|
||||
|
||||
import BNote from "../becca/entities/bnote.js";
|
||||
import type { Api } from "./backend_script_api.js";
|
||||
import BackendScriptApi from "./backend_script_api.js";
|
||||
|
||||
Reference in New Issue
Block a user