30 lines
862 B
Rust
Raw Normal View History

2022-03-10 17:14:10 +08:00
pub mod editor;
mod entities;
mod event_handler;
pub mod event_map;
2022-02-18 23:04:55 +08:00
pub mod manager;
mod queue;
mod web_socket;
pub mod protobuf;
2022-02-18 23:04:55 +08:00
pub use manager::*;
2021-12-14 18:04:51 +08:00
pub mod errors {
pub use flowy_error::{internal_error, ErrorCode, FlowyError};
}
2022-01-10 23:45:59 +08:00
2022-02-18 23:04:55 +08:00
pub const DOCUMENT_SYNC_INTERVAL_IN_MILLIS: u64 = 1000;
2022-01-10 23:45:59 +08:00
use crate::errors::FlowyError;
2022-03-10 17:14:10 +08:00
use flowy_collaboration::entities::text_block_info::{
CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo,
};
2022-01-10 23:45:59 +08:00
use lib_infra::future::FutureResult;
2022-02-25 22:27:44 +08:00
pub trait BlockCloudService: Send + Sync {
2022-03-10 17:14:10 +08:00
fn create_block(&self, token: &str, params: CreateTextBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 23:45:59 +08:00
2022-03-10 17:14:10 +08:00
fn read_block(&self, token: &str, params: TextBlockId) -> FutureResult<Option<TextBlockInfo>, FlowyError>;
2022-01-10 23:45:59 +08:00
2022-03-10 17:14:10 +08:00
fn update_block(&self, token: &str, params: ResetTextBlockParams) -> FutureResult<(), FlowyError>;
2022-01-10 23:45:59 +08:00
}