server-ts: Convert services/script_context

This commit is contained in:
Elian Doran
2024-04-04 22:29:12 +03:00
parent 15dee4b952
commit 884b6618fb
5 changed files with 51 additions and 30 deletions

View File

@@ -33,6 +33,7 @@ import BOption = require('../becca/entities/boption');
import { AttributeRow, AttributeType, NoteType } from '../becca/entities/rows';
import Becca from '../becca/becca-interface';
import { NoteParams } from './note-interface';
import { ApiParams } from './backend_script_api_interface';
/**
@@ -46,11 +47,6 @@ import { NoteParams } from './note-interface';
* @var {BackendScriptApi} api
*/
interface ApiParams {
startNote: BNote;
originEntity: AbstractBeccaEntity<any>;
}
interface SearchParams {
includeArchivedNotes?: boolean;
ignoreHoistedNote?: boolean;
@@ -384,6 +380,7 @@ interface Api {
};
}
// TODO: Convert to class.
/**
* <p>This is the main backend API interface for scripts. All the properties and methods are published in the "api" object
* available in the JS backend notes. You can use e.g. <code>api.log(api.startNote.title);</code></p>
@@ -654,4 +651,6 @@ function BackendScriptApi(this: Api, currentNote: BNote, apiParams: ApiParams) {
}
}
export = BackendScriptApi;
export = BackendScriptApi as any as {
new (currentNote: BNote, apiParams: ApiParams): Api
};