mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-19 09:22:12 +00:00
progress
This commit is contained in:
1 parent
41b9116c6a
commit
97d597e139
181 files changed
+1970
-2643
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import type { RouteAttributes, StorageOpened } from 'gpx-rs';
|
||||
import type { RouteAttributes, StorageOpened } from 'gpx-wasm';
|
||||
import type { Backend } from './types';
|
||||
|
||||
/** An array that a command returns as its bytes. */
|
||||
|
||||
@@ -9,13 +9,13 @@ import type {
|
||||
StorageOpened,
|
||||
TrackpointDetails,
|
||||
WaypointDetails,
|
||||
} from 'gpx-rs';
|
||||
} from 'gpx-wasm';
|
||||
import type { MergeType, SelectMode, SplitType } from '../types';
|
||||
|
||||
/**
|
||||
* What the facade needs of the engine of the files, wherever it runs: the WASM module in the
|
||||
* browser (`wasm.ts`), or the Rust process of the desktop app, through its commands (`tauri.ts`).
|
||||
* Both give the same results: see `gpx-rs/wasm` for what each function does.
|
||||
* Both give the same results: see `gpx-rs/src/api` for what each function does.
|
||||
*
|
||||
* Everything is asynchronous, because the desktop app is reached through messages. Ids are
|
||||
* hyphenated UUID strings, the arrays of numbers are typed arrays, and what the functions that
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Backend } from './types';
|
||||
import type { MergeType, SelectMode, SplitType } from '../types';
|
||||
|
||||
type Wasm = typeof import('gpx-rs');
|
||||
type Wasm = typeof import('gpx-wasm');
|
||||
|
||||
/** A call of the module, which is synchronous, as an asynchronous one. */
|
||||
const lift =
|
||||
@@ -21,9 +21,9 @@ function idsToBytes(ids: string[]): Uint8Array {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/** The engine in the page, as the WebAssembly module of `gpx-rs`. */
|
||||
/** The engine in the page, as the WebAssembly module of `wasm`. */
|
||||
export async function createWasmBackend(): Promise<Backend> {
|
||||
const w: Wasm = await import('gpx-rs');
|
||||
const w: Wasm = await import('gpx-wasm');
|
||||
w.start();
|
||||
|
||||
const mode = (m: SelectMode) =>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// The frontend side of the engine, against the real engine (the WASM module of `gpx-rs`, which has
|
||||
// to be built: `wasm-pack build wasm --target bundler --out-dir ../pkg` in `gpx-rs`).
|
||||
// The frontend side of the engine, against the real engine (the WASM module of `wasm`, which has
|
||||
// to be built: `wasm-pack build --target bundler` in `wasm`).
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { beforeEach, describe, it } from 'node:test';
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
|
||||
function fixture(name: string): Uint8Array {
|
||||
return new Uint8Array(
|
||||
readFileSync(new URL(`../../../../gpx-rs/engine/data/${name}.gpx`, import.meta.url))
|
||||
readFileSync(new URL(`../../../../gpx-rs/data/${name}.gpx`, import.meta.url))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '$lib/engine/file-visibility';
|
||||
import { categoryIntervals } from '$lib/engine/trackpoint-categories';
|
||||
import { selectedElementIds, type FileTreeNode } from '$lib/engine/selection-helpers';
|
||||
import type { RouteAttributes } from 'gpx-rs';
|
||||
import type { RouteAttributes } from 'gpx-wasm';
|
||||
import { loadBackend, type Backend } from './backend';
|
||||
import { readFileState } from './file-state';
|
||||
import { StatisticsReader } from './statistics';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import type { FileStructure } from 'gpx-rs';
|
||||
import type { FileStructure } from 'gpx-wasm';
|
||||
import {
|
||||
isHidden,
|
||||
isSegmentHidden,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FileStructure } from 'gpx-rs';
|
||||
import type { FileStructure } from 'gpx-wasm';
|
||||
|
||||
/**
|
||||
* Visibility the user set explicitly, by element id (file, track, segment, waypoint, or the
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import type { Clipboard, FileStructure, Selection } from 'gpx-rs';
|
||||
import type { Clipboard, FileStructure, Selection } from 'gpx-wasm';
|
||||
import type { VisibilityState } from '$lib/engine/file-visibility';
|
||||
import {
|
||||
elementId,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Clipboard, Selection } from 'gpx-rs';
|
||||
import type { Clipboard, Selection } from 'gpx-wasm';
|
||||
import { isHidden, waypointsKey, type VisibilityState } from '$lib/engine/file-visibility';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LEGACY_IMPORTED_KEY, readLegacyData } from '$lib/storage/legacy-import';
|
||||
import { parseVisibility, VISIBILITY_KEY, type Visibility } from '$lib/engine/file-visibility';
|
||||
import type { Outcome, StorageOpened } from 'gpx-rs';
|
||||
import type { Outcome, StorageOpened } from 'gpx-wasm';
|
||||
import type { Backend } from './backend';
|
||||
|
||||
/** Name of the IndexedDB database that keeps the files and the settings. */
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Readable } from 'svelte/store';
|
||||
import type { Feature, FeatureCollection, LineString, Point } from 'geojson';
|
||||
import type { Visibility } from '$lib/engine/file-visibility';
|
||||
import type { CategoryIntervals } from '$lib/engine/trackpoint-categories';
|
||||
import type { FileStructure, GlobalStatistics } from 'gpx-rs';
|
||||
import type { FileStructure, GlobalStatistics } from 'gpx-wasm';
|
||||
|
||||
export type {
|
||||
Clipboard,
|
||||
@@ -17,7 +17,7 @@ export type {
|
||||
TrackNode,
|
||||
SegmentNode,
|
||||
WaypointNode,
|
||||
} from 'gpx-rs';
|
||||
} from 'gpx-wasm';
|
||||
|
||||
/**
|
||||
* How a merge puts the selected elements together: `connect` makes a single segment of their
|
||||
|
||||
Reference in new issue
Block a user