@foxglove/rosbag2-web
Advanced tools
Comparing version 0.2.0 to 0.2.1
/// <reference types="wicg-entries-api" /> | ||
/// <reference types="wicg-file-system-access" /> | ||
import { Rosbag2 } from "@foxglove/rosbag2"; | ||
export declare function openFileSystemDirectoryEntry(folder: FileSystemDirectoryEntry, locateSqlJsWasm?: (file: string) => string): Promise<Rosbag2>; | ||
export declare function openFileSystemDirectoryHandle(folder: FileSystemDirectoryHandle, locateSqlJsWasm?: (file: string) => string): Promise<Rosbag2>; | ||
import { LocateWasmUrl } from "./SqliteSqljs"; | ||
export declare function openFileSystemDirectoryEntry(folder: FileSystemDirectoryEntry, sqlJsWasm?: LocateWasmUrl | ArrayBuffer): Promise<Rosbag2>; | ||
export declare function openFileSystemDirectoryHandle(folder: FileSystemDirectoryHandle, sqlJsWasm?: LocateWasmUrl | ArrayBuffer): Promise<Rosbag2>; | ||
//# sourceMappingURL=open.d.ts.map |
@@ -7,3 +7,3 @@ "use strict"; | ||
const SqliteSqljs_1 = require("./SqliteSqljs"); | ||
async function openFileSystemDirectoryEntry(folder, locateSqlJsWasm) { | ||
async function openFileSystemDirectoryEntry(folder, sqlJsWasm) { | ||
const files = await listFilesInDirectoryEntry(folder); | ||
@@ -14,3 +14,3 @@ const entries = files.map((file) => ({ | ||
})); | ||
const bag = new rosbag2_1.Rosbag2(folder.fullPath, entries, (fileEntry) => new SqliteSqljs_1.SqliteSqljs(fileEntry.file, locateSqlJsWasm)); | ||
const bag = new rosbag2_1.Rosbag2(folder.fullPath, entries, (fileEntry) => new SqliteSqljs_1.SqliteSqljs(fileEntry.file, sqlJsWasm)); | ||
await bag.open(); | ||
@@ -20,3 +20,3 @@ return bag; | ||
exports.openFileSystemDirectoryEntry = openFileSystemDirectoryEntry; | ||
async function openFileSystemDirectoryHandle(folder, locateSqlJsWasm) { | ||
async function openFileSystemDirectoryHandle(folder, sqlJsWasm) { | ||
const files = await listFilesInDirectoryHandle(folder); | ||
@@ -27,3 +27,3 @@ const entries = files.map((file) => ({ | ||
})); | ||
const bag = new rosbag2_1.Rosbag2(folder.name, entries, (fileEntry) => new SqliteSqljs_1.SqliteSqljs(fileEntry.file, locateSqlJsWasm)); | ||
const bag = new rosbag2_1.Rosbag2(folder.name, entries, (fileEntry) => new SqliteSqljs_1.SqliteSqljs(fileEntry.file, sqlJsWasm)); | ||
await bag.open(); | ||
@@ -30,0 +30,0 @@ return bag; |
import { Filelike, MessageReadOptions, RawMessage, SqliteDb, TopicDefinition } from "@foxglove/rosbag2"; | ||
import { Time } from "@foxglove/rostime"; | ||
declare type LocateWasmUrl = (url: string, scriptDirectory: string) => string; | ||
export declare type LocateWasmUrl = (url: string, scriptDirectory: string) => string; | ||
export declare class SqliteSqljs implements SqliteDb { | ||
@@ -16,3 +16,2 @@ readonly file: Readonly<Filelike>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=SqliteSqljs.d.ts.map |
{ | ||
"name": "@foxglove/rosbag2-web", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "ROS2 (Robot Operating System) bag reader and writer for the browser", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { Rosbag2 } from "@foxglove/rosbag2"; | ||
import { BlobReader } from "./BlobReader"; | ||
import { SqliteSqljs } from "./SqliteSqljs"; | ||
import { LocateWasmUrl, SqliteSqljs } from "./SqliteSqljs"; | ||
export async function openFileSystemDirectoryEntry( | ||
folder: FileSystemDirectoryEntry, | ||
locateSqlJsWasm?: (file: string) => string, | ||
sqlJsWasm?: LocateWasmUrl | ArrayBuffer, | ||
): Promise<Rosbag2> { | ||
@@ -18,3 +18,3 @@ const files = await listFilesInDirectoryEntry(folder); | ||
entries, | ||
(fileEntry) => new SqliteSqljs(fileEntry.file, locateSqlJsWasm), | ||
(fileEntry) => new SqliteSqljs(fileEntry.file, sqlJsWasm), | ||
); | ||
@@ -27,3 +27,3 @@ await bag.open(); | ||
folder: FileSystemDirectoryHandle, | ||
locateSqlJsWasm?: (file: string) => string, | ||
sqlJsWasm?: LocateWasmUrl | ArrayBuffer, | ||
): Promise<Rosbag2> { | ||
@@ -38,3 +38,3 @@ const files = await listFilesInDirectoryHandle(folder); | ||
entries, | ||
(fileEntry) => new SqliteSqljs(fileEntry.file, locateSqlJsWasm), | ||
(fileEntry) => new SqliteSqljs(fileEntry.file, sqlJsWasm), | ||
); | ||
@@ -41,0 +41,0 @@ await bag.open(); |
@@ -14,2 +14,4 @@ import { | ||
export type LocateWasmUrl = (url: string, scriptDirectory: string) => string; | ||
type DbContext = { | ||
@@ -31,4 +33,2 @@ db: Database; | ||
type LocateWasmUrl = (url: string, scriptDirectory: string) => string; | ||
export class SqliteSqljs implements SqliteDb { | ||
@@ -35,0 +35,0 @@ readonly file: Readonly<Filelike>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
69733