Skip to content

Commit 407a1af

Browse files
committed
Export type with possible statuses
1 parent f552bf6 commit 407a1af

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export {
3333
} from './logux-undo-error/index.js'
3434
export { emptyInTest, prepareForTest } from './prepare-for-test/index.js'
3535
export { request, RequestOptions } from './request/index.js'
36-
export { status } from './status/index.js'
36+
export { status, StatusValue } from './status/index.js'
3737
export {
3838
buildNewSyncMap,
3939
changeSyncMap,

status/index.d.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ import type { Action } from '@logux/core'
22

33
import type { Client, ClientMeta } from '../client/index.js'
44

5+
export type StatusValue =
6+
| 'connecting'
7+
| 'connectingAfterWait'
8+
| 'denied'
9+
| 'disconnected'
10+
| 'error'
11+
| 'protocolError'
12+
| 'syncError'
13+
| 'synchronized'
14+
| 'synchronizedAfterWait'
15+
| 'wait'
16+
517
interface StatusListener {
618
(
7-
current:
8-
| 'connecting'
9-
| 'connectingAfterWait'
10-
| 'denied'
11-
| 'disconnected'
12-
| 'error'
13-
| 'protocolError'
14-
| 'syncError'
15-
| 'synchronized'
16-
| 'synchronizedAfterWait'
17-
| 'wait',
19+
current: StatusValue,
1820
details: { action: Action; meta: ClientMeta } | { error: Error } | undefined
1921
): void
2022
}

0 commit comments

Comments
 (0)