From 533f14207e70edd6f744fecdc77930d887f6ee15 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 2 Jan 2020 16:57:33 -0800 Subject: [PATCH] Add context and hooks (#41200) --- types/react-with-styles/OTHER_FILES.txt | 4 +++- types/react-with-styles/lib/WithStylesContext.d.ts | 4 ++++ types/react-with-styles/lib/hooks/useStyles.d.ts | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 types/react-with-styles/lib/WithStylesContext.d.ts create mode 100644 types/react-with-styles/lib/hooks/useStyles.d.ts diff --git a/types/react-with-styles/OTHER_FILES.txt b/types/react-with-styles/OTHER_FILES.txt index 72e435e85a..f74bbe2666 100644 --- a/types/react-with-styles/OTHER_FILES.txt +++ b/types/react-with-styles/OTHER_FILES.txt @@ -1 +1,3 @@ -lib/ThemedStyleSheet.d.ts \ No newline at end of file +lib/ThemedStyleSheet.d.ts +lib/WithStylesContext.d.ts +lib/hooks/useStyles.d.ts \ No newline at end of file diff --git a/types/react-with-styles/lib/WithStylesContext.d.ts b/types/react-with-styles/lib/WithStylesContext.d.ts new file mode 100644 index 0000000000..2a39a26254 --- /dev/null +++ b/types/react-with-styles/lib/WithStylesContext.d.ts @@ -0,0 +1,4 @@ +import { Context } from "react"; + +declare const context: Context<{ stylesInterface: any, stylesTheme: any }>; +export default context; \ No newline at end of file diff --git a/types/react-with-styles/lib/hooks/useStyles.d.ts b/types/react-with-styles/lib/hooks/useStyles.d.ts new file mode 100644 index 0000000000..96c755d17b --- /dev/null +++ b/types/react-with-styles/lib/hooks/useStyles.d.ts @@ -0,0 +1,8 @@ +import { Styles } from "../../index"; + +declare function useStyles({ stylesFn }: { stylesFn: (...args: any[]) => TStyles }): { + css: Function; + styles: TStyles; +} + +export default useStyles; \ No newline at end of file