@cfcs/react
Advanced tools
Comparing version 0.0.11 to 0.0.12
import { ReactiveAdapter, ReactiveEventParameters } from "@cfcs/core"; | ||
export declare type ReactReactiveEvents<Events extends Record<string, any>> = { | ||
export declare type ReactiveEvents<Events extends Record<string, any>> = { | ||
[key in keyof Events as `on${Capitalize<string & key>}`]: (effect: ((...args: ReactiveEventParameters<Events, key & string>) => void), deps?: readonly any[]) => void; | ||
}; | ||
export declare type ReactReactiveResult<Instance, State extends Record<string, any> = {}, Methods extends keyof Partial<Instance> = any, Events extends Record<string, any> = {}> = State & { | ||
export declare type ReactiveResult<Instance, State extends Record<string, any> = {}, Methods extends keyof Partial<Instance> = any, Events extends Record<string, any> = {}> = State & { | ||
[key in Methods]: Instance[key]; | ||
} & ReactReactiveEvents<Events>; | ||
export declare type ReactReactiveAdapterResult<Adapter extends ReactiveAdapter<any, any, any, any, any>> = Adapter extends ReactiveAdapter<infer Instance, infer State, infer Methods, any, infer Events> ? ReactReactiveResult<Instance, State, Methods, Events> : {}; | ||
} & ReactiveEvents<Events>; | ||
export declare type ReactiveAdapterResult<Adapter extends ReactiveAdapter<any, any, any, any, any>> = Adapter extends ReactiveAdapter<infer Instance, infer State, infer Methods, any, infer Events> ? ReactiveResult<Instance, State, Methods, Events> : {}; | ||
export declare type ReactReactiveEvents<Events extends Record<string, any>> = ReactiveEvents<Events>; | ||
export declare type ReactReactiveResult<Instance, State extends Record<string, any> = {}, Methods extends keyof Partial<Instance> = any, Events extends Record<string, any> = {}> = ReactiveResult<Instance, State, Methods, Events>; | ||
export declare type ReactReactiveAdapterResult<Adapter extends ReactiveAdapter<any, any, any, any, any>> = ReactiveAdapterResult<Adapter>; |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 0.0.11 | ||
version: 0.0.12 | ||
*/ | ||
@@ -10,0 +10,0 @@ 'use strict'; |
@@ -7,3 +7,3 @@ /* | ||
repository: https://github.com/naver/egjs-conveyer | ||
version: 0.0.11 | ||
version: 0.0.12 | ||
*/ | ||
@@ -10,0 +10,0 @@ import { adaptReactive, keys, camelize } from '@cfcs/core'; |
{ | ||
"name": "@cfcs/react", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Cross Framework Components", | ||
@@ -35,3 +35,3 @@ "main": "dist/cfcs.cjs.js", | ||
"dependencies": { | ||
"@cfcs/core": "~0.0.10" | ||
"@cfcs/core": "~0.0.12" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
import { ReactiveAdapter, ReactiveEventParameters } from "@cfcs/core"; | ||
export type ReactReactiveEvents< | ||
export type ReactiveEvents< | ||
Events extends Record<string, any> | ||
> = { | ||
> = { | ||
[key in keyof Events as `on${Capitalize<string & key>}`]: (effect: ((...args: ReactiveEventParameters<Events, key & string>) => void), deps?: readonly any[]) => void; | ||
}; | ||
export type ReactReactiveResult< | ||
export type ReactiveResult< | ||
Instance, | ||
@@ -14,8 +14,26 @@ State extends Record<string, any> = {}, | ||
Events extends Record<string, any> = {}, | ||
> = State & { [key in Methods]: Instance[key] } & ReactReactiveEvents<Events>; | ||
> = State & { [key in Methods]: Instance[key] } & ReactiveEvents<Events>; | ||
export type ReactReactiveAdapterResult< | ||
export type ReactiveAdapterResult< | ||
Adapter extends ReactiveAdapter<any, any, any, any, any>, | ||
> | ||
> | ||
= Adapter extends ReactiveAdapter<infer Instance, infer State, infer Methods, any, infer Events> | ||
? ReactReactiveResult<Instance, State, Methods, Events> : {}; | ||
? ReactiveResult<Instance, State, Methods, Events> : {}; | ||
// Names using framework prefix | ||
export type ReactReactiveEvents<Events extends Record<string, any>> = ReactiveEvents<Events>; | ||
export type ReactReactiveResult<Instance, | ||
State extends Record<string, any> = {}, | ||
Methods extends keyof Partial<Instance> = any, | ||
Events extends Record<string, any> = {}, | ||
> = ReactiveResult< | ||
Instance, | ||
State, | ||
Methods, | ||
Events | ||
>; | ||
export type ReactReactiveAdapterResult< | ||
Adapter extends ReactiveAdapter<any, any, any, any, any> | ||
> = ReactiveAdapterResult<Adapter>; |
@@ -17,5 +17,5 @@ import { ReactiveSubscribe, ReactiveAdapter, keys, camelize, adaptReactive } from "@cfcs/core"; | ||
const [states] = useState<Record<string, { | ||
getter: boolean, | ||
value: any, | ||
set: (value: any) => void, | ||
getter: boolean; | ||
value: any; | ||
set: (value: any) => void; | ||
}>>({}); | ||
@@ -22,0 +22,0 @@ for (const name in reactiveState) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23304
337
Updated@cfcs/core@~0.0.12