jordanbyron / react-native-quick-actions

A react-native interface for Touch 3D home screen quick actions
MIT License
1.06k stars 93 forks source link

Provide TypeScript types to the project #77

Open bryantee opened 5 years ago

bryantee commented 5 years ago

Would be great if we got some static type checking out of the box. Granted this isn't a massive library, but anything helps. I can try and tackle this if it is of any value.

Somewhat related to #6 for adding Flow support.

jordanbyron commented 5 years ago

@bryantee I don't have a lot of exposure to typescript so I won't be much help in rolling it out. As long as whatever we do is backwards compatible I'm happy to review it. Thanks!

JonnyBurger commented 5 years ago

I installed the update with the TS definition file.

Two questions.. Is userInfo an optional property? Now I get a TS error because I did not specify userInfo property. Also, must it be of the shape {url: string} or can it be an arbitrary object?

cc @kevinhermawan

kevin-hyperjump commented 5 years ago

@JonnyBurger userInfo is required property and and the value can't an arbitrary object

JonnyBurger commented 5 years ago

@kevinhermawan Hmm, why does the comment say in the README

userInfo: {
   url: "app://orders" // Provide any custom data like deep linking URL
}

?