Fix platform-gated imports for Windows and wasm builds

This commit is contained in:
Dylan M. Taylor
2026-10-28 00:14:57 +00:00
parent 76ce895478
commit ef894ae6b8
6 changed files with 21 additions and 8 deletions
+3
View File
@@ -1,6 +1,9 @@
use super::error::{Result, ToolError, failed};
use super::json::{Args, document_attachment_keys, info, one_based, parse_style_ranges, security, summary};
use super::paths::{read_input, write_atomic};
// The digital-ID listing tools are macOS (Keychain) and Windows (certificate store) only.
#[cfg(any(target_os = "macos", target_os = "windows"))]
use super::signing;
use super::{Arc, Automation, Edit, Value, block_overlapping, comments, json, tools};
/// One piece of a tool's result.
+4 -2
View File
@@ -1,8 +1,10 @@
#[cfg(not(target_arch = "wasm32"))]
use super::CLOCK_EVERY;
use super::ast::{Expr, Idx};
use super::value::{Val, num_text, parse_num};
use super::{
CLOCK_EVERY, HNode, HashSet, Interp, LIST_TOO_LONG, MAX_LIST, MAX_PARSE_DEPTH, MAX_STEPS, R, RAN_TOO_LONG, child_named, descendants_named,
instances, resolve_som,
HNode, HashSet, Interp, LIST_TOO_LONG, MAX_LIST, MAX_PARSE_DEPTH, MAX_STEPS, R, RAN_TOO_LONG, child_named, descendants_named, instances,
resolve_som,
};
impl Interp<'_> {
+5 -3
View File
@@ -1,8 +1,10 @@
use super::{
Arc, AssertUnwindSafe, AtomicBool, AtomicRenderStats, InterpreterSettings, JoinHandle, Mutex, Ordering, PageRenderer, Pdf, Pixels, Receiver,
RenderCache, RenderConfig, RenderRequest, RenderStats, RenderedPage, RequestFailureKey, RequestKind, ResultReceiver, Stopwatch, SyncSender,
WorkQueue, catch_unwind, finish, panic_message, parse, render_page, sync_channel, take_warnings, warning_settings,
Arc, AssertUnwindSafe, AtomicRenderStats, InterpreterSettings, JoinHandle, Mutex, Ordering, PageRenderer, Pdf, Pixels, RenderCache, RenderConfig,
RenderRequest, RenderStats, RenderedPage, RequestFailureKey, RequestKind, ResultReceiver, Stopwatch, SyncSender, WorkQueue, catch_unwind, finish,
panic_message, parse, render_page, take_warnings, warning_settings,
};
#[cfg(not(target_arch = "wasm32"))]
use super::{AtomicBool, Receiver, sync_channel};
/// How long one page may render before the pool gives up on it (the watchdog).
pub const STUCK_AFTER: std::time::Duration = std::time::Duration::from_secs(20);
+3 -1
View File
@@ -1,4 +1,6 @@
use super::{GridDrop, GridFile, OpenRequest, PdfCraftApp, open_worker};
use super::{GridDrop, GridFile, PdfCraftApp};
#[cfg(not(target_arch = "wasm32"))]
use super::{OpenRequest, open_worker};
/// Read a file dropped on a page grid (see [`GridFile`]).
fn read_grid_file((name, source): GridFile) -> Result<(String, Vec<u8>), (String, String)> {
@@ -1,4 +1,6 @@
use super::{BTreeSet, MAX_FOLDER_DEPTH, MAX_FOLDER_FILES, Ordering, SystemTime};
use super::{BTreeSet, Ordering, SystemTime};
#[cfg(not(target_arch = "wasm32"))]
use super::{MAX_FOLDER_DEPTH, MAX_FOLDER_FILES};
/// The PDFs, images and text files in `dir` (and, if `recursive`, the folders inside it, not
/// following links), in natural order, at most [`MAX_FOLDER_FILES`]; and whether there were more.
@@ -1,8 +1,10 @@
#[cfg(not(target_arch = "wasm32"))]
use super::MAX_FOLDER_FILES;
use super::files::{AssessError, Assessed, CombineFile, Incoming, Secret, Snapshot, SortKey, UnlockPrompt, assess};
#[cfg(not(target_arch = "wasm32"))]
use super::parts::combinable_in;
use super::parts::{Part, items_of, moved_order, natural, parts_of, range_of, title_of};
use super::{Arc, BTreeSet, CombineTab, HISTORY, MAX_FOLDER_FILES, Modifiers, PdfCraftApp};
use super::{Arc, BTreeSet, CombineTab, HISTORY, Modifiers, PdfCraftApp};
impl PdfCraftApp {
/// Show the Combine files tab (File ▸ Combine files…), opening it if needed.