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

24 lines
763 B
Rust
Raw Normal View History

2022-02-26 03:03:42 +00:00
pub mod block_editor;
2022-02-18 15:04:55 +00:00
pub mod manager;
mod queue;
mod web_socket;
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-02-18 15:04:55 +00:00
pub const DOCUMENT_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
2022-01-10 15:45:59 +00:00
use crate::errors::FlowyError;
2022-02-25 14:27:44 +00:00
use flowy_collaboration::entities::document_info::{BlockId, BlockInfo, CreateBlockParams, ResetDocumentParams};
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 {
fn create_block(&self, token: &str, params: CreateBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 15:45:59 +00:00
2022-02-25 14:27:44 +00:00
fn read_block(&self, token: &str, params: BlockId) -> FutureResult<Option<BlockInfo>, FlowyError>;
2022-01-10 15:45:59 +00:00
2022-02-25 14:27:44 +00:00
fn update_block(&self, token: &str, params: ResetDocumentParams) -> FutureResult<(), FlowyError>;
2022-01-10 15:45:59 +00:00
}