Skip to content

Commit e8db607

Browse files
jay-coxclaude
andcommitted
fix: add explicit OnDisconnect return type to avoid internal import in declaration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 61f2ba3 commit e8db607

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

dist/document.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { DatabaseReference, DataSnapshot, Unsubscribe } from 'firebase/database';
1+
import type { DatabaseReference, DataSnapshot, OnDisconnect, Unsubscribe } from 'firebase/database';
22
import { RTDatabase } from './database';
33
export declare class Document {
44
_ref: DatabaseReference;
@@ -45,6 +45,6 @@ export declare class Document {
4545
* @returns Promise
4646
*/
4747
remove: () => Promise<void>;
48-
onDisconnect: () => import("@firebase/database").OnDisconnect;
48+
onDisconnect: () => OnDisconnect;
4949
close: () => void;
5050
}

dist/index.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FirebaseOptions } from 'firebase/app';
2-
import { DatabaseReference, Unsubscribe, DataSnapshot, Database } from 'firebase/database';
2+
import { DatabaseReference, Unsubscribe, DataSnapshot, OnDisconnect, Database } from 'firebase/database';
33
import { Auth, Persistence, UserCredential } from 'firebase/auth';
4-
import * as _firebase_database from '@firebase/database';
54
import React, { FunctionComponent, ComponentClass } from 'react';
65

76
declare class Document {
@@ -49,7 +48,7 @@ declare class Document {
4948
* @returns Promise
5049
*/
5150
remove: () => Promise<void>;
52-
onDisconnect: () => _firebase_database.OnDisconnect;
51+
onDisconnect: () => OnDisconnect;
5352
close: () => void;
5453
}
5554

src/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
push,
88
onDisconnect,
99
} from 'firebase/database';
10-
import type { DatabaseReference, DataSnapshot, Unsubscribe } from 'firebase/database';
10+
import type { DatabaseReference, DataSnapshot, OnDisconnect, Unsubscribe } from 'firebase/database';
1111
import { NOT_SET } from './constants';
1212
import { state } from './state';
1313
import { RTDatabase } from './database';
@@ -129,7 +129,7 @@ export class Document {
129129
return remove(this._ref);
130130
};
131131

132-
onDisconnect = () => {
132+
onDisconnect = (): OnDisconnect => {
133133
return onDisconnect(this._ref);
134134
};
135135

0 commit comments

Comments
 (0)