@arkyn/types 1.4.52 → 1.4.53-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.
Files changed (87) hide show
  1. package/dist/index.d.ts +19 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +20 -3
  4. package/dist/shared/formats/formatDate.d.ts +4 -0
  5. package/dist/shared/formats/formatDate.d.ts.map +1 -0
  6. package/dist/shared/formats/formatJsonObject.d.ts +3 -0
  7. package/dist/shared/formats/formatJsonObject.d.ts.map +1 -0
  8. package/dist/shared/formats/formatJsonString.d.ts +3 -0
  9. package/dist/shared/formats/formatJsonString.d.ts.map +1 -0
  10. package/dist/shared/formats/formatJsonString.js +1 -0
  11. package/dist/shared/formats/formatToCep.d.ts +3 -0
  12. package/dist/shared/formats/formatToCep.d.ts.map +1 -0
  13. package/dist/shared/formats/formatToCep.js +1 -0
  14. package/dist/shared/formats/formatToCnpj.d.ts +3 -0
  15. package/dist/shared/formats/formatToCnpj.d.ts.map +1 -0
  16. package/dist/shared/formats/formatToCnpj.js +1 -0
  17. package/dist/shared/formats/formatToCpf.d.ts +3 -0
  18. package/dist/shared/formats/formatToCpf.d.ts.map +1 -0
  19. package/dist/shared/formats/formatToCpf.js +1 -0
  20. package/dist/shared/formats/formatToCpfCnpj.d.ts +3 -0
  21. package/dist/shared/formats/formatToCpfCnpj.d.ts.map +1 -0
  22. package/dist/shared/formats/formatToCpfCnpj.js +1 -0
  23. package/dist/shared/formats/formatToCurrency.d.ts +8 -0
  24. package/dist/shared/formats/formatToCurrency.d.ts.map +1 -0
  25. package/dist/shared/formats/formatToCurrency.js +1 -0
  26. package/dist/shared/formats/formatToEllipsis.d.ts +3 -0
  27. package/dist/shared/formats/formatToEllipsis.d.ts.map +1 -0
  28. package/dist/shared/formats/formatToEllipsis.js +1 -0
  29. package/dist/shared/formats/formatToHiddenDigits.d.ts +6 -0
  30. package/dist/shared/formats/formatToHiddenDigits.d.ts.map +1 -0
  31. package/dist/shared/formats/formatToHiddenDigits.js +1 -0
  32. package/dist/shared/formats/formatToPhone.d.ts +3 -0
  33. package/dist/shared/formats/formatToPhone.d.ts.map +1 -0
  34. package/dist/shared/formats/formatToPhone.js +1 -0
  35. package/dist/shared/generators/generateColorByString.d.ts +3 -0
  36. package/dist/shared/generators/generateColorByString.d.ts.map +1 -0
  37. package/dist/shared/generators/generateColorByString.js +1 -0
  38. package/dist/shared/services/calculateCardInstallment.d.ts +10 -0
  39. package/dist/shared/services/calculateCardInstallment.d.ts.map +1 -0
  40. package/dist/shared/services/calculateCardInstallment.js +1 -0
  41. package/dist/shared/services/maskSensitiveData.d.ts +3 -0
  42. package/dist/shared/services/maskSensitiveData.d.ts.map +1 -0
  43. package/dist/shared/services/maskSensitiveData.js +1 -0
  44. package/dist/shared/services/removeCurrencySymbols.d.ts +3 -0
  45. package/dist/shared/services/removeCurrencySymbols.d.ts.map +1 -0
  46. package/dist/shared/services/removeCurrencySymbols.js +1 -0
  47. package/dist/shared/services/truncateLargeFields.d.ts +3 -0
  48. package/dist/shared/services/truncateLargeFields.d.ts.map +1 -0
  49. package/dist/shared/services/truncateLargeFields.js +1 -0
  50. package/dist/shared/validations/validateCpf.d.ts +3 -0
  51. package/dist/shared/validations/validateCpf.d.ts.map +1 -0
  52. package/dist/shared/validations/validateCpf.js +1 -0
  53. package/dist/shared/validations/validateDate.d.ts +8 -0
  54. package/dist/shared/validations/validateDate.d.ts.map +1 -0
  55. package/dist/shared/validations/validateDate.js +1 -0
  56. package/dist/shared/validations/validatePhone.d.ts +3 -0
  57. package/dist/shared/validations/validatePhone.d.ts.map +1 -0
  58. package/dist/shared/validations/validatePhone.js +1 -0
  59. package/package.json +1 -1
  60. package/src/index.ts +23 -3
  61. package/src/shared/formats/formatDate.ts +11 -0
  62. package/src/shared/formats/formatJsonObject.ts +3 -0
  63. package/src/shared/formats/formatJsonString.ts +3 -0
  64. package/src/shared/formats/formatToCep.ts +3 -0
  65. package/src/shared/formats/formatToCnpj.ts +3 -0
  66. package/src/shared/formats/formatToCpf.ts +3 -0
  67. package/src/shared/formats/formatToCpfCnpj.ts +3 -0
  68. package/src/shared/formats/formatToCurrency.ts +15 -0
  69. package/src/shared/formats/formatToEllipsis.ts +3 -0
  70. package/src/shared/formats/formatToHiddenDigits.ts +6 -0
  71. package/src/shared/formats/formatToPhone.ts +3 -0
  72. package/src/shared/generators/generateColorByString.ts +3 -0
  73. package/src/shared/services/calculateCardInstallment.ts +10 -0
  74. package/src/shared/services/maskSensitiveData.ts +6 -0
  75. package/src/shared/services/removeCurrencySymbols.ts +3 -0
  76. package/src/shared/services/truncateLargeFields.ts +6 -0
  77. package/src/shared/validations/validateCpf.ts +3 -0
  78. package/src/shared/validations/validateDate.ts +12 -0
  79. package/src/shared/validations/validatePhone.ts +3 -0
  80. package/dist/shared/CalculateCardInstallmentProps.d.ts +0 -7
  81. package/dist/shared/CalculateCardInstallmentProps.d.ts.map +0 -1
  82. package/dist/shared/FomartToHiddenDigitsOptions.d.ts +0 -6
  83. package/dist/shared/FomartToHiddenDigitsOptions.d.ts.map +0 -1
  84. package/src/shared/CalculateCardInstallmentProps.ts +0 -7
  85. package/src/shared/FomartToHiddenDigitsOptions.ts +0 -6
  86. /package/dist/shared/{CalculateCardInstallmentProps.js → formats/formatDate.js} +0 -0
  87. /package/dist/shared/{FomartToHiddenDigitsOptions.js → formats/formatJsonObject.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -47,6 +47,23 @@ export * from "./hooks/Modal";
47
47
  export * from "./hooks/Toast";
48
48
  export * from "./server/formParseProps";
49
49
  export * from "./server/httpResponse";
50
- export * from "./shared/CalculateCardInstallmentProps";
51
- export * from "./shared/FomartToHiddenDigitsOptions";
50
+ export * from "./shared/formats/formatDate";
51
+ export * from "./shared/formats/formatJsonObject";
52
+ export * from "./shared/formats/formatJsonString";
53
+ export * from "./shared/formats/formatToCep";
54
+ export * from "./shared/formats/formatToCnpj";
55
+ export * from "./shared/formats/formatToCpf";
56
+ export * from "./shared/formats/formatToCpfCnpj";
57
+ export * from "./shared/formats/formatToCurrency";
58
+ export * from "./shared/formats/formatToEllipsis";
59
+ export * from "./shared/formats/formatToHiddenDigits";
60
+ export * from "./shared/formats/formatToPhone";
61
+ export * from "./shared/generators/generateColorByString";
62
+ export * from "./shared/services/calculateCardInstallment";
63
+ export * from "./shared/services/maskSensitiveData";
64
+ export * from "./shared/services/removeCurrencySymbols";
65
+ export * from "./shared/services/truncateLargeFields";
66
+ export * from "./shared/validations/validateCpf";
67
+ export * from "./shared/validations/validateDate";
68
+ export * from "./shared/validations/validatePhone";
52
69
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAG7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBA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C,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC"}
package/dist/index.js CHANGED
@@ -51,6 +51,23 @@ export * from "./hooks/Toast";
51
51
  // Server
52
52
  export * from "./server/formParseProps";
53
53
  export * from "./server/httpResponse";
54
- // Shared
55
- export * from "./shared/CalculateCardInstallmentProps";
56
- export * from "./shared/FomartToHiddenDigitsOptions";
54
+ // shared
55
+ export * from "./shared/formats/formatDate";
56
+ export * from "./shared/formats/formatJsonObject";
57
+ export * from "./shared/formats/formatJsonString";
58
+ export * from "./shared/formats/formatToCep";
59
+ export * from "./shared/formats/formatToCnpj";
60
+ export * from "./shared/formats/formatToCpf";
61
+ export * from "./shared/formats/formatToCpfCnpj";
62
+ export * from "./shared/formats/formatToCurrency";
63
+ export * from "./shared/formats/formatToEllipsis";
64
+ export * from "./shared/formats/formatToHiddenDigits";
65
+ export * from "./shared/formats/formatToPhone";
66
+ export * from "./shared/generators/generateColorByString";
67
+ export * from "./shared/services/calculateCardInstallment";
68
+ export * from "./shared/services/maskSensitiveData";
69
+ export * from "./shared/services/removeCurrencySymbols";
70
+ export * from "./shared/services/truncateLargeFields";
71
+ export * from "./shared/validations/validateCpf";
72
+ export * from "./shared/validations/validateDate";
73
+ export * from "./shared/validations/validatePhone";
@@ -0,0 +1,4 @@
1
+ type InputFormatTypes = "brazilianDate" | "isoDate" | "timestamp";
2
+ type FormatDateFunction = (date: string, time: string, inputFormat: InputFormatTypes, outputFormat: string, timezone?: number) => string;
3
+ export type { FormatDateFunction };
4
+ //# sourceMappingURL=formatDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatDate.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,eAAe,GAAG,SAAS,GAAG,WAAW,CAAC;AAElE,KAAK,kBAAkB,GAAG,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EAAE,MAAM,EACpB,QAAQ,CAAC,EAAE,MAAM,KACd,MAAM,CAAC;AAEZ,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ type FormatJsonObjectFunction = (jsonString: any, identLevel: number) => string;
2
+ export type { FormatJsonObjectFunction };
3
+ //# sourceMappingURL=formatJsonObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatJsonObject.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatJsonObject.ts"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;AAEhF,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ type FormatJsonStringFunction = (jsonString: string) => string;
2
+ export type { FormatJsonStringFunction };
3
+ //# sourceMappingURL=formatJsonString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatJsonString.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatJsonString.ts"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;AAE/D,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type FormatToCepFunction = (value: string) => string;
2
+ export type { FormatToCepFunction };
3
+ //# sourceMappingURL=formatToCep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToCep.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToCep.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAErD,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type FormatToCnpjFunction = (value: string) => string;
2
+ export type { FormatToCnpjFunction };
3
+ //# sourceMappingURL=formatToCnpj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToCnpj.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToCnpj.ts"],"names":[],"mappings":"AAAA,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEtD,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type FormatToCpfFunction = (value: string) => string;
2
+ export type { FormatToCpfFunction };
3
+ //# sourceMappingURL=formatToCpf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToCpf.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToCpf.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAErD,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type FormatToCpfCnpjFunction = (value: string) => string;
2
+ export type { FormatToCpfCnpjFunction };
3
+ //# sourceMappingURL=formatToCpfCnpj.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToCpfCnpj.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToCpfCnpj.ts"],"names":[],"mappings":"AAAA,KAAK,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;AAEzD,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { countryCurrencies } from "@arkyn/templates";
2
+ type Currencies = keyof typeof countryCurrencies;
3
+ type Config = {
4
+ showPrefix?: boolean;
5
+ };
6
+ type FormatToCurrency = (value: number, currency: Currencies, config?: Config) => string;
7
+ export type { FormatToCurrency };
8
+ //# sourceMappingURL=formatToCurrency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToCurrency.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToCurrency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,KAAK,UAAU,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAEjD,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,gBAAgB,GAAG,CACtB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,UAAU,EACpB,MAAM,CAAC,EAAE,MAAM,KACZ,MAAM,CAAC;AAEZ,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ import { countryCurrencies } from "@arkyn/templates";
@@ -0,0 +1,3 @@
1
+ type FormatToEllipsisFunction = (value: string, maxLength: number) => string;
2
+ export type { FormatToEllipsisFunction };
3
+ //# sourceMappingURL=formatToEllipsis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToEllipsis.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToEllipsis.ts"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;AAE7E,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ type FormatToHiddenDigitsFunction = (value: string, options: {
2
+ range?: number | [number, number];
3
+ hider?: string;
4
+ }) => string;
5
+ export type { FormatToHiddenDigitsFunction };
6
+ //# sourceMappingURL=formatToHiddenDigits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToHiddenDigits.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToHiddenDigits.ts"],"names":[],"mappings":"AAAA,KAAK,4BAA4B,GAAG,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KAC3D,MAAM,CAAC;AAEZ,YAAY,EAAE,4BAA4B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type FormatToPhoneFunction = (prop: string) => string;
2
+ export type { FormatToPhoneFunction };
3
+ //# sourceMappingURL=formatToPhone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatToPhone.d.ts","sourceRoot":"","sources":["../../../src/shared/formats/formatToPhone.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAEtD,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type GenerateColorByStringFunction = (prop: string) => string;
2
+ export type { GenerateColorByStringFunction };
3
+ //# sourceMappingURL=generateColorByString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateColorByString.d.ts","sourceRoot":"","sources":["../../../src/shared/generators/generateColorByString.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;AAE9D,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ type CalculateCardInstallmentFunction = (props: {
2
+ cashPrice: number;
3
+ numberInstallments: number;
4
+ fees?: number;
5
+ }) => {
6
+ totalPrice: number;
7
+ installmentPrice: number;
8
+ };
9
+ export type { CalculateCardInstallmentFunction };
10
+ //# sourceMappingURL=calculateCardInstallment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateCardInstallment.d.ts","sourceRoot":"","sources":["../../../src/shared/services/calculateCardInstallment.ts"],"names":[],"mappings":"AAAA,KAAK,gCAAgC,GAAG,CAAC,KAAK,EAAE;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KAAK;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,YAAY,EAAE,gCAAgC,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type MaskSensitiveDataFunction = (jsonString: string, sensitiveKeys?: string[]) => string;
2
+ export type { MaskSensitiveDataFunction };
3
+ //# sourceMappingURL=maskSensitiveData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maskSensitiveData.d.ts","sourceRoot":"","sources":["../../../src/shared/services/maskSensitiveData.ts"],"names":[],"mappings":"AAAA,KAAK,yBAAyB,GAAG,CAC/B,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,EAAE,KACrB,MAAM,CAAC;AAEZ,YAAY,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type RemoveCurrencySymbolsFunction = (formattedValue: string) => string;
2
+ export type { RemoveCurrencySymbolsFunction };
3
+ //# sourceMappingURL=removeCurrencySymbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeCurrencySymbols.d.ts","sourceRoot":"","sources":["../../../src/shared/services/removeCurrencySymbols.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;AAExE,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type TruncateLargeFieldsFunction = (jsonString: string, maxLength?: number) => string;
2
+ export type { TruncateLargeFieldsFunction };
3
+ //# sourceMappingURL=truncateLargeFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncateLargeFields.d.ts","sourceRoot":"","sources":["../../../src/shared/services/truncateLargeFields.ts"],"names":[],"mappings":"AAAA,KAAK,2BAA2B,GAAG,CACjC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,KACf,MAAM,CAAC;AAEZ,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type ValidateCpfFunction = (cpf: string) => boolean;
2
+ export type { ValidateCpfFunction };
3
+ //# sourceMappingURL=validateCpf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateCpf.d.ts","sourceRoot":"","sources":["../../../src/shared/validations/validateCpf.ts"],"names":[],"mappings":"AAAA,KAAK,mBAAmB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAEpD,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ type ValidateDateConfig = {
2
+ inputFormat?: "DD/MM/YYYY" | "MM-DD-YYYY" | "YYYY-MM-DD";
3
+ minYear?: number;
4
+ maxYear?: number;
5
+ };
6
+ type ValidateDateFunction = (date: string, config?: ValidateDateConfig) => boolean;
7
+ export type { ValidateDateFunction };
8
+ //# sourceMappingURL=validateDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateDate.d.ts","sourceRoot":"","sources":["../../../src/shared/validations/validateDate.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG;IACxB,WAAW,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG,CAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,kBAAkB,KACxB,OAAO,CAAC;AAEb,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ type ValidatePhoneFunction = (phone: string) => boolean;
2
+ export type { ValidatePhoneFunction };
3
+ //# sourceMappingURL=validatePhone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatePhone.d.ts","sourceRoot":"","sources":["../../../src/shared/validations/validatePhone.ts"],"names":[],"mappings":"AAAA,KAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAExD,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/types",
3
- "version": "1.4.52",
3
+ "version": "1.4.53-beta.1",
4
4
  "main": "./dist/bundle.js",
