@dfds-ui/hooks 2.2.0-alpha.9edc847c → 2.2.0-alpha.a78c2264
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/index.d.ts +6 -0
- package/package.json +2 -2
- package/useDimensions.d.ts +16 -0
- package/useForwardedRef.d.ts +3 -0
- package/useGoogleReCaptchaV3.d.ts +18 -0
- package/useOffline.d.ts +5 -0
- package/useResizeObserver.d.ts +2 -0
- package/useScript.d.ts +8 -0
- /package/{src → cjs}/index.d.ts +0 -0
- /package/{src → cjs}/useDimensions.d.ts +0 -0
- /package/{src → cjs}/useForwardedRef.d.ts +0 -0
- /package/{src → cjs}/useGoogleReCaptchaV3.d.ts +0 -0
- /package/{src → cjs}/useOffline.d.ts +0 -0
- /package/{src → cjs}/useResizeObserver.d.ts +0 -0
- /package/{src → cjs}/useScript.d.ts +0 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as useScript } from './useScript';
|
|
2
|
+
export { default as useResizeObserver } from './useResizeObserver';
|
|
3
|
+
export { default as useForwardedRef } from './useForwardedRef';
|
|
4
|
+
export { default as useOffline } from './useOffline';
|
|
5
|
+
export { default as useDimensions } from './useDimensions';
|
|
6
|
+
export * from './useGoogleReCaptchaV3';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React hooks",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "2.2.0-alpha.
|
|
6
|
+
"version": "2.2.0-alpha.a78c2264",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"main": "./cjs/index.js",
|
|
9
9
|
"module": "./index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"use-resize-observer": "^9.1.0"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "a78c2264aa558061cf24673e789db86617e849cc",
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DimensionObject {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
}
|
|
11
|
+
export type UseDimensionsHook = [(node: HTMLElement | null) => void, DimensionObject, HTMLElement | null];
|
|
12
|
+
export interface UseDimensionsArgs {
|
|
13
|
+
liveMeasure?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function useDimensions({ liveMeasure }?: UseDimensionsArgs): UseDimensionsHook;
|
|
16
|
+
export default useDimensions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
grecaptcha: any;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
export type GoogleReCaptchaV3Options = {
|
|
7
|
+
/**
|
|
8
|
+
* The `sitekey` to use with reCAPTCHA v3.
|
|
9
|
+
* https://developers.google.com/recaptcha/docs/v3
|
|
10
|
+
*/
|
|
11
|
+
siteKey: string;
|
|
12
|
+
/**
|
|
13
|
+
* Disable ReCaptcha preventing the script from loading and return undefined from the execute function.
|
|
14
|
+
* This is useful when consumer needs to conditionally enable or disable ReCaptcha
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function useGoogleReCaptchaV3({ siteKey, disabled }: GoogleReCaptchaV3Options): (action?: string) => Promise<string | undefined>;
|
package/useOffline.d.ts
ADDED
package/useScript.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for loading external script
|
|
3
|
+
* @param {string} src - The URL of the script
|
|
4
|
+
* @param {boolean} [doNotLoad=false] - If set to true the script will not be loaded
|
|
5
|
+
* This can be handy because hooks can not be called conditionally by the consumer
|
|
6
|
+
*/
|
|
7
|
+
declare function useScript(src: string, doNotLoad?: boolean): boolean[];
|
|
8
|
+
export default useScript;
|
/package/{src → cjs}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|