Closed TrySound closed 6 years ago
input
to field
in Form
/ allow to pass { target: { value: T } } | T
setValues
to Form
reset/resetState
to every componentdelete
clear
has
over
by set
{ [key]: T }
Corrected a bit
I heard about generation Flow from TS, or TS from Flow. It will be great to have a single source of types. PS: But https://github.com/joarwilk/flowgen doesn't work for me.
That's the point. Type systems are different. For example, typescript definitions exports all types even implementation details. This is not acceptable to me in flow where I carefully work with types as a part of api.
Generation will probably will work with generating definitions from less opinionated about javascript type systems like reason.
For example, typescript definitions exports all types even implementation details.
Just split d.ts into 2 files, and, while types will be still visible for compiler, they will not be a part of autocomplete stuff.
@theKashey I don't get, how omitting export
can make types invisible for compiler? I thought it's just some kind of convention "export everything and always".
original d.ts
export type InternalStuff = {}; // oh! exposed internals
export type CoolStuff = { value : InternalStuff } // I need only this!!!
🤔🤔🤔🤔🤔🤔🤔🤔🤔
internals.d.ts
export type InternalStuff = {};
original d.ts
import {InternalStuff} from './internals.d.ts'; // not exported!
export type CoolStuff = { value : InternalStuff }
Bingo!
That's basically how d.ts looks like if generated from TS files - scattered across original modules, providing the same "import" experience.
I don't get what's wrong with this.
type InternalStuff = {};
export type CoolStuff = { value : InternalStuff }
Why this tambourine dancing?
Anyway, I want to release new rc to test form component in my app. Would be good to update ts before that.
I don't get what's wrong with this.
Also have no idea why linting is against it. I'll try to update typing in my first free time slot.
I think you rushed a bit when you updated types.
Currently, not all components pass reset
and resetState
callbacks (i.e. Focus, Hover, maybe more)
But your typings say that they do: https://github.com/renatorib/react-powerplug/blob/v1.0.0/types/index.d.ts#L14
(because FocusRender has type of RenderFn, and RenderFn
extends SharedProps)
This is a mistake
There was a few changes and we need to upgrade typescript definitions.
Changes are in these commits https://github.com/renatorib/react-powerplug/commit/4cfb56f62c44ba92a4c4d0439ece95734726f163 https://github.com/renatorib/react-powerplug/commit/e747c261fa8d952ef2076077aa30a4a34ac7bff2 https://github.com/renatorib/react-powerplug/commit/1e6f5b0054af3d1acd380309cff1f611ab5fd34d https://github.com/renatorib/react-powerplug/commit/7cb56d02ade57e262d8b45c0f797560757f3f11d
/cc @theKashey @renatorib