diff --git a/package.json b/package.json index 0dafb91..2b13457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "regor", - "version": "1.3.1", + "version": "1.3.2", "description": "A modern UI framework for web and desktop applications, inspired by Vue's concepts and powered by simplicity and flexibility.", "author": "Ahmed Yasin Koculu", "license": "MIT", diff --git a/src/api/types.ts b/src/api/types.ts index 1910cd1..e0ac0fc 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -28,30 +28,29 @@ type RawTypes = | Promise | Error -declare const RefSymbol: unique symbol - declare const RawSymbol: unique symbol declare const ScopeSymbol: unique symbol -export type AnyRef = ( - newValue?: any, - eventSource?: any, -) => any & { [RefSymbol]: true } +type BivariantAnyRefCall = { + bivarianceHack(newValue?: unknown, eventSource?: unknown): unknown +}['bivarianceHack'] + +export type AnyRef = BivariantAnyRefCall export type Ref = (( newValue?: | RefContent | Ref> | SRef>, - eventSource?: any, + eventSource?: unknown, ) => RefContent) & { value: RefContent } export type SRef = (( newValue?: TValueType | SRef, - eventSource?: any, + eventSource?: unknown, ) => SRefContent) & { value: SRefContent } @@ -155,7 +154,7 @@ export type Flat = export type ObserveCallback = ( newValue: TValueType, - eventSource?: any, + eventSource?: unknown, ) => void export type StopObserving = () => void @@ -182,10 +181,10 @@ export interface Directive { /** Called on every value change. */ onChange?: ( el: HTMLElement, - values: any[], - previousValues?: any[], - option?: any, - previousOption?: any, + values: unknown[], + previousValues?: unknown[], + option?: unknown, + previousOption?: unknown, flags?: string[], ) => void @@ -339,7 +338,7 @@ export interface CreateComponentOptions< * The props defined in the props list can be used with :foo or r-bind:foo syntax. * `