Skip to content

Commit 6e874c1

Browse files
committed
add comments and make AttachmentTable options optional
1 parent 025088a commit 6e874c1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/powersync-attachments/src/AbstractAttachmentQueue.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ import {
1313
export interface AttachmentQueueOptions {
1414
powersync: AbstractPowerSyncDatabase;
1515
storage: StorageAdapter;
16+
/**
17+
* How often to check for new attachments to sync, in milliseconds. Set to 0 or undefined to disable.
18+
*/
1619
syncInterval?: number;
20+
/**
21+
* How many attachments to keep in the cache
22+
*/
1723
cacheLimit?: number;
1824
attachmentDirectoryName?: string;
25+
/**
26+
* Whether to mark the initial watched attachment IDs to be synced
27+
*/
1928
performInitialSync?: boolean;
2029
}
2130

packages/powersync-attachments/src/definitions/Schema.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ export enum AttachmentState {
2525
ARCHIVED = 4, // Attachment has been orphaned, i.e. the associated record has been deleted
2626
}
2727

28-
export interface AttachmentTableOptions extends Omit<TableOptions, "name"> {
28+
export interface AttachmentTableOptions
29+
extends Omit<TableOptions, "name" | "columns"> {
2930
name?: string;
3031
additionalColumns?: Column[];
3132
}
3233

3334
export class AttachmentTable extends Table {
34-
constructor(options: AttachmentTableOptions) {
35+
constructor(options?: AttachmentTableOptions) {
3536
super({
3637
...options,
3738
name: options.name ?? ATTACHMENT_TABLE,

0 commit comments

Comments
 (0)