@arolariu/website / types / CachedScan
Interface: CachedScan
Defined in: types/scans/Scan.ts:215
Cached version of Scan with local-only fields for IndexedDB persistence.
Remarks
Extends the base Scan type with fields that are only relevant for local caching and hydration. These fields are not stored in Azure.
Cache Strategy:
- Scans are cached in IndexedDB for fast initial page load
- Background sync fetches fresh data from Azure
cachedAttracks cache freshness for stale-while-revalidate pattern
Example
const cachedScan: CachedScan = {
...scan,
cachedAt: new Date(),
};
Extends
Properties
id
readonlyid:string
Defined in: types/scans/Scan.ts:141
Unique identifier for the scan (UUIDv7). Assigned at upload time and immutable.
Inherited from
userIdentifier
readonlyuserIdentifier:string
Defined in: types/scans/Scan.ts:147
The user identifier of the scan owner. Stored in Azure Blob metadata for filtering by user.
Inherited from
name
name:
string
Defined in: types/scans/Scan.ts:153
Human-readable name for the scan. Defaults to original filename, can be edited by user.
Inherited from
blobUrl
readonlyblobUrl:string
Defined in: types/scans/Scan.ts:159
Full URL to the scan in Azure Blob Storage. Format: https://cdn.arolariu.ro/scans/{userIdentifier}/{scanId}_{timestamp}.{ext}
Inherited from
mimeType
readonlymimeType:string
Defined in: types/scans/Scan.ts:165
MIME type of the uploaded file. Examples: "image/jpeg", "image/png", "application/pdf"
Inherited from
sizeInBytes
readonlysizeInBytes:number
Defined in: types/scans/Scan.ts:170
File size in bytes.
Inherited from
scanType
readonlyscanType:ScanType
Defined in: types/scans/Scan.ts:176
Document format classification. Derived from mimeType during upload.
Inherited from
uploadedAt
readonlyuploadedAt:Date
Defined in: types/scans/Scan.ts:181
Timestamp when the scan was uploaded.
Inherited from
status
status:
ScanStatus
Defined in: types/scans/Scan.ts:186
Current lifecycle status of the scan.
Inherited from
metadata
metadata:
Record<string,string>
Defined in: types/scans/Scan.ts:192
Additional metadata stored with the blob. Can include OCR hints, original dimensions, etc.
Inherited from
cachedAt
cachedAt:
Date
Defined in: types/scans/Scan.ts:220
Timestamp when this scan was cached in IndexedDB. Used to determine cache freshness.