@real-router/validation-plugin 0.13.2 → 0.13.4
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/README.md +20 -2
- package/dist/cjs/index.d.ts +15 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.mts +15 -2
- package/dist/esm/index.d.mts.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import { PluginFactory } from "@real-router/core";
|
|
1
|
+
import { DefaultDependencies, PluginFactory } from "@real-router/core";
|
|
2
2
|
import { RouterValidator } from "@real-router/core/validation";
|
|
3
3
|
//#region src/validationPlugin.d.ts
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The dependency map is a type parameter so the factory carries the CALLER's
|
|
6
|
+
* `D` rather than the `object` default (#1621). `keyof object` is `never`, so a
|
|
7
|
+
* bare `PluginFactory` types `getDependency` as `(key: never) => never`, which
|
|
8
|
+
* TypeScript 7 refuses to assign where `PluginFactory<D>` is expected for any
|
|
9
|
+
* `D` with an index signature — `usePlugin(validationPlugin())` stops compiling
|
|
10
|
+
* for a consumer whose dependencies are `Record<string, T>`. TS 6 skipped that
|
|
11
|
+
* variance check, so the imprecision was always there and simply invisible.
|
|
12
|
+
*
|
|
13
|
+
* `PluginFactory<never>` does NOT work as a shorthand here (unlike
|
|
14
|
+
* `AnyOptions = Options<never>` in core): it fails on both compilers, because
|
|
15
|
+
* this plugin actually reads dependencies.
|
|
16
|
+
*/
|
|
17
|
+
declare function validationPlugin<Dependencies extends DefaultDependencies = DefaultDependencies>(): PluginFactory<Dependencies>;
|
|
5
18
|
//#endregion
|
|
6
19
|
export { type RouterValidator, validationPlugin };
|
|
7
20
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/esm/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/validationPlugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/validationPlugin.ts"],"mappings":";;;;;;;;;;;;;;;;iBAqVgB,iBACd,qBAAqB,sBAAsB,wBACxC,cAAc"}
|