@elliemae/ds-props-helpers 2.2.0 → 2.3.0-alpha.3

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 (123) hide show
  1. package/cjs/defaultProps/index.js +28 -9
  2. package/cjs/defaultProps/index.js.map +7 -0
  3. package/cjs/defaultProps/useMemoMergePropsWithDefault.js +44 -44
  4. package/cjs/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  5. package/cjs/getProps/index.js +37 -20
  6. package/cjs/getProps/index.js.map +7 -0
  7. package/cjs/globalProps/constants.js +398 -0
  8. package/cjs/globalProps/constants.js.map +7 -0
  9. package/cjs/globalProps/globalAttributesPropTypes.js +398 -0
  10. package/cjs/globalProps/globalAttributesPropTypes.js.map +7 -0
  11. package/cjs/globalProps/index.js +29 -0
  12. package/cjs/globalProps/index.js.map +7 -0
  13. package/cjs/globalProps/useGetGlobalAttributes.js +56 -0
  14. package/cjs/globalProps/useGetGlobalAttributes.js.map +7 -0
  15. package/cjs/index.js +32 -20
  16. package/cjs/index.js.map +7 -0
  17. package/cjs/propTypes/PropTypes.js +136 -0
  18. package/cjs/propTypes/PropTypes.js.map +7 -0
  19. package/cjs/propTypes/customPropTypes.js +38 -0
  20. package/cjs/propTypes/customPropTypes.js.map +7 -0
  21. package/cjs/propTypes/describe.js +81 -0
  22. package/cjs/propTypes/describe.js.map +7 -0
  23. package/cjs/propTypes/describeConversions.js +96 -0
  24. package/cjs/propTypes/describeConversions.js.map +7 -0
  25. package/cjs/propTypes/describeGuards.js +49 -0
  26. package/cjs/propTypes/describeGuards.js.map +7 -0
  27. package/cjs/propTypes/index.js +37 -0
  28. package/cjs/propTypes/index.js.map +7 -0
  29. package/cjs/propTypes/toTypescript.js +139 -0
  30. package/cjs/propTypes/toTypescript.js.map +7 -0
  31. package/cjs/propTypes/types.js +27 -0
  32. package/cjs/propTypes/types.js.map +7 -0
  33. package/cjs/tests/globalProps/TestComponent.js +42 -0
  34. package/cjs/tests/globalProps/TestComponent.js.map +7 -0
  35. package/cjs/tests/validation/test.schema.js +67 -0
  36. package/cjs/tests/validation/test.schema.js.map +7 -0
  37. package/cjs/validation/errorTemplates.js +44 -12
  38. package/cjs/validation/errorTemplates.js.map +7 -0
  39. package/cjs/validation/index.js +30 -15
  40. package/cjs/validation/index.js.map +7 -0
  41. package/cjs/validation/typescriptGuards.js +60 -31
  42. package/cjs/validation/typescriptGuards.js.map +7 -0
  43. package/cjs/validation/typescriptParsers.js +65 -34
  44. package/cjs/validation/typescriptParsers.js.map +7 -0
  45. package/cjs/validation/typescriptValidator.js +99 -135
  46. package/cjs/validation/typescriptValidator.js.map +7 -0
  47. package/cjs/validation/validator.js +43 -24
  48. package/cjs/validation/validator.js.map +7 -0
  49. package/esm/defaultProps/index.js +3 -1
  50. package/esm/defaultProps/index.js.map +7 -0
  51. package/esm/defaultProps/useMemoMergePropsWithDefault.js +14 -34
  52. package/esm/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
  53. package/esm/getProps/index.js +8 -15
  54. package/esm/getProps/index.js.map +7 -0
  55. package/esm/globalProps/constants.js +369 -0
  56. package/esm/globalProps/constants.js.map +7 -0
  57. package/esm/globalProps/globalAttributesPropTypes.js +369 -0
  58. package/esm/globalProps/globalAttributesPropTypes.js.map +7 -0
  59. package/esm/globalProps/index.js +4 -0
  60. package/esm/globalProps/index.js.map +7 -0
  61. package/esm/globalProps/useGetGlobalAttributes.js +27 -0
  62. package/esm/globalProps/useGetGlobalAttributes.js.map +7 -0
  63. package/esm/index.js +7 -5
  64. package/esm/index.js.map +7 -0
  65. package/esm/propTypes/PropTypes.js +107 -0
  66. package/esm/propTypes/PropTypes.js.map +7 -0
  67. package/esm/propTypes/customPropTypes.js +9 -0
  68. package/esm/propTypes/customPropTypes.js.map +7 -0
  69. package/esm/propTypes/describe.js +52 -0
  70. package/esm/propTypes/describe.js.map +7 -0
  71. package/esm/propTypes/describeConversions.js +76 -0
  72. package/esm/propTypes/describeConversions.js.map +7 -0
  73. package/esm/propTypes/describeGuards.js +20 -0
  74. package/esm/propTypes/describeGuards.js.map +7 -0
  75. package/esm/propTypes/index.js +8 -0
  76. package/esm/propTypes/index.js.map +7 -0
  77. package/esm/propTypes/toTypescript.js +110 -0
  78. package/esm/propTypes/toTypescript.js.map +7 -0
  79. package/esm/propTypes/types.js +2 -0
  80. package/esm/propTypes/types.js.map +7 -0
  81. package/esm/tests/globalProps/TestComponent.js +13 -0
  82. package/esm/tests/globalProps/TestComponent.js.map +7 -0
  83. package/esm/tests/validation/test.schema.js +38 -0
  84. package/esm/tests/validation/test.schema.js.map +7 -0
  85. package/esm/validation/errorTemplates.js +15 -7
  86. package/esm/validation/errorTemplates.js.map +7 -0
  87. package/esm/validation/index.js +5 -3
  88. package/esm/validation/index.js.map +7 -0
  89. package/esm/validation/typescriptGuards.js +31 -18
  90. package/esm/validation/typescriptGuards.js.map +7 -0
  91. package/esm/validation/typescriptParsers.js +36 -30
  92. package/esm/validation/typescriptParsers.js.map +7 -0
  93. package/esm/validation/typescriptValidator.js +57 -106
  94. package/esm/validation/typescriptValidator.js.map +7 -0
  95. package/esm/validation/validator.js +12 -18
  96. package/esm/validation/validator.js.map +7 -0
  97. package/package.json +56 -4
  98. package/types/globalProps/constants.d.ts +3 -0
  99. package/types/globalProps/globalAttributesPropTypes.d.ts +363 -0
  100. package/types/globalProps/index.d.ts +2 -0
  101. package/types/globalProps/useGetGlobalAttributes.d.ts +5 -0
  102. package/types/index.d.ts +2 -0
  103. package/types/propTypes/PropTypes.d.ts +3 -0
  104. package/types/propTypes/customPropTypes.d.ts +2 -0
  105. package/types/propTypes/describe.d.ts +3 -0
  106. package/types/propTypes/describeConversions.d.ts +3 -0
  107. package/types/propTypes/describeGuards.d.ts +9 -0
  108. package/types/propTypes/index.d.ts +3 -0
  109. package/types/propTypes/toTypescript.d.ts +3 -0
  110. package/types/propTypes/types.d.ts +96 -0
  111. package/types/tests/globalProps/TestComponent.d.ts +1 -0
  112. package/types/tests/{any.validation.test.d.ts → globalProps/globalAttributes.test.d.ts} +0 -0
  113. package/types/tests/{array.validation.test.d.ts → validation/any.validation.test.d.ts} +0 -0
  114. package/types/tests/{boolean.validation.test.d.ts → validation/array.validation.test.d.ts} +0 -0
  115. package/types/tests/{function.validation.test.d.ts → validation/boolean.validation.test.d.ts} +0 -0
  116. package/types/tests/{number.validation.test.d.ts → validation/function.validation.test.d.ts} +0 -0
  117. package/types/tests/{object.validation.test.d.ts → validation/number.validation.test.d.ts} +0 -0
  118. package/types/tests/{schema.validation.test.d.ts → validation/object.validation.test.d.ts} +0 -0
  119. package/types/tests/{string.validation.test.d.ts → validation/schema.validation.test.d.ts} +0 -0
  120. package/types/tests/{union.validation.test.d.ts → validation/string.validation.test.d.ts} +0 -0
  121. package/types/tests/{test.schema.d.ts → validation/test.schema.d.ts} +0 -0
  122. package/types/tests/validation/union.validation.test.d.ts +1 -0
  123. package/types/validation/typescriptValidator.d.ts +2 -2
