106 lines
2.5 KiB
TypeScript
Raw Normal View History

2024-02-17 01:00:38 +02:00
// FIXME: Booleans should probably be numbers instead (as SQLite does not have booleans.);
export interface AttachmentRow {
attachmentId?: string;
2024-02-17 10:56:27 +02:00
ownerId?: string;
role: string;
mime: string;
title?: string;
position?: number;
2024-02-17 10:56:27 +02:00
blobId?: string;
isProtected?: boolean;
dateModified?: string;
utcDateModified?: string;
utcDateScheduledForErasureSince?: string;
contentLength?: number;
2024-02-17 10:56:27 +02:00
content?: string;
}
export interface RevisionRow {
2024-02-17 10:56:27 +02:00
revisionId?: string;
noteId: string;
type: string;
mime: string;
2024-02-17 10:56:27 +02:00
isProtected?: boolean;
title: string;
2024-02-17 10:56:27 +02:00
blobId?: string;
dateLastEdited?: string;
dateCreated: string;
2024-02-17 10:56:27 +02:00
utcDateLastEdited?: string;
utcDateCreated: string;
utcDateModified: string;
contentLength?: number;
}
export interface RecentNoteRow {
noteId: string;
notePath: string;
utcDateCreated?: string;
}
2024-02-17 01:00:38 +02:00
export interface OptionRow {
name: string;
value: string;
isSynced: boolean;
utcDateModified: string;
2024-02-17 01:03:38 +02:00
}
export interface EtapiTokenRow {
etapiTokenId: string;
name: string;
tokenHash: string;
utcDateCreated?: string;
utcDateModified?: string;
isDeleted: boolean;
2024-02-17 01:06:07 +02:00
}
export interface BlobRow {
blobId: string;
content: string | Buffer;
contentLength: number;
dateModified: string;
utcDateModified: string;
2024-02-17 01:19:49 +02:00
}
export type AttributeType = "label" | "relation";
export interface AttributeRow {
attributeId?: string;
noteId: string;
type: AttributeType;
name: string;
position: number;
value: string;
isInheritable: boolean;
2024-02-17 10:56:27 +02:00
utcDateModified?: string;
}
export interface BranchRow {
branchId?: string;
noteId: string;
parentNoteId: string;
prefix: string | null;
notePosition: number;
isExpanded: boolean;
utcDateModified?: string;
2024-02-17 10:56:27 +02:00
}
/**
* There are many different Note types, some of which are entirely opaque to the
* end user. Those types should be used only for checking against, they are
* not for direct use.
*/
export type NoteType = ("file" | "image" | "search" | "noteMap" | "launcher" | "doc" | "contentWidget" | "text" | "relationMap" | "render" | "canvas" | "mermaid" | "book" | "webView" | "code");
export interface NoteRow {
noteId: string;
title: string;
type: NoteType;
mime: string;
isProtected: boolean;
blobId: string;
dateCreated: string;
dateModified: string;
utcDateCreated: string;
utcDateModified: string;
2024-02-17 01:00:38 +02:00
}