seview icon indicating copy to clipboard operation
seview copied to clipboard

Please add typescript typings

Open kristianmandrup opened this issue 6 years ago • 3 comments

I think it would be something like this?

type element = object;

type transformFn = (node: any) => element;

export function sv(transform: transformFn, options: object): h;

type h = (tagname> string, props: Prop, children: element[] ) => element;

kristianmandrup avatar Feb 05 '19 13:02 kristianmandrup

@kristianmandrup best thing would be to submit a pull request.

foxdonut avatar Feb 06 '19 01:02 foxdonut

@foxdonut Sure, just wanted your input on the typings first.

Does it look more or less correct to you? Will need a little more experimentation I think. Guess the best way to find out is to write a small typescript sample app.

Do you know anyone using seview on typescript? I'm also in the process of writing a fable binding, so need to have the understanding of the types correct.

kristianmandrup avatar Feb 06 '19 09:02 kristianmandrup

I've just updated the above typings to more accurately reflect my current understanding of the API.

kristianmandrup avatar Feb 06 '19 09:02 kristianmandrup