Skip to content

Commit

Permalink
Add some basic TypeScript typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien de Cuzey committed Aug 2, 2017
1 parent 85ba9f9 commit e017e0e
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 e017e0e

Please sign in to comment.