Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Typescript definitions and included in package #258

Closed
wants to merge 3 commits into from

Conversation

upta
Copy link

@upta upta commented Jul 18, 2017

It seems that DefinitelyTyped/DefinitelyTyped#12845 kinda died on the vine.

So, I took the .d.ts file from that PR, tweaked it a little bit by:

  • adding an overload to "create" (makes intellisense a bit happier in the default case)
  • changing the parameter type for "css" to model after the Flow type (instead of just "any")

Since you can just include a .d.ts file in your package.json and Typescript will pick it up, I figured that would be the lowest friction distribution method, if you're cool with that.

It seems that DefinitelyTyped/DefinitelyTyped#12845 kinda died on the vine.

So, I took the .d.ts file from that PR, tweaked it a little bit by:
*  adding an overload to "create" (makes intellisense a bit happier in the default case)
*  changing the parameter type for "css" to model after the Flow type (instead of just "any")

Since you can just include a .d.ts file in your package.json and Typescript will pick it up, I figured that would be the lowest friction distribution method, if you're cool with that.
@khanbot
Copy link

khanbot commented Jul 18, 2017

Hey @upta,

Thanks for the PR! Mind signing our Contributor License Agreement?

When you've done so, go ahead and comment [clabot:check] and I'll check again.

Yours truly,
khanbot

@upta
Copy link
Author

upta commented Jul 18, 2017

[clabot:check]

@khanbot
Copy link

khanbot commented Jul 18, 2017

CLA signature looks good 👍

@abruzzihraig
Copy link

Hi @upta , I've tried your declaration file, but it doesn't work for aphrodite/no-important. If I use it like import { StyleSheet, css } from 'aphrodite/no-important';, there would be an error Could not find a declaration file for moudle 'aphrodite/no-important'

@upta
Copy link
Author

upta commented Jul 24, 2017

I'll take a look at it. I never tried it with the no-import since it mostly wasn't my file to start with, just tweaked a few things and added it to the package.json :)

@upta
Copy link
Author

upta commented Jul 24, 2017

@abruzzihraig I updated the PR, no-important was working for me, let me know if it behaves better for you now. Thanks!

@abruzzihraig
Copy link

@upta thanks bro, it works fine!

@screendriver
Copy link

Any plans to merge this PR?

// Project: https://github.com/Khan/aphrodite

declare module "aphrodite" {
import * as React from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using TypeScript & Aphrodite for a side project, and had to use my own copy because I'm using Aphrodite but not react -- can you remove this, since Aphrodite doesn't have a dependency on React? As an initial pass, it should be fine to just replace React.CSSProperties with any.

@jlfwong
Copy link
Collaborator

jlfwong commented Jan 15, 2018

@upta Let me know if you'd still like to merge this and get credit, otherwise I'm happy to take this over and get it landed

@najamkhn
Copy link

I get the following error when I'm trying to using aphrodite:

'css' is declared but its value is never read.

Is this pull request fixing it as well?

@upta
Copy link
Author

upta commented Jan 23, 2018

@jlfwong Hey, sorry, I totally forgot you had pinged me until today's notification came in ;) Feel free to take over, I was just experimenting with aphrodite at the time and figured I'd see if I could help out

dmiller9911 added a commit to dmiller9911/aphrodite that referenced this pull request Feb 21, 2018
Replaces Khan#258 since the contributor has asked for someone else to take over.

* Provides intellisense for propteries in StyleSheet.Create
* Provides type safety for fonts
* updated to include new minify function and StyleSheetTestUtils.getBufferedStyles
* Removed dependency on React.CSSProperties typings by pulling in typings from glamorous, and editing to match Aphrodite.
dmiller9911 added a commit to dmiller9911/aphrodite that referenced this pull request Mar 2, 2018
Replaces Khan#258 since the contributor has asked for someone else to take over.

* Provides intellisense for propteries in StyleSheet.Create
* Provides type safety for fonts
* updated to include new minify function and StyleSheetTestUtils.getBufferedStyles
* Removed dependency on React.CSSProperties typings by pulling in typings from glamorous, and editing to match Aphrodite.
@lencioni
Copy link
Collaborator

lencioni commented Mar 4, 2018

I believe this has been accomplished by #302

@lencioni lencioni closed this Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants