@ctlyst.id/utils 2.1.0 → 3.0.0-beta.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/dist/chunk-2DTW2MMP.js +2 -0
- package/dist/chunk-2DTW2MMP.js.map +1 -0
- package/dist/chunk-2XNWBZU3.js +2 -0
- package/dist/chunk-2XNWBZU3.js.map +1 -0
- package/dist/chunk-3EZJIWT4.js +2 -0
- package/dist/chunk-3EZJIWT4.js.map +1 -0
- package/dist/chunk-55ZXUIJW.js +2 -0
- package/dist/chunk-55ZXUIJW.js.map +1 -0
- package/dist/chunk-AKPPANNV.mjs +2 -0
- package/dist/chunk-AKPPANNV.mjs.map +1 -0
- package/dist/chunk-BUGYRVTO.js +2 -0
- package/dist/chunk-BUGYRVTO.js.map +1 -0
- package/dist/chunk-CKFIKCHU.mjs +2 -0
- package/dist/chunk-CKFIKCHU.mjs.map +1 -0
- package/dist/chunk-CWURCKL2.js +2 -0
- package/dist/chunk-CWURCKL2.js.map +1 -0
- package/dist/chunk-ELX5IXB4.js +2 -0
- package/dist/chunk-ELX5IXB4.js.map +1 -0
- package/dist/chunk-FMUZKH36.mjs +2 -0
- package/dist/chunk-FMUZKH36.mjs.map +1 -0
- package/dist/chunk-HXT73NCV.mjs +2 -0
- package/dist/chunk-HXT73NCV.mjs.map +1 -0
- package/dist/chunk-IX7NK5RI.js +2 -0
- package/dist/chunk-IX7NK5RI.js.map +1 -0
- package/dist/chunk-J2L4VY5C.mjs +2 -0
- package/dist/chunk-J2L4VY5C.mjs.map +1 -0
- package/dist/chunk-KOCPH2DG.js +2 -0
- package/dist/chunk-KOCPH2DG.js.map +1 -0
- package/dist/chunk-M2YCT7CB.mjs +2 -0
- package/dist/chunk-M2YCT7CB.mjs.map +1 -0
- package/dist/chunk-N7Z7DA36.js +2 -0
- package/dist/chunk-N7Z7DA36.js.map +1 -0
- package/dist/chunk-P7FXF4IE.mjs +2 -0
- package/dist/chunk-P7FXF4IE.mjs.map +1 -0
- package/dist/chunk-Q2LVN3QY.js +2 -0
- package/dist/chunk-Q2LVN3QY.js.map +1 -0
- package/dist/chunk-QAXXZNJX.mjs +2 -0
- package/dist/chunk-QAXXZNJX.mjs.map +1 -0
- package/dist/chunk-RATGBP35.js +2 -0
- package/dist/chunk-RATGBP35.js.map +1 -0
- package/dist/chunk-T3V567AP.mjs +2 -0
- package/dist/chunk-T3V567AP.mjs.map +1 -0
- package/dist/chunk-THVM4Z3S.mjs +2 -0
- package/dist/chunk-THVM4Z3S.mjs.map +1 -0
- package/dist/chunk-X4C76ZKK.mjs +2 -0
- package/dist/chunk-X4C76ZKK.mjs.map +1 -0
- package/dist/chunk-Y5HNEW7L.js +2 -0
- package/dist/chunk-Y5HNEW7L.js.map +1 -0
- package/dist/chunk-Z6WQXCNF.mjs +2 -0
- package/dist/chunk-Z6WQXCNF.mjs.map +1 -0
- package/dist/chunk-ZFGFCYYK.mjs +2 -0
- package/dist/chunk-ZFGFCYYK.mjs.map +1 -0
- package/dist/dom.d.mts +9 -0
- package/dist/dom.d.ts +9 -0
- package/dist/dom.js +2 -0
- package/dist/dom.js.map +1 -0
- package/dist/dom.mjs +2 -0
- package/dist/dom.mjs.map +1 -0
- package/dist/hooks/index.d.mts +13 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/hooks/use-callback-ref.d.mts +5 -0
- package/dist/hooks/use-callback-ref.d.ts +5 -0
- package/dist/hooks/use-callback-ref.js +2 -0
- package/dist/hooks/use-callback-ref.js.map +1 -0
- package/dist/hooks/use-callback-ref.mjs +2 -0
- package/dist/hooks/use-callback-ref.mjs.map +1 -0
- package/dist/hooks/use-clipboard.d.mts +18 -0
- package/dist/hooks/use-clipboard.d.ts +18 -0
- package/dist/hooks/use-clipboard.js +2 -0
- package/dist/hooks/use-clipboard.js.map +1 -0
- package/dist/hooks/use-clipboard.mjs +2 -0
- package/dist/hooks/use-clipboard.mjs.map +1 -0
- package/dist/hooks/use-debounce.d.mts +7 -0
- package/dist/hooks/use-debounce.d.ts +7 -0
- package/dist/hooks/use-debounce.js +2 -0
- package/dist/hooks/use-debounce.js.map +1 -0
- package/dist/hooks/use-debounce.mjs +2 -0
- package/dist/hooks/use-debounce.mjs.map +1 -0
- package/dist/hooks/use-dimensions.d.mts +7 -0
- package/dist/hooks/use-dimensions.d.ts +7 -0
- package/dist/hooks/use-dimensions.js +2 -0
- package/dist/hooks/use-dimensions.js.map +1 -0
- package/dist/hooks/use-dimensions.mjs +2 -0
- package/dist/hooks/use-dimensions.mjs.map +1 -0
- package/dist/hooks/use-disclosure.d.mts +20 -0
- package/dist/hooks/use-disclosure.d.ts +20 -0
- package/dist/hooks/use-disclosure.js +2 -0
- package/dist/hooks/use-disclosure.js.map +1 -0
- package/dist/hooks/use-disclosure.mjs +2 -0
- package/dist/hooks/use-disclosure.mjs.map +1 -0
- package/dist/hooks/use-media-query.d.mts +7 -0
- package/dist/hooks/use-media-query.d.ts +7 -0
- package/dist/hooks/use-media-query.js +2 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-media-query.mjs +2 -0
- package/dist/hooks/use-media-query.mjs.map +1 -0
- package/dist/hooks/use-number-formatter.d.mts +10 -0
- package/dist/hooks/use-number-formatter.d.ts +10 -0
- package/dist/hooks/use-number-formatter.js +2 -0
- package/dist/hooks/use-number-formatter.js.map +1 -0
- package/dist/hooks/use-number-formatter.mjs +2 -0
- package/dist/hooks/use-number-formatter.mjs.map +1 -0
- package/dist/hooks/use-online-status.d.mts +6 -0
- package/dist/hooks/use-online-status.d.ts +6 -0
- package/dist/hooks/use-online-status.js +2 -0
- package/dist/hooks/use-online-status.js.map +1 -0
- package/dist/hooks/use-online-status.mjs +2 -0
- package/dist/hooks/use-online-status.mjs.map +1 -0
- package/dist/hooks/use-outside-click.d.mts +10 -0
- package/dist/hooks/use-outside-click.d.ts +10 -0
- package/dist/hooks/use-outside-click.js +2 -0
- package/dist/hooks/use-outside-click.js.map +1 -0
- package/dist/hooks/use-outside-click.mjs +2 -0
- package/dist/hooks/use-outside-click.mjs.map +1 -0
- package/dist/hooks/use-safe-layout-effect.d.mts +5 -0
- package/dist/hooks/use-safe-layout-effect.d.ts +5 -0
- package/dist/hooks/use-safe-layout-effect.js +2 -0
- package/dist/hooks/use-safe-layout-effect.js.map +1 -0
- package/dist/hooks/use-safe-layout-effect.mjs +2 -0
- package/dist/hooks/use-safe-layout-effect.mjs.map +1 -0
- package/dist/hooks/use-voucher-tnc.d.mts +60 -0
- package/dist/hooks/use-voucher-tnc.d.ts +60 -0
- package/dist/hooks/use-voucher-tnc.js +2 -0
- package/dist/hooks/use-voucher-tnc.js.map +1 -0
- package/dist/hooks/use-voucher-tnc.mjs +2 -0
- package/dist/hooks/use-voucher-tnc.mjs.map +1 -0
- package/dist/index.d.mts +14 -142
- package/dist/index.d.ts +14 -142
- package/dist/index.js +1 -685
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -631
- package/dist/index.mjs.map +1 -1
- package/package.json +145 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import'../chunk-ZFGFCYYK.mjs';export{a as useMediaQuery}from'../chunk-HXT73NCV.mjs';export{a as useOnlineStatus}from'../chunk-QAXXZNJX.mjs';export{a as useOutsideClick}from'../chunk-Z6WQXCNF.mjs';export{b as DiscountType,a as VoucherType,c as useVoucherTnc}from'../chunk-THVM4Z3S.mjs';export{a as useNumberFormatter}from'../chunk-AKPPANNV.mjs';export{a as useClipboard}from'../chunk-J2L4VY5C.mjs';export{a as useDebounce}from'../chunk-X4C76ZKK.mjs';export{a as useDimensions}from'../chunk-CKFIKCHU.mjs';export{a as useSafeLayoutEffect}from'../chunk-FMUZKH36.mjs';import'../chunk-M2YCT7CB.mjs';export{a as useDisclosure}from'../chunk-T3V567AP.mjs';export{a as useCallbackRef}from'../chunk-P7FXF4IE.mjs';//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-callback-ref.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-callback-ref.mjs"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseClipboardOptions {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
format?: string;
|
|
6
|
+
}
|
|
7
|
+
interface UseClipboardProps {
|
|
8
|
+
value?: string;
|
|
9
|
+
optionsOrTimeout?: number | UseClipboardOptions;
|
|
10
|
+
}
|
|
11
|
+
declare const useClipboard: ({ value, optionsOrTimeout }?: UseClipboardProps) => {
|
|
12
|
+
value: string;
|
|
13
|
+
setValue: react.Dispatch<react.SetStateAction<string>>;
|
|
14
|
+
onCopy: () => void;
|
|
15
|
+
hasCopied: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { type UseClipboardOptions, type UseClipboardProps, useClipboard };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseClipboardOptions {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
format?: string;
|
|
6
|
+
}
|
|
7
|
+
interface UseClipboardProps {
|
|
8
|
+
value?: string;
|
|
9
|
+
optionsOrTimeout?: number | UseClipboardOptions;
|
|
10
|
+
}
|
|
11
|
+
declare const useClipboard: ({ value, optionsOrTimeout }?: UseClipboardProps) => {
|
|
12
|
+
value: string;
|
|
13
|
+
setValue: react.Dispatch<react.SetStateAction<string>>;
|
|
14
|
+
onCopy: () => void;
|
|
15
|
+
hasCopied: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { type UseClipboardOptions, type UseClipboardProps, useClipboard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-clipboard.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-clipboard.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-debounce.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-debounce.mjs"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxModel as BoxModel$1 } from 'css-box-model';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
|
|
4
|
+
type BoxModel = BoxModel$1;
|
|
5
|
+
declare const useDimensions: (ref: RefObject<HTMLElement>, observe?: boolean) => BoxModel$1 | null;
|
|
6
|
+
|
|
7
|
+
export { type BoxModel, useDimensions };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxModel as BoxModel$1 } from 'css-box-model';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
|
|
4
|
+
type BoxModel = BoxModel$1;
|
|
5
|
+
declare const useDimensions: (ref: RefObject<HTMLElement>, observe?: boolean) => BoxModel$1 | null;
|
|
6
|
+
|
|
7
|
+
export { type BoxModel, useDimensions };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkY5HNEW7L_js=require('../chunk-Y5HNEW7L.js');require('../chunk-CWURCKL2.js'),require('../chunk-RATGBP35.js');Object.defineProperty(exports,"useDimensions",{enumerable:true,get:function(){return chunkY5HNEW7L_js.a}});//# sourceMappingURL=use-dimensions.js.map
|
|
2
|
+
//# sourceMappingURL=use-dimensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-dimensions.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-dimensions.mjs"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseDisclosureProps {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
defaultIsOpen?: boolean;
|
|
6
|
+
onClose?(): void;
|
|
7
|
+
onOpen?(): void;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
type HTMLProps = HTMLAttributes<HTMLElement>;
|
|
11
|
+
declare const useDisclosure: ({ onClose: onCloseProp, onOpen: onOpenProp, isOpen: isOpenProp, defaultIsOpen: defaultIsOpenProp, id: idProp, }?: UseDisclosureProps) => {
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onOpen: () => void;
|
|
14
|
+
onToggle: () => void;
|
|
15
|
+
getButtonProps: ({ onClick, ...rest }?: HTMLProps) => HTMLProps;
|
|
16
|
+
getDisclosureProps: ({ ...rest }?: HTMLProps) => HTMLProps;
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { type UseDisclosureProps, useDisclosure };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseDisclosureProps {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
defaultIsOpen?: boolean;
|
|
6
|
+
onClose?(): void;
|
|
7
|
+
onOpen?(): void;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
type HTMLProps = HTMLAttributes<HTMLElement>;
|
|
11
|
+
declare const useDisclosure: ({ onClose: onCloseProp, onOpen: onOpenProp, isOpen: isOpenProp, defaultIsOpen: defaultIsOpenProp, id: idProp, }?: UseDisclosureProps) => {
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onOpen: () => void;
|
|
14
|
+
onToggle: () => void;
|
|
15
|
+
getButtonProps: ({ onClick, ...rest }?: HTMLProps) => HTMLProps;
|
|
16
|
+
getDisclosureProps: ({ ...rest }?: HTMLProps) => HTMLProps;
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { type UseDisclosureProps, useDisclosure };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunk2DTW2MMP_js=require('../chunk-2DTW2MMP.js');require('../chunk-55ZXUIJW.js');Object.defineProperty(exports,"useDisclosure",{enumerable:true,get:function(){return chunk2DTW2MMP_js.a}});//# sourceMappingURL=use-disclosure.js.map
|
|
2
|
+
//# sourceMappingURL=use-disclosure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-disclosure.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-disclosure.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-media-query.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-media-query.mjs"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface NumberFormatterProps {
|
|
2
|
+
value: number;
|
|
3
|
+
thousandSeparator?: string;
|
|
4
|
+
decimalLength?: number;
|
|
5
|
+
decimalSeparator?: string;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const useNumberFormatter: ({ value, thousandSeparator, decimalLength, decimalSeparator, prefix, }: NumberFormatterProps) => string;
|
|
9
|
+
|
|
10
|
+
export { type NumberFormatterProps, useNumberFormatter };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface NumberFormatterProps {
|
|
2
|
+
value: number;
|
|
3
|
+
thousandSeparator?: string;
|
|
4
|
+
decimalLength?: number;
|
|
5
|
+
decimalSeparator?: string;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const useNumberFormatter: ({ value, thousandSeparator, decimalLength, decimalSeparator, prefix, }: NumberFormatterProps) => string;
|
|
9
|
+
|
|
10
|
+
export { type NumberFormatterProps, useNumberFormatter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-number-formatter.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-number-formatter.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-online-status.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-online-status.mjs"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseOutsideClickProps {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
ref: RefObject<HTMLElement>;
|
|
6
|
+
handler?: (e: Event) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const useOutsideClick: ({ enabled, ref, handler }: UseOutsideClickProps) => void;
|
|
9
|
+
|
|
10
|
+
export { type UseOutsideClickProps, useOutsideClick };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseOutsideClickProps {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
ref: RefObject<HTMLElement>;
|
|
6
|
+
handler?: (e: Event) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const useOutsideClick: ({ enabled, ref, handler }: UseOutsideClickProps) => void;
|
|
9
|
+
|
|
10
|
+
export { type UseOutsideClickProps, useOutsideClick };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunk3EZJIWT4_js=require('../chunk-3EZJIWT4.js');require('../chunk-RATGBP35.js'),require('../chunk-55ZXUIJW.js');Object.defineProperty(exports,"useOutsideClick",{enumerable:true,get:function(){return chunk3EZJIWT4_js.a}});//# sourceMappingURL=use-outside-click.js.map
|
|
2
|
+
//# sourceMappingURL=use-outside-click.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-outside-click.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-outside-click.mjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkCWURCKL2_js=require('../chunk-CWURCKL2.js');require('../chunk-RATGBP35.js');Object.defineProperty(exports,"useSafeLayoutEffect",{enumerable:true,get:function(){return chunkCWURCKL2_js.a}});//# sourceMappingURL=use-safe-layout-effect.js.map
|
|
2
|
+
//# sourceMappingURL=use-safe-layout-effect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-safe-layout-effect.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-safe-layout-effect.mjs"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare enum VoucherType {
|
|
2
|
+
product = "Product",
|
|
3
|
+
order = "Order",
|
|
4
|
+
gift = "Gift",
|
|
5
|
+
freeShipping = "Free Shipping",
|
|
6
|
+
freeInsurance = "Free Insurance",
|
|
7
|
+
bundling = "Bundling",
|
|
8
|
+
payment = "Payment",
|
|
9
|
+
affiliate = "Affiliate"
|
|
10
|
+
}
|
|
11
|
+
declare enum DiscountType {
|
|
12
|
+
percentage = "percentage",
|
|
13
|
+
amount = "amount"
|
|
14
|
+
}
|
|
15
|
+
type CollectionType = {
|
|
16
|
+
collectionId: number;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
type BrandType = {
|
|
20
|
+
brandId: number;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
type VoucherPaymentType = {
|
|
24
|
+
bankId: number;
|
|
25
|
+
bankName: string;
|
|
26
|
+
paymentMethod: string[];
|
|
27
|
+
bin: string[];
|
|
28
|
+
creditBinGroup: string[];
|
|
29
|
+
debitBinGroup: string[];
|
|
30
|
+
};
|
|
31
|
+
interface VoucherTncProps {
|
|
32
|
+
type: string;
|
|
33
|
+
discountType: string;
|
|
34
|
+
discountValue: number | string;
|
|
35
|
+
maxDiscountAmount: number | string;
|
|
36
|
+
collections: CollectionType[];
|
|
37
|
+
brands: BrandType[];
|
|
38
|
+
eligibilityType: string | null;
|
|
39
|
+
isCheckedMaxFee: boolean;
|
|
40
|
+
limitFee: number | string;
|
|
41
|
+
termsMinQty: number | string;
|
|
42
|
+
termsMinTotalAmount: number | string;
|
|
43
|
+
isOneTimeUsage: boolean;
|
|
44
|
+
quota: number;
|
|
45
|
+
transactionTerms: number;
|
|
46
|
+
dateStart: string;
|
|
47
|
+
dateEnd: string;
|
|
48
|
+
isOneTimeUsagePerCard: boolean;
|
|
49
|
+
payment: VoucherPaymentType | null;
|
|
50
|
+
isGiftCard?: boolean;
|
|
51
|
+
}
|
|
52
|
+
type GetPeriodProps = Pick<VoucherTncProps, 'dateStart' | 'dateEnd'>;
|
|
53
|
+
type GetAppliesToProps = Pick<VoucherTncProps, 'type' | 'brands' | 'collections' | 'eligibilityType' | 'payment'>;
|
|
54
|
+
type GetMethodTermsProps = Pick<VoucherTncProps, 'type' | 'discountType' | 'discountValue' | 'isCheckedMaxFee' | 'maxDiscountAmount' | 'transactionTerms' | 'termsMinTotalAmount' | 'termsMinQty' | 'limitFee'>;
|
|
55
|
+
type GetUsageLimitProps = Pick<VoucherTncProps, 'isOneTimeUsage' | 'isOneTimeUsagePerCard'>;
|
|
56
|
+
type GetBankBinProps = Pick<VoucherPaymentType, 'bankName' | 'creditBinGroup' | 'debitBinGroup'>;
|
|
57
|
+
|
|
58
|
+
declare const useVoucherTnc: (props: VoucherTncProps | null) => string[];
|
|
59
|
+
|
|
60
|
+
export { DiscountType, type GetAppliesToProps, type GetBankBinProps, type GetMethodTermsProps, type GetPeriodProps, type GetUsageLimitProps, type VoucherPaymentType, type VoucherTncProps, VoucherType, useVoucherTnc };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare enum VoucherType {
|
|
2
|
+
product = "Product",
|
|
3
|
+
order = "Order",
|
|
4
|
+
gift = "Gift",
|
|
5
|
+
freeShipping = "Free Shipping",
|
|
6
|
+
freeInsurance = "Free Insurance",
|
|
7
|
+
bundling = "Bundling",
|
|
8
|
+
payment = "Payment",
|
|
9
|
+
affiliate = "Affiliate"
|
|
10
|
+
}
|
|
11
|
+
declare enum DiscountType {
|
|
12
|
+
percentage = "percentage",
|
|
13
|
+
amount = "amount"
|
|
14
|
+
}
|
|
15
|
+
type CollectionType = {
|
|
16
|
+
collectionId: number;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
type BrandType = {
|
|
20
|
+
brandId: number;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
type VoucherPaymentType = {
|
|
24
|
+
bankId: number;
|
|
25
|
+
bankName: string;
|
|
26
|
+
paymentMethod: string[];
|
|
27
|
+
bin: string[];
|
|
28
|
+
creditBinGroup: string[];
|
|
29
|
+
debitBinGroup: string[];
|
|
30
|
+
};
|
|
31
|
+
interface VoucherTncProps {
|
|
32
|
+
type: string;
|
|
33
|
+
discountType: string;
|
|
34
|
+
discountValue: number | string;
|
|
35
|
+
maxDiscountAmount: number | string;
|
|
36
|
+
collections: CollectionType[];
|
|
37
|
+
brands: BrandType[];
|
|
38
|
+
eligibilityType: string | null;
|
|
39
|
+
isCheckedMaxFee: boolean;
|
|
40
|
+
limitFee: number | string;
|
|
41
|
+
termsMinQty: number | string;
|
|
42
|
+
termsMinTotalAmount: number | string;
|
|
43
|
+
isOneTimeUsage: boolean;
|
|
44
|
+
quota: number;
|
|
45
|
+
transactionTerms: number;
|
|
46
|
+
dateStart: string;
|
|
47
|
+
dateEnd: string;
|
|
48
|
+
isOneTimeUsagePerCard: boolean;
|
|
49
|
+
payment: VoucherPaymentType | null;
|
|
50
|
+
isGiftCard?: boolean;
|
|
51
|
+
}
|
|
52
|
+
type GetPeriodProps = Pick<VoucherTncProps, 'dateStart' | 'dateEnd'>;
|
|
53
|
+
type GetAppliesToProps = Pick<VoucherTncProps, 'type' | 'brands' | 'collections' | 'eligibilityType' | 'payment'>;
|
|
54
|
+
type GetMethodTermsProps = Pick<VoucherTncProps, 'type' | 'discountType' | 'discountValue' | 'isCheckedMaxFee' | 'maxDiscountAmount' | 'transactionTerms' | 'termsMinTotalAmount' | 'termsMinQty' | 'limitFee'>;
|
|
55
|
+
type GetUsageLimitProps = Pick<VoucherTncProps, 'isOneTimeUsage' | 'isOneTimeUsagePerCard'>;
|
|
56
|
+
type GetBankBinProps = Pick<VoucherPaymentType, 'bankName' | 'creditBinGroup' | 'debitBinGroup'>;
|
|
57
|
+
|
|
58
|
+
declare const useVoucherTnc: (props: VoucherTncProps | null) => string[];
|
|
59
|
+
|
|
60
|
+
export { DiscountType, type GetAppliesToProps, type GetBankBinProps, type GetMethodTermsProps, type GetPeriodProps, type GetUsageLimitProps, type VoucherPaymentType, type VoucherTncProps, VoucherType, useVoucherTnc };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkN7Z7DA36_js=require('../chunk-N7Z7DA36.js');require('../chunk-IX7NK5RI.js');Object.defineProperty(exports,"DiscountType",{enumerable:true,get:function(){return chunkN7Z7DA36_js.b}});Object.defineProperty(exports,"VoucherType",{enumerable:true,get:function(){return chunkN7Z7DA36_js.a}});Object.defineProperty(exports,"useVoucherTnc",{enumerable:true,get:function(){return chunkN7Z7DA36_js.c}});//# sourceMappingURL=use-voucher-tnc.js.map
|
|
2
|
+
//# sourceMappingURL=use-voucher-tnc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-voucher-tnc.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"use-voucher-tnc.mjs"}
|