1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Parser for Apple **Freeform** pasteboard data.
//!
//! A single copy contains several parallel flavors: `PencilKit` ink, the native
//! object graph, routing metadata, assets, state flags, text selections, and
//! rendered fallbacks. [`decode_pasteboard`] preserves every supplied flavor,
//! decodes each tier independently, and reports failures without discarding
//! tiers that remain usable.
//!
//! The private CRL formats are reverse-engineered and OS-version fragile.
//! Unsupported records retain their original bytes; truncated, corrupt, and
//! hostile inputs return structured errors instead of fabricated values.
//!
//! # Example
//!
//! ```no_run
//! use libfreeform::{FreeformBlobs, FreeformFlavor, FreeformTier, decode_pasteboard};
//!
//! let flavors = [
//! ("com.apple.drawing", "com_apple_drawing"),
//! ("com.apple.freeform.CRLNativeData", "com_apple_freeform_CRLNativeData"),
//! ("com.apple.freeform.TSUDescription", "com_apple_freeform_TSUDescription"),
//! ]
//! .into_iter()
//! .filter_map(|(uti, path)| {
//! std::fs::read(path)
//! .ok()
//! .map(|bytes| FreeformFlavor { uti: uti.into(), bytes })
//! })
//! .collect();
//! let decoded = decode_pasteboard(FreeformBlobs { change_count: None, flavors });
//! if let FreeformTier::Decoded(drawing) = decoded.drawing {
//! for stroke in drawing.strokes {
//! println!("{} stroke, {} controls", stroke.ink_type, stroke.points.len());
//! }
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use *;
// The npm package builds this exact crate with `--features wasm` for
// `wasm32-unknown-unknown`. Native users never compile the binding layer.