ProcessorRegistry
Defined in: src/lib/processors/registry.ts:16
Registry for managing and finding file processors
Constructors
Constructor
new ProcessorRegistry():
ProcessorRegistry
Returns
ProcessorRegistry
Methods
findProcessor()
findProcessor(
file:FileTypeQuery):FileProcessor|null
Defined in: src/lib/processors/registry.ts:31
Find a processor that can handle the given file
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
File metadata to match |
Returns
FileProcessor | null
The matching processor, or null if none found
getAll()
getAll():
FileProcessor[]
Defined in: src/lib/processors/registry.ts:97
Get all registered processors
Returns
getSupportedExtensions()
getSupportedExtensions():
string[]
Defined in: src/lib/processors/registry.ts:84
Get the union of all file extensions handled by registered processors.
Includes the leading dot (e.g. .md, .pdf) so values can be passed
directly to an <input accept> attribute.
Result is deduplicated and sorted for stable output.
Returns
string[]
getSupportedMimeTypes()
getSupportedMimeTypes():
string[]
Defined in: src/lib/processors/registry.ts:68
Get the union of all MIME types handled by registered processors.
Useful for building an <input type="file" accept="..."> allowlist.
Result is deduplicated and sorted for stable output.
Returns
string[]
isSupported()
isSupported(
file:FileTypeQuery):boolean
Defined in: src/lib/processors/registry.ts:59
Test whether any registered processor can handle the given file.
Convenience wrapper around findProcessor for upload-time validation
where you only care about the boolean answer.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
boolean
register()
register(
processor:FileProcessor):void
Defined in: src/lib/processors/registry.ts:22
Register a processor
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void