Skip to content

Commit

Permalink
Merge pull request #3 from chadrien/master
Browse files Browse the repository at this point in the history
Add some basic TypeScript typings
  • Loading branch information
jareware authored Aug 3, 2017
2 parents 85ba9f9 + e017e0e commit e25868f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare module 'css-ns' {
interface Options {
namespace: string;
prefix?: string;
include?: RegExp;
exclude?: RegExp;
self?: RegExp;
glue?: string;
React?: any;
}

type ClassMap = { [className: string]: boolean };
type ReactElement = any;

export interface NsFunction {
(classNames: string | any[] | ClassMap): string;
<T extends ReactElement>(reactElement: T): T;
}

export const createCssNs: (options: Options | string) => NsFunction;
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
"deploy-gh-pages": "git stash && npm run test-build && cp -r test temp && git checkout gh-pages && mv temp/* . && rm -rf temp && git commit -am 'Automatic gh-pages deploy' && git push origin gh-pages && git checkout -"
},
"author": "Jarno Rantanen <[email protected]>",
"license": "MIT"
"license": "MIT",
"types": "./index.d.ts"
}

0 comments on commit e25868f

Please sign in to comment.