feat: update import statements to use TypeScript file extensions

This commit is contained in:
David Snelling 2025-05-29 08:27:59 -07:00
parent 61d86c98a7
commit 7d2b695ea0
10 changed files with 35 additions and 35 deletions

View file

@ -1,4 +1,4 @@
import { Edge, HNSWNode, StorageAdapter } from '../coreTypes.js'
import { Edge, HNSWNode, StorageAdapter } from '../coreTypes.ts'
// We'll dynamically import Node.js built-in modules
let fs: any

View file

@ -3,7 +3,7 @@
* Provides persistent storage for the vector database using the Origin Private File System API
*/
import { Edge, HNSWNode, StorageAdapter } from '../coreTypes.js'
import { Edge, HNSWNode, StorageAdapter } from '../coreTypes.ts'
// Directory and file names
const ROOT_DIR = 'opfs-vector-db'
@ -902,7 +902,7 @@ export async function createStorage(options: {
if (isNode) {
// In Node.js, use FileSystemStorage first, then fall back to memory
try {
const fileSystemModule = await import('./fileSystemStorage.js')
const fileSystemModule = await import('./fileSystemStorage.ts')
return new fileSystemModule.FileSystemStorage()
} catch (error) {
console.warn('Failed to load FileSystemStorage, falling back to in-memory storage:', error)
@ -928,7 +928,7 @@ export async function createStorage(options: {
try {
// Try to load FileSystemStorage for browser environments
// Note: This will likely fail as FileSystemStorage is designed for Node.js
const fileSystemModule = await import('./fileSystemStorage.js')
const fileSystemModule = await import('./fileSystemStorage.ts')
return new fileSystemModule.FileSystemStorage()
} catch (error) {
console.warn('FileSystem storage is not available, falling back to in-memory storage')