Skip to content

Commit

Permalink
TypeScript type definitions (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirsky authored Jun 5, 2018
1 parent ef9137c commit 10bf38d
Show file tree
Hide file tree
Showing 4 changed files with 8,441 additions and 20 deletions.
14 changes: 14 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as ReactNative from "react-native";

declare module "react-native-size-matters" {

export function scale(size: number): number;
export function verticalScale(size: number): number;
export function moderateScale(size: number, factor?: number): number;

type NamedStyles<T> = { [P in keyof T]: ReactNative.ViewStyle | ReactNative.TextStyle | ReactNative.ImageStyle };

export namespace ScaledSheet {
export function create<T extends NamedStyles<T>>(stylesObject: T): { [P in keyof T]: ReactNative.RegisteredStyle<T[P]> };
}
}
Loading

0 comments on commit 10bf38d

Please sign in to comment.