5
5
  "module": "./src/index.ts",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -55,6 +55,26 @@ export * from "./hooks/Toast";
55
55
  export * from "./server/formParseProps";
56
56
  export * from "./server/httpResponse";
57
57
 
58
- // Shared
59
- export * from "./shared/CalculateCardInstallmentProps";
60
- export * from "./shared/FomartToHiddenDigitsOptions";
58
+ // shared
59
+ export * from "./shared/formats/formatDate";
60
+ export * from "./shared/formats/formatJsonObject";
61
+ export * from "./shared/formats/formatJsonString";
62
+ export * from "./shared/formats/formatToCep";
63
+ export * from "./shared/formats/formatToCnpj";
64
+ export * from "./shared/formats/formatToCpf";
65
+ export * from "./shared/formats/formatToCpfCnpj";
66
+ export * from "./shared/formats/formatToCurrency";
67
+ export * from "./shared/formats/formatToEllipsis";
68
+ export * from "./shared/formats/formatToHiddenDigits";
69
+ export * from "./shared/formats/formatToPhone";
70
+
71
+ export * from "./shared/generators/generateColorByString";
72
+
73
+ export * from "./shared/services/calculateCardInstallment";
74
+ export * from "./shared/services/maskSensitiveData";
75
+ export * from "./shared/services/removeCurrencySymbols";
76
+ export * from "./shared/services/truncateLargeFields";
77
+
78
+ export * from "./shared/validations/validateCpf";
79
+ export * from "./shared/validations/validateDate";
80
+ export * from "./shared/validations/validatePhone";
@@ -0,0 +1,11 @@
1
+ type InputFormatTypes = "brazilianDate" | "isoDate" | "timestamp";
2
+
3
+ type FormatDateFunction = (
4
+ date: string,
5
+ time: string,
6
+ inputFormat: InputFormatTypes,
7
+ outputFormat: string,
8
+ timezone?: number
9
+ ) => string;
10
+
11
+ export type { FormatDateFunction };
@@ -0,0 +1,3 @@
1
+ type FormatJsonObjectFunction = (jsonString: any, identLevel: number) => string;
2
+
3
+ export type { FormatJsonObjectFunction };
@@ -0,0 +1,3 @@
1
+ type FormatJsonStringFunction = (jsonString: string) => string;
2
+
3
+ export type { FormatJsonStringFunction };
@@ -0,0 +1,3 @@
1
+ type FormatToCepFunction = (value: string) => string;
2
+
3
+ export type { FormatToCepFunction };
@@ -0,0 +1,3 @@
1
+ type FormatToCnpjFunction = (value: string) => string;
2
+
3
+ export type { FormatToCnpjFunction };
@@ -0,0 +1,3 @@
1
+ type FormatToCpfFunction = (value: string) => string;
2
+
3
+ export type { FormatToCpfFunction };
@@ -0,0 +1,3 @@
1
+ type FormatToCpfCnpjFunction = (value: string) => string;
2
+
3
+ export type { FormatToCpfCnpjFunction };
@@ -0,0 +1,15 @@
1
+ import { countryCurrencies } from "@arkyn/templates";
2
+
3
+ type Currencies = keyof typeof countryCurrencies;
4
+
5
+ type Config = {
6
+ showPrefix?: boolean;
7
+ };
8
+
9
+ type FormatToCurrency = (
10
+ value: number,
11
+ currency: Currencies,
12
+ config?: Config
13
+ ) => string;
14
+
15
+ export type { FormatToCurrency };
@@ -0,0 +1,3 @@
1
+ type FormatToEllipsisFunction = (value: string, maxLength: number) => string;
2
+
3
+ export type { FormatToEllipsisFunction };
@@ -0,0 +1,6 @@
1
+ type FormatToHiddenDigitsFunction = (
2
+ value: string,
3
+ options: { range?: number | [number, number]; hider?: string }
4
+ ) => string;
5
+
6
+ export type { FormatToHiddenDigitsFunction };
@@ -0,0 +1,3 @@
1
+ type FormatToPhoneFunction = (prop: string) => string;
2
+
3
+ export type { FormatToPhoneFunction };
@@ -0,0 +1,3 @@
1
+ type GenerateColorByStringFunction = (prop: string) => string;
2
+
3
+ export type { GenerateColorByStringFunction };
@@ -0,0 +1,10 @@
1
+ type CalculateCardInstallmentFunction = (props: {
2
+ cashPrice: number;
3
+ numberInstallments: number;
4
+ fees?: number;
5
+ }) => {
6
+ totalPrice: number;
7
+ installmentPrice: number;
8
+ };
9
+
10
+ export type { CalculateCardInstallmentFunction };
@@ -0,0 +1,6 @@
1
+ type MaskSensitiveDataFunction = (
2
+ jsonString: string,
3
+ sensitiveKeys?: string[]
4
+ ) => string;
5
+
6
+ export type { MaskSensitiveDataFunction };
@@ -0,0 +1,3 @@
1
+ type RemoveCurrencySymbolsFunction = (formattedValue: string) => string;
2
+
3
+ export type { RemoveCurrencySymbolsFunction };
@@ -0,0 +1,6 @@
1
+ type TruncateLargeFieldsFunction = (
2
+ jsonString: string,
3
+ maxLength?: number
4
+ ) => string;
5
+
6
+ export type { TruncateLargeFieldsFunction };
@@ -0,0 +1,3 @@
1
+ type ValidateCpfFunction = (cpf: string) => boolean;
2
+
3
+ export type { ValidateCpfFunction };
@@ -0,0 +1,12 @@
1
+ type ValidateDateConfig = {
2
+ inputFormat?: "DD/MM/YYYY" | "MM-DD-YYYY" | "YYYY-MM-DD";
3
+ minYear?: number;
4
+ maxYear?: number;
5
+ };
6
+
7
+ type ValidateDateFunction = (
8
+ date: string,
9
+ config?: ValidateDateConfig
10
+ ) => boolean;
11
+
12
+ export type { ValidateDateFunction };
@@ -0,0 +1,3 @@
1
+ type ValidatePhoneFunction = (phone: string) => boolean;
2
+
3
+ export type { ValidatePhoneFunction };
@@ -1,7 +0,0 @@
1
- type CalculateCardInstallmentProps = {
2
- cash_price: number;
3
- number_installments: number;
4
- fees?: number;
5
- };
6
- export type { CalculateCardInstallmentProps };
7
- //# sourceMappingURL=CalculateCardInstallmentProps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CalculateCardInstallmentProps.d.ts","sourceRoot":"","sources":["../../src/shared/CalculateCardInstallmentProps.ts"],"names":[],"mappings":"AAAA,KAAK,6BAA6B,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- type FormatToHiddenDigitsOptions = {
2
- range?: number | [number, number];
3
- hider?: string;
4
- };
5
- export type { FormatToHiddenDigitsOptions };
6
- //# sourceMappingURL=FomartToHiddenDigitsOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FomartToHiddenDigitsOptions.d.ts","sourceRoot":"","sources":["../../src/shared/FomartToHiddenDigitsOptions.ts"],"names":[],"mappings":"AAAA,KAAK,2BAA2B,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
@@ -1,7 +0,0 @@
1
- type CalculateCardInstallmentProps = {
2
- cash_price: number;
3
- number_installments: number;
4
- fees?: number;
5
- };
6
-
7
- export type { CalculateCardInstallmentProps };
@@ -1,6 +0,0 @@
1
- type FormatToHiddenDigitsOptions = {
2
- range?: number | [number, number];
3
- hider?: string;
4
- };
5
-
6
- export type { FormatToHiddenDigitsOptions };