@@ -0,0 +1,136 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var PropTypes_exports = {};
29
+ __export(PropTypes_exports, {
30
+ default: () => PropTypes_default
31
+ });
32
+ var React = __toESM(require("react"));
33
+ const addPropTypeDocumentationField = (fieldName) => function addFieldToReactDesc(value) {
34
+ if (!this.reactDesc) {
35
+ this.reactDesc = {};
36
+ }
37
+ let realValue = value;
38
+ if (fieldName === "global" || fieldName === "hidden")
39
+ realValue = true;
40
+ this.reactDesc[fieldName] = realValue;
41
+ return this;
42
+ };
43
+ const documentedPropType = {
44
+ defaultValue: addPropTypeDocumentationField("defaultValue"),
45
+ description: addPropTypeDocumentationField("description"),
46
+ deprecated: addPropTypeDocumentationField("deprecated"),
47
+ format: addPropTypeDocumentationField("format"),
48
+ global: addPropTypeDocumentationField("global"),
49
+ hidden: addPropTypeDocumentationField("hidden")
50
+ };
51
+ const createPropType = (type) => {
52
+ const propTypeObj = {
53
+ type,
54
+ ...documentedPropType
55
+ };
56
+ Object.defineProperty(propTypeObj, "isRequired", {
57
+ get: function getRequired() {
58
+ if (!this.reactDesc) {
59
+ this.reactDesc = {};
60
+ }
61
+ this.reactDesc.required = true;
62
+ return this;
63
+ },
64
+ enumerable: true,
65
+ configurable: true
66
+ });
67
+ return propTypeObj;
68
+ };
69
+ const createPropTypeWithArgs = (type) => (args) => {
70
+ const propTypeObj = {
71
+ args,
72
+ type,
73
+ ...documentedPropType
74
+ };
75
+ Object.defineProperty(propTypeObj, "isRequired", {
76
+ get: function getRequired() {
77
+ if (!this.reactDesc) {
78
+ this.reactDesc = {};
79
+ }
80
+ this.reactDesc.required = true;
81
+ return this;
82
+ },
83
+ enumerable: true,
84
+ configurable: true
85
+ });
86
+ return propTypeObj;
87
+ };
88
+ const PropTypes = {
89
+ custom: (callback) => {
90
+ const target = callback.bind(null);
91
+ target.type = "func";
92
+ Object.keys(documentedPropType).forEach((fieldName) => {
93
+ const fieldNameCasted = fieldName;
94
+ target[fieldNameCasted] = documentedPropType[fieldNameCasted];
95
+ });
96
+ return target;
97
+ }
98
+ };
99
+ function definePropType(type) {
100
+ Object.defineProperty(PropTypes, type, {
101
+ get: function getPropType() {
102
+ return createPropType(type);
103
+ },
104
+ enumerable: true,
105
+ configurable: true
106
+ });
107
+ }
108
+ function definePropTypeWithArgs(type) {
109
+ Object.defineProperty(PropTypes, type, {
110
+ get: function getPropType() {
111
+ return createPropTypeWithArgs(type);
112
+ },
113
+ enumerable: true,
114
+ configurable: true
115
+ });
116
+ }
117
+ definePropType("any");
118
+ definePropType("array");
119
+ definePropType("bool");
120
+ definePropType("element");
121
+ definePropType("func");
122
+ definePropType("node");
123
+ definePropType("number");
124
+ definePropType("object");
125
+ definePropType("symbol");
126
+ definePropType("string");
127
+ definePropTypeWithArgs("arrayOf");
128
+ definePropTypeWithArgs("instanceOf");
129
+ definePropTypeWithArgs("objectOf");
130
+ definePropTypeWithArgs("oneOfType");
131
+ definePropTypeWithArgs("oneOf");
132
+ definePropTypeWithArgs("shape");
133
+ definePropTypeWithArgs("tuple");
134
+ var PropTypes_default = PropTypes;
135
+ module.exports = __toCommonJS(PropTypes_exports);
136
+ //# sourceMappingURL=PropTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/PropTypes.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { PropTypesTypes, DocumentedPropType, ReactDescObjT, PropTypesObj } from './types';\n\nconst addPropTypeDocumentationField = <T extends keyof ReactDescObjT>(fieldName: T) =>\n function addFieldToReactDesc(this: DocumentedPropType, value: ReactDescObjT[T]): DocumentedPropType {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n let realValue = value;\n if (fieldName === 'global' || fieldName === 'hidden') realValue = true;\n\n this.reactDesc[fieldName] = realValue;\n return this;\n };\n\nconst documentedPropType: Omit<DocumentedPropType, 'type' | 'isRequired' | 'reactDesc'> = {\n defaultValue: addPropTypeDocumentationField('defaultValue'),\n description: addPropTypeDocumentationField('description'),\n deprecated: addPropTypeDocumentationField('deprecated'),\n format: addPropTypeDocumentationField('format'),\n global: addPropTypeDocumentationField('global'),\n hidden: addPropTypeDocumentationField('hidden'),\n};\n\nconst createPropType = (type: PropTypesTypes) => {\n const propTypeObj = {\n type,\n ...documentedPropType,\n };\n Object.defineProperty(propTypeObj, 'isRequired', {\n get: function getRequired(this: DocumentedPropType) {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n this.reactDesc.required = true;\n return this;\n },\n enumerable: true,\n configurable: true,\n });\n\n return propTypeObj;\n};\n\nconst createPropTypeWithArgs = (type: PropTypesTypes) => (args: unknown) => {\n const propTypeObj = {\n args,\n type,\n ...documentedPropType,\n };\n Object.defineProperty(propTypeObj, 'isRequired', {\n get: function getRequired(this: DocumentedPropType) {\n if (!this.reactDesc) {\n this.reactDesc = {};\n }\n this.reactDesc.required = true;\n return this;\n },\n enumerable: true,\n configurable: true,\n });\n return propTypeObj;\n};\n\nconst PropTypes = {\n custom: (callback: CallableFunction) => {\n const target = callback.bind(null) as CallableFunction & DocumentedPropType;\n target.type = 'func';\n Object.keys(documentedPropType).forEach((fieldName) => {\n const fieldNameCasted = fieldName as keyof DocumentedPropType;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n (target[fieldNameCasted] as unknown) = documentedPropType[fieldNameCasted] as unknown;\n });\n return target;\n },\n} as unknown as PropTypesObj;\n\nfunction definePropType(type: PropTypesTypes) {\n Object.defineProperty(PropTypes, type, {\n get: function getPropType() {\n return createPropType(type);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\nfunction definePropTypeWithArgs(type: PropTypesTypes) {\n Object.defineProperty(PropTypes, type, {\n get: function getPropType() {\n return createPropTypeWithArgs(type);\n },\n enumerable: true,\n configurable: true,\n });\n}\n\ndefinePropType('any');\ndefinePropType('array');\ndefinePropType('bool');\ndefinePropType('element');\ndefinePropType('func');\ndefinePropType('node');\ndefinePropType('number');\ndefinePropType('object');\ndefinePropType('symbol');\ndefinePropType('string');\n\ndefinePropTypeWithArgs('arrayOf');\ndefinePropTypeWithArgs('instanceOf');\ndefinePropTypeWithArgs('objectOf');\ndefinePropTypeWithArgs('oneOfType');\ndefinePropTypeWithArgs('oneOf');\ndefinePropTypeWithArgs('shape');\ndefinePropTypeWithArgs('tuple');\n\nexport default PropTypes;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,MAAM,gCAAgC,CAAgC,cACpE,6BAAuD,OAA6C;AAClG,MAAI,CAAC,KAAK,WAAW;AACnB,SAAK,YAAY;AAAA;AAEnB,MAAI,YAAY;AAChB,MAAI,cAAc,YAAY,cAAc;AAAU,gBAAY;AAElE,OAAK,UAAU,aAAa;AAC5B,SAAO;AAAA;AAGX,MAAM,qBAAoF;AAAA,EACxF,cAAc,8BAA8B;AAAA,EAC5C,aAAa,8BAA8B;AAAA,EAC3C,YAAY,8BAA8B;AAAA,EAC1C,QAAQ,8BAA8B;AAAA,EACtC,QAAQ,8BAA8B;AAAA,EACtC,QAAQ,8BAA8B;AAAA;AAGxC,MAAM,iBAAiB,CAAC,SAAyB;AAC/C,QAAM,cAAc;AAAA,IAClB;AAAA,OACG;AAAA;AAEL,SAAO,eAAe,aAAa,cAAc;AAAA,IAC/C,KAAK,uBAA+C;AAClD,UAAI,CAAC,KAAK,WAAW;AACnB,aAAK,YAAY;AAAA;AAEnB,WAAK,UAAU,WAAW;AAC1B,aAAO;AAAA;AAAA,IAET,YAAY;AAAA,IACZ,cAAc;AAAA;AAGhB,SAAO;AAAA;AAGT,MAAM,yBAAyB,CAAC,SAAyB,CAAC,SAAkB;AAC1E,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,OACG;AAAA;AAEL,SAAO,eAAe,aAAa,cAAc;AAAA,IAC/C,KAAK,uBAA+C;AAClD,UAAI,CAAC,KAAK,WAAW;AACnB,aAAK,YAAY;AAAA;AAEnB,WAAK,UAAU,WAAW;AAC1B,aAAO;AAAA;AAAA,IAET,YAAY;AAAA,IACZ,cAAc;AAAA;AAEhB,SAAO;AAAA;AAGT,MAAM,YAAY;AAAA,EAChB,QAAQ,CAAC,aAA+B;AACtC,UAAM,SAAS,SAAS,KAAK;AAC7B,WAAO,OAAO;AACd,WAAO,KAAK,oBAAoB,QAAQ,CAAC,cAAc;AACrD,YAAM,kBAAkB;AAExB,MAAC,OAAO,mBAA+B,mBAAmB;AAAA;AAE5D,WAAO;AAAA;AAAA;AAIX,wBAAwB,MAAsB;AAC5C,SAAO,eAAe,WAAW,MAAM;AAAA,IACrC,KAAK,uBAAuB;AAC1B,aAAO,eAAe;AAAA;AAAA,IAExB,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAIlB,gCAAgC,MAAsB;AACpD,SAAO,eAAe,WAAW,MAAM;AAAA,IACrC,KAAK,uBAAuB;AAC1B,aAAO,uBAAuB;AAAA;AAAA,IAEhC,YAAY;AAAA,IACZ,cAAc;AAAA;AAAA;AAIlB,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AACf,eAAe;AAEf,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AAEvB,IAAO,oBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var customPropTypes_exports = {};
29
+ __export(customPropTypes_exports, {
30
+ tupleValidator: () => tupleValidator
31
+ });
32
+ var React = __toESM(require("react"));
33
+ const tupleValidator = (tupleShape) => {
34
+ const func = (value, index, ...rest) => tupleShape[index](value, index, ...rest);
35
+ return func;
36
+ };
37
+ module.exports = __toCommonJS(customPropTypes_exports);
38
+ //# sourceMappingURL=customPropTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/customPropTypes.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-params */\nimport { Validator } from 'prop-types';\n\nexport const tupleValidator = (tupleShape: Validator<unknown>[]): Validator<unknown> => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call\n const func: Validator<unknown> = (value, index, ...rest) =>\n tupleShape[index as unknown as number](value, index, ...rest);\n return func;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGhB,MAAM,iBAAiB,CAAC,eAAyD;AAEtF,QAAM,OAA2B,CAAC,OAAO,UAAU,SACjD,WAAW,OAA4B,OAAO,OAAO,GAAG;AAC1D,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,81 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var describe_exports = {};
29
+ __export(describe_exports, {
30
+ default: () => describe
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_describeConversions = require("./describeConversions");
34
+ var import_toTypescript = __toESM(require("./toTypescript"));
35
+ function describe(ComponentInstance) {
36
+ if (!ComponentInstance) {
37
+ throw new Error("react-desc: component is required");
38
+ }
39
+ const documentation = {
40
+ propTypes: {}
41
+ };
42
+ const DocumentedComponent = ComponentInstance;
43
+ const addDocumentationProp = (propName) => {
44
+ const func = (value) => {
45
+ documentation[propName] = value;
46
+ return DocumentedComponent;
47
+ };
48
+ return func;
49
+ };
50
+ DocumentedComponent.availableAt = addDocumentationProp("availableAt");
51
+ DocumentedComponent.description = addDocumentationProp("description");
52
+ DocumentedComponent.details = addDocumentationProp("details");
53
+ DocumentedComponent.deprecated = addDocumentationProp("deprecated");
54
+ DocumentedComponent.usage = addDocumentationProp("usage");
55
+ DocumentedComponent.intrinsicElement = addDocumentationProp("intrinsicElement");
56
+ DocumentedComponent.toTypescript = () => (0, import_toTypescript.default)(ComponentInstance, documentation);
57
+ Object.defineProperty(DocumentedComponent, "propTypes", {
58
+ get: () => DocumentedComponent.propTypesValue,
59
+ set: (value) => {
60
+ if (!DocumentedComponent.propTypesValue) {
61
+ DocumentedComponent.propTypesValue = {};
62
+ }
63
+ Object.keys(value).forEach((name) => {
64
+ const propType = value[name];
65
+ let realPropType;
66
+ documentation.propTypes[name] = propType;
67
+ realPropType = (0, import_describeConversions.convertPropType)(propType);
68
+ if (value[name].reactDesc.required) {
69
+ realPropType = realPropType.isRequired;
70
+ }
71
+ DocumentedComponent.propTypesValue[name] = realPropType;
72
+ return propType;
73
+ });
74
+ },
75
+ enumerable: true,
76
+ configurable: true
77
+ });
78
+ return DocumentedComponent;
79
+ }
80
+ module.exports = __toCommonJS(describe_exports);
81
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/describe.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable react/forbid-foreign-prop-types */\nimport { Requireable, Validator } from 'prop-types';\nimport React from 'react';\nimport { convertPropType } from './describeConversions';\nimport descToTypescript from './toTypescript';\nimport { ReactDescT, ComponentDocumentation, DocumentedReactComponent } from './types';\n\nexport default function describe<C>(ComponentInstance: React.ComponentType<C>) {\n if (!ComponentInstance) {\n throw new Error('react-desc: component is required');\n }\n\n const documentation: ComponentDocumentation = {\n propTypes: {},\n };\n\n const DocumentedComponent = ComponentInstance as DocumentedReactComponent<C>;\n\n const addDocumentationProp = <T extends keyof ComponentDocumentation>(propName: T) => {\n const func = (value: ComponentDocumentation[T]): DocumentedReactComponent<C> => {\n documentation[propName] = value;\n return DocumentedComponent;\n };\n return func;\n };\n\n DocumentedComponent.availableAt = addDocumentationProp('availableAt');\n DocumentedComponent.description = addDocumentationProp('description');\n DocumentedComponent.details = addDocumentationProp('details');\n DocumentedComponent.deprecated = addDocumentationProp('deprecated');\n DocumentedComponent.usage = addDocumentationProp('usage');\n DocumentedComponent.intrinsicElement = addDocumentationProp('intrinsicElement');\n\n DocumentedComponent.toTypescript = () => descToTypescript(ComponentInstance, documentation);\n\n Object.defineProperty(DocumentedComponent, 'propTypes', {\n get: () => DocumentedComponent.propTypesValue,\n set: (value: Record<string, ReactDescT>) => {\n if (!DocumentedComponent.propTypesValue) {\n DocumentedComponent.propTypesValue = {};\n }\n\n Object.keys(value).forEach((name) => {\n const propType: ReactDescT = value[name];\n let realPropType: Requireable<unknown> | Validator<unknown>;\n documentation.propTypes[name] = propType;\n realPropType = convertPropType(propType);\n if (value[name].reactDesc.required) {\n realPropType = (realPropType as Requireable<unknown>).isRequired;\n }\n DocumentedComponent.propTypesValue[name] = realPropType as Validator<unknown>;\n return propType;\n });\n },\n enumerable: true,\n configurable: true,\n });\n\n return DocumentedComponent;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,iCAAgC;AAChC,0BAA6B;AAGd,kBAAqB,mBAA2C;AAC7E,MAAI,CAAC,mBAAmB;AACtB,UAAM,IAAI,MAAM;AAAA;AAGlB,QAAM,gBAAwC;AAAA,IAC5C,WAAW;AAAA;AAGb,QAAM,sBAAsB;AAE5B,QAAM,uBAAuB,CAAyC,aAAgB;AACpF,UAAM,OAAO,CAAC,UAAkE;AAC9E,oBAAc,YAAY;AAC1B,aAAO;AAAA;AAET,WAAO;AAAA;AAGT,sBAAoB,cAAc,qBAAqB;AACvD,sBAAoB,cAAc,qBAAqB;AACvD,sBAAoB,UAAU,qBAAqB;AACnD,sBAAoB,aAAa,qBAAqB;AACtD,sBAAoB,QAAQ,qBAAqB;AACjD,sBAAoB,mBAAmB,qBAAqB;AAE5D,sBAAoB,eAAe,MAAM,iCAAiB,mBAAmB;AAE7E,SAAO,eAAe,qBAAqB,aAAa;AAAA,IACtD,KAAK,MAAM,oBAAoB;AAAA,IAC/B,KAAK,CAAC,UAAsC;AAC1C,UAAI,CAAC,oBAAoB,gBAAgB;AACvC,4BAAoB,iBAAiB;AAAA;AAGvC,aAAO,KAAK,OAAO,QAAQ,CAAC,SAAS;AACnC,cAAM,WAAuB,MAAM;AACnC,YAAI;AACJ,sBAAc,UAAU,QAAQ;AAChC,uBAAe,gDAAgB;AAC/B,YAAI,MAAM,MAAM,UAAU,UAAU;AAClC,yBAAgB,aAAsC;AAAA;AAExD,4BAAoB,eAAe,QAAQ;AAC3C,eAAO;AAAA;AAAA;AAAA,IAGX,YAAY;AAAA,IACZ,cAAc;AAAA;AAGhB,SAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,96 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var describeConversions_exports = {};
29
+ __export(describeConversions_exports, {
30
+ convertPropType: () => convertPropType
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_prop_types = __toESM(require("prop-types"));
34
+ var import_customPropTypes = require("./customPropTypes");
35
+ var import_describeGuards = require("./describeGuards");
36
+ const enrichPropType = (propType, reactDesc) => {
37
+ const func = (props, propName, componentName, ...rest) => {
38
+ if (reactDesc && reactDesc.deprecated && propName in props && !reactDesc.warned) {
39
+ const { version = "", message = "" } = reactDesc.deprecated;
40
+ const warning = `"${propName}" property of "${componentName}" will be deprecated on VERSION: ${version}.
41
+ ${message}`;
42
+ console.warn(warning);
43
+ reactDesc.warned = true;
44
+ }
45
+ return propType(props, propName, componentName, ...rest);
46
+ };
47
+ Object.defineProperty(func, "isRequired", Object.getOwnPropertyDescriptor(propType, "isRequired"));
48
+ return func;
49
+ };
50
+ const convertArray = (array) => array.map((type) => convertPropType(type));
51
+ const convertShape = (_shape) => {
52
+ const result = {};
53
+ Object.keys(_shape).forEach((key) => {
54
+ result[key] = convertPropType(_shape[key]);
55
+ });
56
+ return result;
57
+ };
58
+ const convertPropType = (propType) => {
59
+ if (!propType || !propType.type) {
60
+ throw new Error(`react-desc: unknown error -- proptype is not well defined`);
61
+ }
62
+ if (propType.type === "tuple") {
63
+ return enrichPropType(import_prop_types.default.arrayOf((0, import_customPropTypes.tupleValidator)(convertArray(propType.args))), propType.reactDesc);
64
+ }
65
+ const realPropType = import_prop_types.default[propType.type];
66
+ if (!realPropType) {
67
+ throw new Error(`react-desc: unknown type ${propType.type}`);
68
+ }
69
+ if ((0, import_describeGuards.hasArguments)(propType, realPropType)) {
70
+ if ((0, import_describeGuards.isOneOfType)(propType, realPropType)) {
71
+ return enrichPropType(realPropType(convertArray(propType.args)), propType.reactDesc);
72
+ }
73
+ if ((0, import_describeGuards.isArrayOf)(propType, realPropType)) {
74
+ return enrichPropType(realPropType(convertPropType(propType.args)), propType.reactDesc);
75
+ }
76
+ if ((0, import_describeGuards.isShape)(propType, realPropType)) {
77
+ return enrichPropType(realPropType(convertShape(propType.args)), propType.reactDesc);
78
+ }
79
+ if ((0, import_describeGuards.isInstanceOf)(propType, realPropType)) {
80
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
81
+ }
82
+ if ((0, import_describeGuards.isOneOf)(propType, realPropType)) {
83
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
84
+ }
85
+ if ((0, import_describeGuards.isObjectOf)(propType, realPropType)) {
86
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
87
+ }
88
+ if ((0, import_describeGuards.isExact)(propType, realPropType)) {
89
+ return enrichPropType(realPropType(propType.args), propType.reactDesc);
90
+ }
91
+ throw new Error(`react-desc: unknown error -- proptype with args is not matching`);
92
+ }
93
+ return enrichPropType(realPropType, propType.reactDesc);
94
+ };
95
+ module.exports = __toCommonJS(describeConversions_exports);
96
+ //# sourceMappingURL=describeConversions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/describeConversions.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-params */\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport PropTypes, { ValidationMap, Requireable } from 'prop-types';\nimport { tupleValidator } from './customPropTypes';\nimport {\n hasArguments,\n isArrayOf,\n isExact,\n isInstanceOf,\n isObjectOf,\n isOneOf,\n isOneOfType,\n isShape,\n} from './describeGuards';\nimport { ReactDescT, ReactDescObjT, InstanceOfT, OneOfT, ObjectOfT, ExactT } from './types';\n\nconst enrichPropType = (propType: Requireable<unknown>, reactDesc: ReactDescObjT): Requireable<unknown> => {\n const func = (props: Record<string, unknown>, propName: string, componentName: string, ...rest: [string, string]) => {\n if (reactDesc && reactDesc.deprecated && propName in props && !reactDesc.warned) {\n const { version = '', message = '' } = reactDesc.deprecated;\n const warning = `\"${propName}\" property of \"${componentName}\" will be deprecated on VERSION: ${version}.\\n${message}`;\n console.warn(warning);\n reactDesc.warned = true;\n }\n return propType(props, propName, componentName, ...rest);\n };\n Object.defineProperty(\n func,\n 'isRequired',\n Object.getOwnPropertyDescriptor(propType, 'isRequired') as PropertyDescriptor,\n );\n return func as Requireable<unknown>;\n};\n\nconst convertArray = (array: ReactDescT[]): Requireable<unknown>[] => array.map((type) => convertPropType(type));\n\nconst convertShape = (_shape: Record<string, ReactDescT>): ValidationMap<Record<string, unknown>> => {\n const result: ValidationMap<Record<string, unknown>> = {};\n Object.keys(_shape).forEach((key) => {\n result[key] = convertPropType(_shape[key]);\n });\n return result;\n};\n\nexport const convertPropType = (propType: ReactDescT): Requireable<unknown> => {\n if (!propType || !propType.type) {\n throw new Error(`react-desc: unknown error -- proptype is not well defined`);\n }\n\n // DimSum PropTypes conversion\n if (propType.type === 'tuple') {\n return enrichPropType(\n PropTypes.arrayOf(tupleValidator(convertArray(propType.args as ReactDescT[]))),\n propType.reactDesc,\n );\n }\n\n // Default PropType conversion\n const realPropType = PropTypes[propType.type];\n\n if (!realPropType) {\n throw new Error(`react-desc: unknown type ${propType.type}`);\n }\n\n if (hasArguments(propType, realPropType)) {\n if (isOneOfType(propType, realPropType)) {\n return enrichPropType(realPropType(convertArray(propType.args as ReactDescT[])), propType.reactDesc);\n }\n if (isArrayOf(propType, realPropType)) {\n return enrichPropType(realPropType(convertPropType(propType.args as ReactDescT)), propType.reactDesc);\n }\n if (isShape(propType, realPropType)) {\n return enrichPropType(\n realPropType(convertShape(propType.args as Record<string, ReactDescT>)),\n propType.reactDesc,\n );\n }\n if (isInstanceOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<InstanceOfT>[0]), propType.reactDesc);\n }\n if (isOneOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<OneOfT>[0]), propType.reactDesc);\n }\n if (isObjectOf(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ObjectOfT>[0]), propType.reactDesc);\n }\n if (isExact(propType, realPropType)) {\n return enrichPropType(realPropType(propType.args as Parameters<ExactT>[0]), propType.reactDesc);\n }\n throw new Error(`react-desc: unknown error -- proptype with args is not matching`);\n }\n\n return enrichPropType(realPropType, propType.reactDesc);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,wBAAsD;AACtD,6BAA+B;AAC/B,4BASO;AAGP,MAAM,iBAAiB,CAAC,UAAgC,cAAmD;AACzG,QAAM,OAAO,CAAC,OAAgC,UAAkB,kBAA0B,SAA2B;AACnH,QAAI,aAAa,UAAU,cAAc,YAAY,SAAS,CAAC,UAAU,QAAQ;AAC/E,YAAM,EAAE,UAAU,IAAI,UAAU,OAAO,UAAU;AACjD,YAAM,UAAU,IAAI,0BAA0B,iDAAiD;AAAA,EAAa;AAC5G,cAAQ,KAAK;AACb,gBAAU,SAAS;AAAA;AAErB,WAAO,SAAS,OAAO,UAAU,eAAe,GAAG;AAAA;AAErD,SAAO,eACL,MACA,cACA,OAAO,yBAAyB,UAAU;AAE5C,SAAO;AAAA;AAGT,MAAM,eAAe,CAAC,UAAgD,MAAM,IAAI,CAAC,SAAS,gBAAgB;AAE1G,MAAM,eAAe,CAAC,WAA+E;AACnG,QAAM,SAAiD;AACvD,SAAO,KAAK,QAAQ,QAAQ,CAAC,QAAQ;AACnC,WAAO,OAAO,gBAAgB,OAAO;AAAA;AAEvC,SAAO;AAAA;AAGF,MAAM,kBAAkB,CAAC,aAA+C;AAC7E,MAAI,CAAC,YAAY,CAAC,SAAS,MAAM;AAC/B,UAAM,IAAI,MAAM;AAAA;AAIlB,MAAI,SAAS,SAAS,SAAS;AAC7B,WAAO,eACL,0BAAU,QAAQ,2CAAe,aAAa,SAAS,SACvD,SAAS;AAAA;AAKb,QAAM,eAAe,0BAAU,SAAS;AAExC,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,4BAA4B,SAAS;AAAA;AAGvD,MAAI,wCAAa,UAAU,eAAe;AACxC,QAAI,uCAAY,UAAU,eAAe;AACvC,aAAO,eAAe,aAAa,aAAa,SAAS,QAAwB,SAAS;AAAA;AAE5F,QAAI,qCAAU,UAAU,eAAe;AACrC,aAAO,eAAe,aAAa,gBAAgB,SAAS,QAAsB,SAAS;AAAA;AAE7F,QAAI,mCAAQ,UAAU,eAAe;AACnC,aAAO,eACL,aAAa,aAAa,SAAS,QACnC,SAAS;AAAA;AAGb,QAAI,wCAAa,UAAU,eAAe;AACxC,aAAO,eAAe,aAAa,SAAS,OAAqC,SAAS;AAAA;AAE5F,QAAI,mCAAQ,UAAU,eAAe;AACnC,aAAO,eAAe,aAAa,SAAS,OAAgC,SAAS;AAAA;AAEvF,QAAI,sCAAW,UAAU,eAAe;AACtC,aAAO,eAAe,aAAa,SAAS,OAAmC,SAAS;AAAA;AAE1F,QAAI,mCAAQ,UAAU,eAAe;AACnC,aAAO,eAAe,aAAa,SAAS,OAAgC,SAAS;AAAA;AAEvF,UAAM,IAAI,MAAM;AAAA;AAGlB,SAAO,eAAe,cAAc,SAAS;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,49 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var describeGuards_exports = {};
29
+ __export(describeGuards_exports, {
30
+ hasArguments: () => hasArguments,
31
+ isArrayOf: () => isArrayOf,
32
+ isExact: () => isExact,
33
+ isInstanceOf: () => isInstanceOf,
34
+ isObjectOf: () => isObjectOf,
35
+ isOneOf: () => isOneOf,
36
+ isOneOfType: () => isOneOfType,
37
+ isShape: () => isShape
38
+ });
39
+ var React = __toESM(require("react"));
40
+ const hasArguments = (propType, realPropType) => !!propType.args;
41
+ const isOneOfType = (propType, realPropType) => propType.type === "oneOfType";
42
+ const isArrayOf = (propType, realPropType) => propType.type === "arrayOf";
43
+ const isShape = (propType, realPropType) => propType.type === "shape";
44
+ const isInstanceOf = (propType, realPropType) => propType.type === "instanceOf";
45
+ const isOneOf = (propType, realPropType) => propType.type === "oneOf";
46
+ const isObjectOf = (propType, realPropType) => propType.type === "objectOf";
47
+ const isExact = (propType, realPropType) => propType.type === "exact";
48
+ module.exports = __toCommonJS(describeGuards_exports);
49
+ //# sourceMappingURL=describeGuards.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/describeGuards.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import {\n AllPropTypes,\n ArrayOfT,\n ExactT,\n InstanceOfT,\n ObjectOfT,\n OneOfT,\n OneOfTypeT,\n ParametizedPropTypes,\n ReactDescT,\n ShapeT,\n} from './types';\n\nexport const hasArguments = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ParametizedPropTypes =>\n !!propType.args;\n\nexport const isOneOfType = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfTypeT =>\n propType.type === 'oneOfType';\n\nexport const isArrayOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ArrayOfT =>\n propType.type === 'arrayOf';\n\nexport const isShape = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ShapeT =>\n propType.type === 'shape';\n\nexport const isInstanceOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is InstanceOfT =>\n propType.type === 'instanceOf';\n\nexport const isOneOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is OneOfT =>\n propType.type === 'oneOf';\n\nexport const isObjectOf = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ObjectOfT =>\n propType.type === 'objectOf';\n\nexport const isExact = (propType: ReactDescT, realPropType: AllPropTypes): realPropType is ExactT =>\n propType.type === 'exact';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADahB,MAAM,eAAe,CAAC,UAAsB,iBACjD,CAAC,CAAC,SAAS;AAEN,MAAM,cAAc,CAAC,UAAsB,iBAChD,SAAS,SAAS;AAEb,MAAM,YAAY,CAAC,UAAsB,iBAC9C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,eAAe,CAAC,UAAsB,iBACjD,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;AAEb,MAAM,aAAa,CAAC,UAAsB,iBAC/C,SAAS,SAAS;AAEb,MAAM,UAAU,CAAC,UAAsB,iBAC5C,SAAS,SAAS;",
6
+ "names": []
7
+ }
@@ -0,0 +1,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var propTypes_exports = {};
29
+ __export(propTypes_exports, {
30
+ PropTypes: () => import_PropTypes.default,
31
+ describe: () => import_describe.default
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_PropTypes = __toESM(require("./PropTypes"));
35
+ var import_describe = __toESM(require("./describe"));
36
+ module.exports = __toCommonJS(propTypes_exports);
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/propTypes/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import PropTypes from './PropTypes';\nimport describe from './describe';\n\nexport { describe, PropTypes };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsB;AACtB,sBAAqB;",
6
+ "names": []
7
+ }