AppFlowy/frontend/rust-lib/flowy-text-block/src/lib.rs

28 lines
851 B
Rust
Raw Normal View History

2022-03-10 09:14:10 +00:00
pub mod editor;
mod entities;
mod event_handler;
pub mod event_map;
2022-02-18 15:04:55 +00:00
pub mod manager;
mod queue;
mod web_socket;
pub mod protobuf;
2022-02-18 15:04:55 +00:00
pub use manager::*;
2021-12-14 10:04:51 +00:00
pub mod errors {
pub use flowy_error::{internal_error, ErrorCode, FlowyError};
}
2022-01-10 15:45:59 +00:00
2022-03-12 14:52:24 +00:00
pub const TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
2022-02-18 15:04:55 +00:00
2022-01-10 15:45:59 +00:00
use crate::errors::FlowyError;
use flowy_sync::entities::text_block::{CreateTextBlockParams, ResetTextBlockParams, TextBlockIdPB, TextBlockInfoPB};
2022-01-10 15:45:59 +00:00
use lib_infra::future::FutureResult;
2022-02-25 14:27:44 +00:00
pub trait BlockCloudService: Send + Sync {
2022-03-10 09:14:10 +00:00
fn create_block(&self, token: &str, params: CreateTextBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 15:45:59 +00:00
fn read_block(&self, token: &str, params: TextBlockIdPB) -> FutureResult<Option<TextBlockInfoPB>, FlowyError>;
2022-01-10 15:45:59 +00:00
2022-03-10 09:14:10 +00:00
fn update_block(&self, token: &str, params: ResetTextBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 15:45:59 +00:00
}