Files
Synapse/app/lib/src/rust/api/graph.dart
T
dasemuandClaude Opus 5.5 df42d4010f feat(app): Flutter outliner with journals, page view and timeline
Logseq-like outliner (render/edit Markdown per block, Enter/Tab/Shift-Tab,
backspace merge, arrow navigation, drag to reorder, collapse, [[ # ((
autocomplete, TODO/DONE), journals feed with prev/next links, page view with
linked references and related panel, virtualised CustomPainter timeline,
Ctrl+K quick switcher, sidebar with recents, light/dark theme with bundled
Inter, Noto Serif and Source Code Pro. Edits are optimistic and serialised
to the core through one write queue. Cargokit builds synapse-ffi; its build
tool is patched to use the library name (synapse_ffi) of hyphenated crates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 03:59:42 +02:00

140 lines
5.1 KiB
Dart

// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.13.0.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
import 'dto.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `asset_dto`, `lock`, `outline`, `page_view`, `parse_date`, `parse_day`, `parse_id`
// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<SynapseGraph>>
abstract class SynapseGraph implements RustOpaqueInterface {
Future<void> addAlias({required String pageId, required String alias});
Future<List<String>> aliases({required String pageId});
/// Local file path of an asset (for `asset://<hash>` images), if present.
String? assetPath({required String hash});
/// Linked references grouped by page (most recently edited first).
Future<List<BacklinkGroup>> backlinks({required String pageId});
/// Target of a `((block ref))`.
Future<BlockRefDto?> blockRef({required String id});
/// Deletes a block and its subtree.
Future<List<BlockDto>> deleteBlock({required String id});
Future<void> deletePage({required String id});
/// Graph directory.
String dir();
/// Tab: the block becomes the last child of its previous sibling (no-op for a first child).
Future<List<BlockDto>> indentBlock({required String id});
Future<BlockDto> insertBlock({
required String pageId,
required Place place,
required String content,
});
/// The journal of `date` (created if missing).
Future<PageData> journal({required String date});
Future<(String?, String?)> journalNeighbors({required String date});
/// Journals feed, newest first. With `before = None` it starts at today (creating today's
/// journal); otherwise at the newest journal strictly before `before`.
Future<List<PageData>> journals({String? before, required int limit});
/// Pages ordered by last update, most recent first.
Future<List<PageDto>> listPages({
required bool includeJournals,
required int limit,
required int offset,
});
/// Backspace at the start of `id`: its text is appended to `into` (the previous visible
/// block) and the block is deleted. Its children keep their visual place: they take the
/// block's slot when `into` is its parent, otherwise they become last children of `into`.
Future<List<BlockDto>> mergeBlock({required String id, required String into});
/// Moves a block with its subtree (drag and drop), possibly to another page.
Future<List<BlockDto>> moveBlock({
required String id,
required String pageId,
required Place place,
});
/// Opens (or creates) the graph stored in `dir`.
static Future<SynapseGraph> open({required String dir}) =>
RustLib.instance.api.crateApiGraphSynapseGraphOpen(dir: dir);
/// Page by title or alias, created if missing (following a `[[link]]`). Date titles open
/// the journal of that day.
Future<PageData> openPage({required String title});
/// Shift-Tab: the block moves right after its parent, adopting its following siblings as
/// children so it keeps its visual place (Logseq's default outdenting).
Future<List<BlockDto>> outdentBlock({required String id});
/// Current outline of a page.
Future<List<BlockDto>> outline({required String pageId});
Future<PageData?> page({required String id});
/// Page by title or alias, without creating it.
Future<PageData?> pageByTitle({required String title});
/// Stores in-memory bytes (clipboard, Android content URIs).
Future<AssetDto> putAssetBytes({
required List<int> bytes,
String? name,
String? mime,
});
/// Copies a file into the blob store (streamed).
Future<AssetDto> putAssetFile({required String path, String? mime});
/// Records navigation between pages (strengthens their synapse).
Future<void> recordVisit({String? from, required String to});
/// Notes related to `page_id` by spreading activation.
Future<List<RelatedDto>> related({
required String pageId,
required int limit,
});
Future<void> removeAlias({required String alias});
Future<PageDto> renamePage({required String id, required String newTitle});
/// Blocks whose text contains `query` (for `((` autocomplete), most recent first.
Future<List<BlockHit>> searchBlocks({
required String query,
required int limit,
});
/// Page titles and aliases matching `query`: exact, then prefix, then word-prefix, then
/// substring; shorter titles first within a tier. Empty query returns recent pages.
Future<List<TitleHit>> searchTitles({
required String query,
required int limit,
});
Future<void> setCollapsed({required String id, required bool collapsed});
/// Timeline data for `[from, to]` (oldest first) with titles of every page it mentions.
Future<TimelineDto> timeline({required String from, required String to});
/// Today's date (graph clock) as `YYYY-MM-DD`.
String today();
/// Replaces a block's Markdown (the debounced save while typing).
Future<void> updateBlock({required String id, required String content});
}