Taiko: Add typescript bindings

Created on 9 Oct 2018  路  13Comments  路  Source: getgauge/taiko

Add typescript bindings to APIs so that the tests can be written in TypeScript as well.

feature

All 13 comments

@NivedhaSenthil Is there any ongoing efforts on the typings? I could take care of that.

@raynerpupo @negiDharmendra did some work related to this. But it's not complete.
Is it ok to wait for him to respond before picking it up? We definitely need help on this!

@zabil Sure, let's wait

@raynerpupo Our main focus was on some sort of automated ts binding generator so that we don't have to update them every time we introduce new API.

After some exploration found this library. Which do solve some of the problem but not all. As this library cannot figure out the data type of the API parameters and return value (IMO which is not simple to achieve). Without type information, defining ts binding would not be any help for the user.
You could use this library to generate bare minimal skeleton and make improvements on top of that.

I have already committed the generated ts binding definition file on this branch.

@negiDharmendra @zabil FYI I'm working in the typings, as soon as I have something, I'll push.

Hi @raynerpupo, any updates on this?

@negiDharmendra one idea is to use jsdoc to help generate d.ts files. I've found this lib that may help. Maybe that helps here.

We have introduced gauge-ts and taiko and need to support several Angular Teams who will start to write specs and step implementations in TypeScript shortly. Not having any type definitions available (and therefore no code completion in VS Code) brought some valid negative feedback.
So I sat down and wrote some draft typings that currently meet our demands for [email protected].
They are far from complete and I'd never call myself an expert on this, but it is workable for now.
If you're interested in Taiko Typescript Definitions, I'd like you to take a look here, and I'd love to hear what you think:
https://gist.github.com/nuclearglow/b883ce341a800ed958cb73ca10266aae

@nuclearglow The definitions which you have put as gist looks neat.
We would be happy to take a deeper look if create a PR for the same.

@BugDiver Thanks for reaching out :-) Sure, I'll see what I can do. It just might take a bit until I can go forward with this, I hope you understand.

Any update on TS bindings?

Typescript seems to have introduced new features to generate TS bindings for JSDoc.
Haven't tried this yet but this could be used on the taiko.js JSDoc comments.

https://devblogs.microsoft.com/typescript/announcing-typescript-3-7/#user-content---declaration-and--allowjs

I have created a PR with the typings, let's take this over there:
https://github.com/getgauge/taiko/pull/1125

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ariesZhou picture ariesZhou  路  5Comments

luciferankon picture luciferankon  路  7Comments

SrinivasanTarget picture SrinivasanTarget  路  5Comments

ghost picture ghost  路  6Comments

rmallof picture rmallof  路  8Comments