xenopomp-essentials 0.1.3-rc.7 → 0.2.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 (3) hide show
  1. package/index.d.mts +26 -2
  2. package/index.d.ts +26 -2
  3. package/package.json +4 -7
package/index.d.mts CHANGED
@@ -121,6 +121,10 @@ type SetState<TType> = Dispatch<SetStateAction<TType>>;
121
121
  */
122
122
  type FunctionalChildren<Args extends any[]> = ReactNode | ((...args: Args) => ReactNode);
123
123
 
124
+ /**
125
+ * @deprecated use {@link FCProps} instead.
126
+ */
127
+ type FcProps<Comp> = FCProps<Comp>;
124
128
  /**
125
129
  * Extracts type of props from FC type.
126
130
  *
@@ -132,13 +136,33 @@ type FunctionalChildren<Args extends any[]> = ReactNode | ((...args: Args) => Re
132
136
  * type VariableProps = FcProps<VariableFC<'button', { notAlign?: boolean }>>;
133
137
  * // ^? {notAlign?: boolean} & Omit<ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, undefined>
134
138
  */
135
- type FcProps<Comp> = Comp extends FC<infer Props> ? Props : never;
139
+ type FCProps<Comp> = Comp extends FC<infer Props> ? Props : never;
136
140
 
137
141
  /**
138
142
  * Matches any proper React component.
139
143
  */
140
144
  type AnyFC = FC<unknown>;
141
145
 
146
+ /**
147
+ * Type that represents data-{attr} keys.
148
+ */
149
+ type Attribute = `data-${string}`;
150
+ /**
151
+ * Matches any proper data-{attr} keys.
152
+ */
153
+ type DataAttributeShape = Record<Attribute, any>;
154
+ /**
155
+ * Represents React`s data-{attr} properties for components.
156
+ *
157
+ * @example
158
+ * type AdditionalAttributes = DataAttributes<{ 'data-disabled': boolean }>;
159
+ *
160
+ * const attrs: AdditionalAttributes = {
161
+ * 'data-disabled': false, // this attr is required
162
+ * };
163
+ */
164
+ type DataAttributes<Shape extends DataAttributeShape> = Shape;
165
+
142
166
  /**
143
167
  * Make any async func synchronous.
144
168
  *
@@ -566,4 +590,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
566
590
  */
567
591
  declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<any>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
568
592
 
569
- export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
593
+ export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DataAttributes, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FCProps, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
package/index.d.ts CHANGED
@@ -121,6 +121,10 @@ type SetState<TType> = Dispatch<SetStateAction<TType>>;
121
121
  */
122
122
  type FunctionalChildren<Args extends any[]> = ReactNode | ((...args: Args) => ReactNode);
123
123
 
124
+ /**
125
+ * @deprecated use {@link FCProps} instead.
126
+ */
127
+ type FcProps<Comp> = FCProps<Comp>;
124
128
  /**
125
129
  * Extracts type of props from FC type.
126
130
  *
@@ -132,13 +136,33 @@ type FunctionalChildren<Args extends any[]> = ReactNode | ((...args: Args) => Re
132
136
  * type VariableProps = FcProps<VariableFC<'button', { notAlign?: boolean }>>;
133
137
  * // ^? {notAlign?: boolean} & Omit<ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, undefined>
134
138
  */
135
- type FcProps<Comp> = Comp extends FC<infer Props> ? Props : never;
139
+ type FCProps<Comp> = Comp extends FC<infer Props> ? Props : never;
136
140
 
137
141
  /**
138
142
  * Matches any proper React component.
139
143
  */
140
144
  type AnyFC = FC<unknown>;
141
145
 
146
+ /**
147
+ * Type that represents data-{attr} keys.
148
+ */
149
+ type Attribute = `data-${string}`;
150
+ /**
151
+ * Matches any proper data-{attr} keys.
152
+ */
153
+ type DataAttributeShape = Record<Attribute, any>;
154
+ /**
155
+ * Represents React`s data-{attr} properties for components.
156
+ *
157
+ * @example
158
+ * type AdditionalAttributes = DataAttributes<{ 'data-disabled': boolean }>;
159
+ *
160
+ * const attrs: AdditionalAttributes = {
161
+ * 'data-disabled': false, // this attr is required
162
+ * };
163
+ */
164
+ type DataAttributes<Shape extends DataAttributeShape> = Shape;
165
+
142
166
  /**
143
167
  * Make any async func synchronous.
144
168
  *
@@ -566,4 +590,4 @@ declare const minmax: (num: number, [min, max]: [min: number | undefined, max: n
566
590
  */
567
591
  declare function jsxDotNotation<Props = EmptyObject, Rest extends Record<string, FC<any>> = EmptyObject>(comp: FC<Props>, rest: Rest): FC<Props> & Rest;
568
592
 
569
- export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
593
+ export { type AnyFC, type AnyObject, type ArrayItemType, type ArrayType, type AsyncFC, type AsyncReturnType, type AsyncVariableFC, type DataAttributes, type DeepInject, type DeepWriteable, type Defined, type EmptyObject, type FCProps, type FcProps, type Fn, type FunctionalChildren, type Jsonish, type Lenient, type LenientAutocomplete, type MatchType, type MergeTypes, type Modify, type NextErrorParams, type NextParams, type NextSearchParams, type Nullable, type OneOf, type OnlyFirst, type Preid, type RecordKey, type RecordValue, type ReplaceReturnType, type SelectivePartial, type SetState, type StrictOmit, type Synchronous, type Undefinable, type VariableFC, type VersionData, type WeakOmit, type Writeable, capitalize, jsxDotNotation, minmax, parseVersion, pipe, transliterate, uncapitalize };
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "xenopomp-essentials",
3
- "version": "0.1.3-rc.7",
3
+ "version": "0.2.1",
4
4
  "author": "XenoPOMP <101574433+XenoPOMP@users.noreply.github.com>",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "private": false,
8
- "publishConfig": {
9
- "tag": "rc"
10
- },
11
8
  "repository": {
12
9
  "type": "git",
13
10
  "url": "https://github.com/XenoPOMP/xenopomp-essentials-js.git"
@@ -33,7 +30,7 @@
33
30
  "eslint": "^9",
34
31
  "eslint-config-prettier": ">=10.1.1",
35
32
  "eslint-plugin-prettier": ">=5.2.3",
36
- "next": ">=15.2.4",
33
+ "next": "^15.4.7",
37
34
  "react": ">=19",
38
35
  "react-dom": ">=19",
39
36
  "type-fest": ">=4",
@@ -49,7 +46,7 @@
49
46
  "eslint-config-prettier": "^10.1.1",
50
47
  "eslint-plugin-prettier": "^5.2.3",
51
48
  "globals": "^16.0.0",
52
- "next": "^15.2.4",
49
+ "next": "^15.4.7",
53
50
  "react": "^19.0.0",
54
51
  "transliteration": "^2.3.5",
55
52
  "type-fest": "^4.33.0",
@@ -62,7 +59,7 @@
62
59
  "@testing-library/react": "^16.2.0",
63
60
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",
64
61
  "@vitejs/plugin-react": "^4.3.4",
65
- "@vitest/coverage-istanbul": "^3.0.4",
62
+ "@vitest/coverage-istanbul": "^3.2.4",
66
63
  "eslint-plugin-react-hooks": "^5.2.0",
67
64
  "eslint-plugin-react-refresh": "^0.4.19",
68
65
  "esno": "^4.8.0",