@@ -37,18 +37,16 @@ export interface LockOptions<T> {
3737 signal ?: AbortSignal ;
3838}
3939
40- export interface AbstractStreamingSyncImplementationOptions {
40+ export interface AbstractStreamingSyncImplementationOptions extends AdditionalConnectionOptions {
4141 adapter : BucketStorageAdapter ;
4242 uploadCrud : ( ) => Promise < void > ;
43- crudUploadThrottleMs ?: number ;
4443 /**
4544 * An identifier for which PowerSync DB this sync implementation is
4645 * linked to. Most commonly DB name, but not restricted to DB name.
4746 */
4847 identifier ?: string ;
4948 logger ?: ILogger ;
5049 remote : AbstractRemote ;
51- retryDelayMs ?: number ;
5250}
5351
5452export interface StreamingSyncImplementationListener extends BaseListener {
@@ -67,23 +65,21 @@ export interface StreamingSyncImplementationListener extends BaseListener {
6765 * Configurable options to be used when connecting to the PowerSync
6866 * backend instance.
6967 */
70- export interface PowerSyncConnectionOptions extends PowerSyncConnectionOptionalOptions , PowerSyncConnectionRequiredOptions { }
71-
72- export interface PowerSyncConnectionRequiredOptions {
73- /**
68+ export interface PowerSyncConnectionOptions extends AdditionalConnectionOptions {
69+ /**
7470 * The connection method to use when streaming updates from
7571 * the PowerSync backend instance.
7672 * Defaults to a HTTP streaming connection.
7773 */
78- connectionMethod : SyncStreamConnectionMethod ;
74+ connectionMethod : SyncStreamConnectionMethod ;
7975
80- /**
81- * These parameters are passed to the sync rules, and will be available under the`user_parameters` object.
82- */
83- params : Record < string , StreamingSyncRequestParameterType > ;
76+ /**
77+ * These parameters are passed to the sync rules, and will be available under the`user_parameters` object.
78+ */
79+ params : Record < string , StreamingSyncRequestParameterType > ;
8480}
8581
86- export interface PowerSyncConnectionOptionalOptions {
82+ export interface AdditionalConnectionOptions {
8783 /**
8884 * Delay for retrying sync streaming operations
8985 * from the PowerSync backend after an error occurs.
@@ -126,7 +122,7 @@ export const DEFAULT_STREAMING_SYNC_OPTIONS = {
126122 crudUploadThrottleMs : DEFAULT_CRUD_UPLOAD_THROTTLE_MS
127123} ;
128124
129- export const DEFAULT_STREAM_CONNECTION_OPTIONS : PowerSyncConnectionRequiredOptions = {
125+ export const DEFAULT_STREAM_CONNECTION_OPTIONS : PowerSyncConnectionOptions = {
130126 connectionMethod : SyncStreamConnectionMethod . WEB_SOCKET ,
131127 params : { }
132128} ;
@@ -444,7 +440,7 @@ The next upload iteration will be delayed.`);
444440 type : LockType . SYNC ,
445441 signal,
446442 callback : async ( ) => {
447- const resolvedOptions : PowerSyncConnectionRequiredOptions = {
443+ const resolvedOptions : PowerSyncConnectionOptions = {
448444 ...DEFAULT_STREAM_CONNECTION_OPTIONS ,
449445 ...( options ?? { } )
450446 } ;
0 commit comments