@usebridge/sdk-react 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/dist/index.cjs +0 -2201
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -172
- package/dist/index.d.ts +0 -172
- package/dist/index.js +0 -2175
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
3
|
-
import * as _usebridge_sdk_core from '@usebridge/sdk-core';
|
|
4
|
-
import { BridgeSdkConfig, BridgeSdk, Payer, PayerSearchResults, SoftEligibilitySession, SoftEligibilitySessionState, HardEligibilitySession, HardEligibilitySessionState, UsStateCode } from '@usebridge/sdk-core';
|
|
5
|
-
import { StoreApi } from 'zustand';
|
|
6
|
-
|
|
7
|
-
interface BridgeSdkProviderProps extends PropsWithChildren {
|
|
8
|
-
/**
|
|
9
|
-
* Config for the BridgeSdk
|
|
10
|
-
*/
|
|
11
|
-
config: BridgeSdkConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to prefetch payers, defaults to true
|
|
14
|
-
*/
|
|
15
|
-
prefetchPayers?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Creates and provides a BridgeSdk to the hooks nested within
|
|
19
|
-
* Initializes with the first 'config' passed through to it
|
|
20
|
-
*/
|
|
21
|
-
declare const BridgeSdkProvider: FC<BridgeSdkProviderProps>;
|
|
22
|
-
/**
|
|
23
|
-
* Hook to access the BridgeSdk instance from the context
|
|
24
|
-
*/
|
|
25
|
-
declare function useBridgeSdk(): BridgeSdk;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Providers autocomplete functionality for the Payer search
|
|
29
|
-
* @param query the query to search for, may be an empty string
|
|
30
|
-
* @param limit the maximum number of results to return, defaults to 10
|
|
31
|
-
*/
|
|
32
|
-
declare function usePayerAutocomplete(query: string, { limit, }: {
|
|
33
|
-
/**
|
|
34
|
-
* The maximum number of results to return, defaults to 10
|
|
35
|
-
*/
|
|
36
|
-
limit?: number;
|
|
37
|
-
}): {
|
|
38
|
-
/**
|
|
39
|
-
* Whether the autocomplete is currently loading
|
|
40
|
-
*/
|
|
41
|
-
isLoading: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The results to display currently
|
|
44
|
-
*/
|
|
45
|
-
results: Payer[];
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Hook that returns a function to search for Payers
|
|
50
|
-
*/
|
|
51
|
-
declare function usePayerSearch(): (args_0: {
|
|
52
|
-
query: string;
|
|
53
|
-
limit?: number;
|
|
54
|
-
}) => Promise<PayerSearchResults>;
|
|
55
|
-
|
|
56
|
-
interface SoftEligibilityProviderProps extends PropsWithChildren {
|
|
57
|
-
session: SoftEligibilitySession;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Provides the context for SoftEligibility hooks
|
|
61
|
-
*/
|
|
62
|
-
declare const SoftEligibilityProvider: FC<SoftEligibilityProviderProps>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Hook returning a function that creates a new SoftEligibilitySession
|
|
66
|
-
*/
|
|
67
|
-
declare function useCreateSoftEligibilitySession(): (config: _usebridge_sdk_core.SoftEligibilitySessionConfig) => _usebridge_sdk_core.SoftEligibilitySession;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Resolves to the SoftEligibilitySessionState
|
|
71
|
-
* Re-renders on state change
|
|
72
|
-
*/
|
|
73
|
-
declare function useSoftEligibilityState(): SoftEligibilitySessionState;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Returns a function to submit requests into the Soft Eligibility Session
|
|
77
|
-
* Parses the arguments required for the submission from the EligibilityInput
|
|
78
|
-
*/
|
|
79
|
-
declare function useSoftEligibilitySubmit(): {
|
|
80
|
-
isDisabled: boolean;
|
|
81
|
-
submit: () => Promise<SoftEligibilitySessionState>;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Hook returning a function that creates a new HardEligibilitySession
|
|
86
|
-
*/
|
|
87
|
-
declare function useCreateHardEligibilitySession(): (config: _usebridge_sdk_core.HardEligibilitySessionConfig) => _usebridge_sdk_core.HardEligibilitySession;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Context for the HardEligibilitySession
|
|
91
|
-
*/
|
|
92
|
-
declare const HardEligibilityContext: react.Context<HardEligibilitySession | null>;
|
|
93
|
-
|
|
94
|
-
interface HardEligibilityProviderProps extends PropsWithChildren {
|
|
95
|
-
session: HardEligibilitySession;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Provides the context for HardEligibility hooks
|
|
99
|
-
*/
|
|
100
|
-
declare const HardEligibilityProvider: FC<HardEligibilityProviderProps>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Resolves to the SoftEligibilitySessionState
|
|
104
|
-
* Re-renders on state change
|
|
105
|
-
*/
|
|
106
|
-
declare function useHardEligibilityState(): HardEligibilitySessionState;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Returns a function to submit requests into the Hard Eligibility Session
|
|
110
|
-
* Parses the arguments required for the submission from the EligibilityInput
|
|
111
|
-
*/
|
|
112
|
-
declare function useHardEligibilitySubmit(): {
|
|
113
|
-
isDisabled: boolean;
|
|
114
|
-
submit: () => Promise<HardEligibilitySessionState>;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* State within the EligibilityInputStore
|
|
119
|
-
*/
|
|
120
|
-
interface EligibilityInputState {
|
|
121
|
-
requirePatient: boolean;
|
|
122
|
-
payer: {
|
|
123
|
-
value: Payer | null;
|
|
124
|
-
set: (payer: Payer | null) => void;
|
|
125
|
-
};
|
|
126
|
-
state: {
|
|
127
|
-
value: UsStateCode | null;
|
|
128
|
-
set: (state: UsStateCode | null) => void;
|
|
129
|
-
};
|
|
130
|
-
firstName: {
|
|
131
|
-
value: string;
|
|
132
|
-
set: (firstName: string) => void;
|
|
133
|
-
};
|
|
134
|
-
lastName: {
|
|
135
|
-
value: string;
|
|
136
|
-
set: (lastName: string) => void;
|
|
137
|
-
};
|
|
138
|
-
dateOfBirth: {
|
|
139
|
-
value: Date | null;
|
|
140
|
-
set: (dateOfBirth: Date | null) => void;
|
|
141
|
-
};
|
|
142
|
-
memberId: {
|
|
143
|
-
value: string;
|
|
144
|
-
set: (memberId: string) => void;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Context holding the EligibilityInputStore
|
|
150
|
-
*/
|
|
151
|
-
declare const EligibilityInputContext: react.Context<StoreApi<EligibilityInputState> | null>;
|
|
152
|
-
|
|
153
|
-
type Field = "firstName" | "lastName" | "dateOfBirth" | "memberId" | "payer" | "state";
|
|
154
|
-
type FieldState<F extends Field, T = EligibilityInputState[F]["value"]> = {
|
|
155
|
-
value: T;
|
|
156
|
-
setValue: (value: T) => void;
|
|
157
|
-
isVisible: boolean;
|
|
158
|
-
isValid: boolean;
|
|
159
|
-
isRequired: boolean;
|
|
160
|
-
isDisabled: boolean;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Manages the input state for each field
|
|
164
|
-
*/
|
|
165
|
-
declare function useEligibilityInputField<F extends Field, T = EligibilityInputState[F]["value"]>(field: F): FieldState<F, T>;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Aggregated determination of whether all inputs are valid
|
|
169
|
-
*/
|
|
170
|
-
declare function useEligibilityInputIsValid(): boolean;
|
|
171
|
-
|
|
172
|
-
export { BridgeSdkProvider, EligibilityInputContext, HardEligibilityContext, HardEligibilityProvider, SoftEligibilityProvider, useBridgeSdk, useCreateHardEligibilitySession, useCreateSoftEligibilitySession, useEligibilityInputField, useEligibilityInputIsValid, useHardEligibilityState, useHardEligibilitySubmit, usePayerAutocomplete, usePayerSearch, useSoftEligibilityState, useSoftEligibilitySubmit };
|
package/dist/index.d.ts
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
3
|
-
import * as _usebridge_sdk_core from '@usebridge/sdk-core';
|
|
4
|
-
import { BridgeSdkConfig, BridgeSdk, Payer, PayerSearchResults, SoftEligibilitySession, SoftEligibilitySessionState, HardEligibilitySession, HardEligibilitySessionState, UsStateCode } from '@usebridge/sdk-core';
|
|
5
|
-
import { StoreApi } from 'zustand';
|
|
6
|
-
|
|
7
|
-
interface BridgeSdkProviderProps extends PropsWithChildren {
|
|
8
|
-
/**
|
|
9
|
-
* Config for the BridgeSdk
|
|
10
|
-
*/
|
|
11
|
-
config: BridgeSdkConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to prefetch payers, defaults to true
|
|
14
|
-
*/
|
|
15
|
-
prefetchPayers?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Creates and provides a BridgeSdk to the hooks nested within
|
|
19
|
-
* Initializes with the first 'config' passed through to it
|
|
20
|
-
*/
|
|
21
|
-
declare const BridgeSdkProvider: FC<BridgeSdkProviderProps>;
|
|
22
|
-
/**
|
|
23
|
-
* Hook to access the BridgeSdk instance from the context
|
|
24
|
-
*/
|
|
25
|
-
declare function useBridgeSdk(): BridgeSdk;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Providers autocomplete functionality for the Payer search
|
|
29
|
-
* @param query the query to search for, may be an empty string
|
|
30
|
-
* @param limit the maximum number of results to return, defaults to 10
|
|
31
|
-
*/
|
|
32
|
-
declare function usePayerAutocomplete(query: string, { limit, }: {
|
|
33
|
-
/**
|
|
34
|
-
* The maximum number of results to return, defaults to 10
|
|
35
|
-
*/
|
|
36
|
-
limit?: number;
|
|
37
|
-
}): {
|
|
38
|
-
/**
|
|
39
|
-
* Whether the autocomplete is currently loading
|
|
40
|
-
*/
|
|
41
|
-
isLoading: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The results to display currently
|
|
44
|
-
*/
|
|
45
|
-
results: Payer[];
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Hook that returns a function to search for Payers
|
|
50
|
-
*/
|
|
51
|
-
declare function usePayerSearch(): (args_0: {
|
|
52
|
-
query: string;
|
|
53
|
-
limit?: number;
|
|
54
|
-
}) => Promise<PayerSearchResults>;
|
|
55
|
-
|
|
56
|
-
interface SoftEligibilityProviderProps extends PropsWithChildren {
|
|
57
|
-
session: SoftEligibilitySession;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Provides the context for SoftEligibility hooks
|
|
61
|
-
*/
|
|
62
|
-
declare const SoftEligibilityProvider: FC<SoftEligibilityProviderProps>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Hook returning a function that creates a new SoftEligibilitySession
|
|
66
|
-
*/
|
|
67
|
-
declare function useCreateSoftEligibilitySession(): (config: _usebridge_sdk_core.SoftEligibilitySessionConfig) => _usebridge_sdk_core.SoftEligibilitySession;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Resolves to the SoftEligibilitySessionState
|
|
71
|
-
* Re-renders on state change
|
|
72
|
-
*/
|
|
73
|
-
declare function useSoftEligibilityState(): SoftEligibilitySessionState;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Returns a function to submit requests into the Soft Eligibility Session
|
|
77
|
-
* Parses the arguments required for the submission from the EligibilityInput
|
|
78
|
-
*/
|
|
79
|
-
declare function useSoftEligibilitySubmit(): {
|
|
80
|
-
isDisabled: boolean;
|
|
81
|
-
submit: () => Promise<SoftEligibilitySessionState>;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Hook returning a function that creates a new HardEligibilitySession
|
|
86
|
-
*/
|
|
87
|
-
declare function useCreateHardEligibilitySession(): (config: _usebridge_sdk_core.HardEligibilitySessionConfig) => _usebridge_sdk_core.HardEligibilitySession;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Context for the HardEligibilitySession
|
|
91
|
-
*/
|
|
92
|
-
declare const HardEligibilityContext: react.Context<HardEligibilitySession | null>;
|
|
93
|
-
|
|
94
|
-
interface HardEligibilityProviderProps extends PropsWithChildren {
|
|
95
|
-
session: HardEligibilitySession;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Provides the context for HardEligibility hooks
|
|
99
|
-
*/
|
|
100
|
-
declare const HardEligibilityProvider: FC<HardEligibilityProviderProps>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Resolves to the SoftEligibilitySessionState
|
|
104
|
-
* Re-renders on state change
|
|
105
|
-
*/
|
|
106
|
-
declare function useHardEligibilityState(): HardEligibilitySessionState;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Returns a function to submit requests into the Hard Eligibility Session
|
|
110
|
-
* Parses the arguments required for the submission from the EligibilityInput
|
|
111
|
-
*/
|
|
112
|
-
declare function useHardEligibilitySubmit(): {
|
|
113
|
-
isDisabled: boolean;
|
|
114
|
-
submit: () => Promise<HardEligibilitySessionState>;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* State within the EligibilityInputStore
|
|
119
|
-
*/
|
|
120
|
-
interface EligibilityInputState {
|
|
121
|
-
requirePatient: boolean;
|
|
122
|
-
payer: {
|
|
123
|
-
value: Payer | null;
|
|
124
|
-
set: (payer: Payer | null) => void;
|
|
125
|
-
};
|
|
126
|
-
state: {
|
|
127
|
-
value: UsStateCode | null;
|
|
128
|
-
set: (state: UsStateCode | null) => void;
|
|
129
|
-
};
|
|
130
|
-
firstName: {
|
|
131
|
-
value: string;
|
|
132
|
-
set: (firstName: string) => void;
|
|
133
|
-
};
|
|
134
|
-
lastName: {
|
|
135
|
-
value: string;
|
|
136
|
-
set: (lastName: string) => void;
|
|
137
|
-
};
|
|
138
|
-
dateOfBirth: {
|
|
139
|
-
value: Date | null;
|
|
140
|
-
set: (dateOfBirth: Date | null) => void;
|
|
141
|
-
};
|
|
142
|
-
memberId: {
|
|
143
|
-
value: string;
|
|
144
|
-
set: (memberId: string) => void;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Context holding the EligibilityInputStore
|
|
150
|
-
*/
|
|
151
|
-
declare const EligibilityInputContext: react.Context<StoreApi<EligibilityInputState> | null>;
|
|
152
|
-
|
|
153
|
-
type Field = "firstName" | "lastName" | "dateOfBirth" | "memberId" | "payer" | "state";
|
|
154
|
-
type FieldState<F extends Field, T = EligibilityInputState[F]["value"]> = {
|
|
155
|
-
value: T;
|
|
156
|
-
setValue: (value: T) => void;
|
|
157
|
-
isVisible: boolean;
|
|
158
|
-
isValid: boolean;
|
|
159
|
-
isRequired: boolean;
|
|
160
|
-
isDisabled: boolean;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* Manages the input state for each field
|
|
164
|
-
*/
|
|
165
|
-
declare function useEligibilityInputField<F extends Field, T = EligibilityInputState[F]["value"]>(field: F): FieldState<F, T>;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Aggregated determination of whether all inputs are valid
|
|
169
|
-
*/
|
|
170
|
-
declare function useEligibilityInputIsValid(): boolean;
|
|
171
|
-
|
|
172
|
-
export { BridgeSdkProvider, EligibilityInputContext, HardEligibilityContext, HardEligibilityProvider, SoftEligibilityProvider, useBridgeSdk, useCreateHardEligibilitySession, useCreateSoftEligibilitySession, useEligibilityInputField, useEligibilityInputIsValid, useHardEligibilityState, useHardEligibilitySubmit, usePayerAutocomplete, usePayerSearch, useSoftEligibilityState, useSoftEligibilitySubmit };
|