mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Port services/meta/*
This commit is contained in:
parent
748a551def
commit
45582ebaac
@ -16,9 +16,9 @@ const archiver = require('archiver');
|
|||||||
const log = require('../log');
|
const log = require('../log');
|
||||||
const TaskContext = require('../task_context');
|
const TaskContext = require('../task_context');
|
||||||
const ValidationError = require('../../errors/validation_error');
|
const ValidationError = require('../../errors/validation_error');
|
||||||
const NoteMeta = require('../meta/note_meta.js');
|
const NoteMeta = require('../meta/note_meta');
|
||||||
const AttachmentMeta = require('../meta/attachment_meta.js');
|
const AttachmentMeta = require('../meta/attachment_meta');
|
||||||
const AttributeMeta = require('../meta/attribute_meta.js');
|
const AttributeMeta = require('../meta/attribute_meta');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {TaskContext} taskContext
|
* @param {TaskContext} taskContext
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
class AttachmentMeta {
|
|
||||||
/** @type {string} */
|
|
||||||
attachmentId;
|
|
||||||
/** @type {string} */
|
|
||||||
title;
|
|
||||||
/** @type {string} */
|
|
||||||
role;
|
|
||||||
/** @type {string} */
|
|
||||||
mime;
|
|
||||||
/** @type {int} */
|
|
||||||
position;
|
|
||||||
/** @type {string} */
|
|
||||||
dataFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = AttachmentMeta;
|
|
10
src/services/meta/attachment_meta.ts
Normal file
10
src/services/meta/attachment_meta.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
interface AttachmentMeta {
|
||||||
|
attachmentId: string;
|
||||||
|
title: string;
|
||||||
|
role: string;
|
||||||
|
mime: string;
|
||||||
|
position: number;
|
||||||
|
dataFileName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = AttachmentMeta;
|
@ -1,14 +0,0 @@
|
|||||||
class AttributeMeta {
|
|
||||||
/** @type {string} */
|
|
||||||
type;
|
|
||||||
/** @type {string} */
|
|
||||||
name;
|
|
||||||
/** @type {string} */
|
|
||||||
value;
|
|
||||||
/** @type {boolean} */
|
|
||||||
isInheritable;
|
|
||||||
/** @type {int} */
|
|
||||||
position;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = AttributeMeta;
|
|
9
src/services/meta/attribute_meta.ts
Normal file
9
src/services/meta/attribute_meta.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
interface AttributeMeta {
|
||||||
|
type: string;
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
isInheritable: boolean;
|
||||||
|
position: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export = AttributeMeta;
|
@ -1,36 +0,0 @@
|
|||||||
class NoteMeta {
|
|
||||||
/** @type {string} */
|
|
||||||
noteId;
|
|
||||||
/** @type {string} */
|
|
||||||
notePath;
|
|
||||||
/** @type {boolean} */
|
|
||||||
isClone;
|
|
||||||
/** @type {string} */
|
|
||||||
title;
|
|
||||||
/** @type {int} */
|
|
||||||
notePosition;
|
|
||||||
/** @type {string} */
|
|
||||||
prefix;
|
|
||||||
/** @type {boolean} */
|
|
||||||
isExpanded;
|
|
||||||
/** @type {string} */
|
|
||||||
type;
|
|
||||||
/** @type {string} */
|
|
||||||
mime;
|
|
||||||
/** @type {string} - 'html' or 'markdown', applicable to text notes only */
|
|
||||||
format;
|
|
||||||
/** @type {string} */
|
|
||||||
dataFileName;
|
|
||||||
/** @type {string} */
|
|
||||||
dirFileName;
|
|
||||||
/** @type {boolean} - this file should not be imported (e.g., HTML navigation) */
|
|
||||||
noImport = false;
|
|
||||||
/** @type {AttributeMeta[]} */
|
|
||||||
attributes;
|
|
||||||
/** @type {AttachmentMeta[]} */
|
|
||||||
attachments;
|
|
||||||
/** @type {NoteMeta[]|undefined} */
|
|
||||||
children;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = NoteMeta;
|
|
24
src/services/meta/note_meta.ts
Normal file
24
src/services/meta/note_meta.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import AttributeMeta = require("./attribute_meta");
|
||||||
|
|
||||||
|
interface NoteMeta {
|
||||||
|
noteId: string;
|
||||||
|
notePath: string;
|
||||||
|
isClone: boolean;
|
||||||
|
title: string;
|
||||||
|
notePosition: number;
|
||||||
|
prefix: string;
|
||||||
|
isExpanded: boolean;
|
||||||
|
type: string;
|
||||||
|
mime: string;
|
||||||
|
/** 'html' or 'markdown', applicable to text notes only */
|
||||||
|
format: "html" | "markdown";
|
||||||
|
dataFileName: string;
|
||||||
|
dirFileName: string;
|
||||||
|
/** this file should not be imported (e.g., HTML navigation) */
|
||||||
|
noImport: boolean;
|
||||||
|
attributes: AttributeMeta[];
|
||||||
|
attachments: AttributeMeta[];
|
||||||
|
children?: NoteMeta[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export = NoteMeta;
|
Loading…
x
Reference in New Issue
Block a user