@groma/scanner-vue 0.2.3 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groma/scanner-vue",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Complementary Vue framework evidence; a dependency declaration does not verify runtime use.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  declare global {
2
- const __VLS_directiveBindingRestFields: { instance: null; oldValue: null; modifiers: any; dir: any };
2
+ const __VLS_directiveBindingRestFields: { instance: null; oldValue: null; value: null; modifiers: any; dir: any };
3
3
 
4
4
  type __VLS_Elements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
5
5
  type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
@@ -23,7 +23,7 @@ declare global {
23
23
  : {};
24
24
  type __VLS_ExtractComponentContext<T, K> = __VLS_PickNotAny<
25
25
  '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? NonNullable<Ctx> : never : any,
26
- T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
26
+ T extends (props: any, ctx: infer Ctx) => any ? (unknown extends Ctx ? any : Ctx) : any
27
27
  >;
28
28
  type __VLS_ExtractComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
29
29
  ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
@@ -47,12 +47,12 @@ declare global {
47
47
  type __VLS_ResolveEvent<
48
48
  Props,
49
49
  Emits,
50
- onEvent extends keyof Props,
51
- Event extends keyof Emits,
52
- CamelizedEvent extends keyof Emits,
53
- > = __VLS_IsFunction<Props, onEvent> extends true ? Props
54
- : __VLS_IsFunction<Emits, Event> extends true ? { [K in onEvent]?: Emits[Event] }
55
- : __VLS_IsFunction<Emits, CamelizedEvent> extends true ? { [K in onEvent]?: Emits[CamelizedEvent] }
50
+ onEvent extends string,
51
+ Event extends string,
52
+ CamelizedEvent extends string,
53
+ > = __VLS_IsFunction<Props, onEvent> extends true ? { [K in onEvent]?: Props[K & keyof Props] }
54
+ : __VLS_IsFunction<Emits, Event> extends true ? { [K in onEvent]?: Emits[Event & keyof Emits] }
55
+ : __VLS_IsFunction<Emits, CamelizedEvent> extends true ? { [K in onEvent]?: Emits[CamelizedEvent & keyof Emits] }
56
56
  : Props;
57
57
  // fix https://github.com/vuejs/language-tools/issues/926
58
58
  type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends
@@ -99,20 +99,37 @@ declare global {
99
99
  };
100
100
  type __VLS_PrettifyGlobal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
101
101
 
102
+ // Vue invokes hooks with all four args regardless of the declared arity
103
+ // make the generated 4-arg call legal for short hooks while their declared params stay checked.
104
+ type __VLS_IsRebuildable<A, B> = (<G>() => G extends A ? 1 : 2) extends (<G>() => G extends B ? 1 : 2) ? true : false;
105
+ type __VLS_PadDirectiveHook<F> = F extends (...args: infer A) => infer R
106
+ // full arity: nothing to pad
107
+ ? A extends [any, any, any, any, ...any[]] ? F
108
+ // losslessly rebuildable: pad with a trailing `any` rest
109
+ : __VLS_IsRebuildable<F, (...args: A) => R> extends true ? (...args: [...A, ...any[]]) => R
110
+ // not rebuildable (generic/overloaded): add a permissive overload for the call
111
+ : F & ((...args: any[]) => R)
112
+ : F;
113
+
102
114
  function __VLS_vFor<const T>(source: T): T extends number ? [number, number][]
103
115
  : T extends string ? [string, number][]
104
116
  : T extends readonly any[] ? (T extends readonly (infer U)[] ? [U, number] : never)[]
105
117
  : T extends Iterable<any> ? (T extends Iterable<infer V> ? [V, number] : never)[]
106
118
  : [T[keyof T], keyof T extends string ? keyof T : `${keyof T & (string | number)}`, number][];
107
119
  function __VLS_vSlot<S, D extends S>(slot: S, decl?: D): D extends (...args: infer P) => any ? P : any[];
120
+ function __VLS_nonNull<T>(value: T): NonNullable<T>;
108
121
  function __VLS_asFunctionalDirective<T, ObjectDirective>(
109
122
  dir: T,
110
123
  od: ObjectDirective,
111
- ): T extends ObjectDirective ? NonNullable<
112
- T[keyof T & ('created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted')]
113
- >
114
- : T extends (...args: any) => any ? T
115
- : (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
124
+ ): __VLS_PadDirectiveHook<
125
+ T extends ObjectDirective ? NonNullable<
126
+ T[
127
+ keyof T & ('created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted')
128
+ ]
129
+ >
130
+ : T extends (...args: any) => any ? T
131
+ : (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void
132
+ >;
116
133
  function __VLS_asFunctionalComponent0<T, K>(
117
134
  t: T,
118
135
  instance: K,
@@ -127,14 +144,31 @@ declare global {
127
144
  : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
128
145
  : T extends (...args: any) => any ? T
129
146
  : __VLS_FunctionalComponent<{}, Record<string, unknown>>;
147
+ type __VLS_PadArgs<A extends any[]> = A extends [any, ...infer Rest] ? [any, ...__VLS_PadArgs<Rest>] : [];
130
148
  function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(
131
149
  t: T,
132
- ): 2 extends Parameters<T>['length'] ? [any] : [];
150
+ ): __VLS_PadArgs<Parameters<T> extends [any, ...infer Rest] ? Rest : []>;
133
151
  function __VLS_asFunctionalElement0<T>(tag: T, endTag?: T): (attrs: T) => void;
134
152
  function __VLS_asFunctionalElement1<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
135
- function __VLS_asFunctionalSlot<S>(slot: S): S extends () => infer R ? (props: {}) => R : NonNullable<S>;
153
+ function __VLS_asFunctionalSlot<S>(
154
+ slot: S,
155
+ ): S extends (...args: any) => any ? (S extends () => infer R ? (props: {}) => R : S)
156
+ : (S extends null | undefined ? never : (props: S) => any);
136
157
  function __VLS_omit<T, K>(target: T, props: K): Omit<T, keyof K>;
137
158
  function __VLS_tryAsConstant<const T>(t: T): T;
159
+ // Rewrites the binding so codegen's appended `.value` resolves with the
160
+ // unwrapped type: a wholly-ref type stays as-is; anything else gains a
161
+ // `Ref` conjunct (passed by the caller — this file cannot import vue) that
162
+ // doubles as the idempotency marker for re-assertion. The tuple form keeps
163
+ // every branch assignable to `T` (TS2677); distributing the intersection
164
+ // would turn nullish union members into `never`.
165
+ function __VLS_withDotValue<T, Ref>(
166
+ t: T,
167
+ ref: Ref,
168
+ ): asserts t is [T] extends [Ref] ? T
169
+ : NonNullable<T> & Ref & { value: T extends Ref & { value: infer V } ? V : T };
170
+ function __VLS_unwrap<T, Ref>(t: T, ref: Ref): T extends Ref & { value: infer V } ? V
171
+ : T;
138
172
  }
139
173
 
140
174
  export {};
package/validation.md CHANGED
@@ -50,7 +50,7 @@ Scanner source/build/smoke lint and repository type checking passed.
50
50
  bun install --frozen-lockfile --ignore-scripts
51
51
  bun plugins/scanners/vue/build.ts
52
52
  bun test --timeout 20000 test-bun/vue-scanner.test.ts
53
- bunx biome lint plugins/scanners/vue/src plugins/scanners/vue/build.ts test-bun/vue-scanner.test.ts
53
+ bun run biome lint plugins/scanners/vue/src plugins/scanners/vue/build.ts test-bun/vue-scanner.test.ts
54
54
  bun run typecheck
55
55
  ```
56
56