@shakerquiz/utilities 0.2.2 → 0.2.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URLOptions } from '@yurkimus/url'
|
|
2
2
|
|
|
3
|
-
import { Roles } from 'source/enumerations/roles'
|
|
3
|
+
import type { Roles, RolesUnion } from 'source/enumerations/roles'
|
|
4
4
|
import { Features } from '../enumerations/features'
|
|
5
5
|
import { Methods } from '../enumerations/methods'
|
|
6
6
|
import { Networks } from '../enumerations/networks'
|
|
@@ -441,7 +441,7 @@ export let useRequest: <
|
|
|
441
441
|
feature: Feature,
|
|
442
442
|
method: Method,
|
|
443
443
|
network: Network,
|
|
444
|
-
) => <Role extends
|
|
444
|
+
) => <Role extends Roles[RolesUnion] = Roles['Default']>(
|
|
445
445
|
options: URLOptions,
|
|
446
446
|
init: RequestInit,
|
|
447
447
|
) => Promise<RequestResults[Feature][Method][Role]>
|
package/source/globals.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
type Nullable<Type> = Type | null
|
|
6
6
|
|
|
7
|
+
type Optional<Type> = Type | null | undefined
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Mixins
|
|
9
11
|
*/
|
|
@@ -11,4 +13,13 @@ type Nullable<Type> = Type | null
|
|
|
11
13
|
interface RequestInit {
|
|
12
14
|
/** A string to declaratively set the Authorization header. */
|
|
13
15
|
cookie?: string
|
|
14
|
-
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* React
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
type UseState<Type> = [
|
|
23
|
+
Type,
|
|
24
|
+
import('react').Dispatch<import('react').SetStateAction<Type>>,
|
|
25
|
+
]
|