mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
feat: init renderer server (#8088)
This commit is contained in:
@@ -7,14 +7,15 @@ version = "1.0.0"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
chrono = { workspace = true }
|
||||
file-format = { workspace = true }
|
||||
napi = { workspace = true }
|
||||
napi-derive = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
sha3 = { workspace = true }
|
||||
tiktoken-rs = { workspace = true }
|
||||
y-octo = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
file-format = { workspace = true }
|
||||
napi = { workspace = true }
|
||||
napi-derive = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
sha3 = { workspace = true }
|
||||
tiktoken-rs = { workspace = true }
|
||||
v_htmlescape = { workspace = true }
|
||||
y-octo = { workspace = true }
|
||||
|
||||
[target.'cfg(not(target_os = "linux"))'.dependencies]
|
||||
mimalloc = { workspace = true }
|
||||
|
||||
2
packages/backend/native/index.d.ts
vendored
2
packages/backend/native/index.d.ts
vendored
@@ -8,6 +8,8 @@ export declare function fromModelName(modelName: string): Tokenizer | null
|
||||
|
||||
export declare function getMime(input: Uint8Array): string
|
||||
|
||||
export declare function htmlSanitize(input: string): string
|
||||
|
||||
/**
|
||||
* Merge updates in form like `Y.applyUpdate(doc, update)` way and return the
|
||||
* result binary.
|
||||
|
||||
@@ -11,3 +11,4 @@ export const mintChallengeResponse = binding.mintChallengeResponse;
|
||||
export const getMime = binding.getMime;
|
||||
export const Tokenizer = binding.Tokenizer;
|
||||
export const fromModelName = binding.fromModelName;
|
||||
export const htmlSanitize = binding.htmlSanitize;
|
||||
|
||||
4
packages/backend/native/src/html_sanitize.rs
Normal file
4
packages/backend/native/src/html_sanitize.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
#[napi]
|
||||
pub fn html_sanitize(input: String) -> String {
|
||||
v_htmlescape::escape(&input).to_string()
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
pub mod file_type;
|
||||
pub mod hashcash;
|
||||
pub mod html_sanitize;
|
||||
pub mod tiktoken;
|
||||
|
||||
use std::fmt::{Debug, Display};
|
||||
|
||||
Reference in New Issue
Block a user