From 09ff5d1cb74cb7486485c8332efcfd68e759dc0f Mon Sep 17 00:00:00 2001 From: Tylerian Date: Fri, 18 Oct 2019 16:39:57 +0200 Subject: [PATCH] Prepare for release. --- out/types/context/styletron-consumer.d.ts | 8 ++++++-- out/types/context/styletron-context.d.ts | 9 ++++++--- out/types/context/styletron-provider.d.ts | 8 ++++++-- out/types/{utilities => hooks}/use-styletron-driver.d.ts | 0 out/types/{utilities => hooks}/use-styletron.d.ts | 0 out/types/index.d.ts | 7 +++---- out/types/utilities/get-atomic-provider.d.ts | 3 --- out/types/utilities/get-provider.d.ts | 6 ++++++ out/types/utilities/get-styletron-atomic.d.ts | 2 -- out/types/utilities/get-styletron-client.d.ts | 5 ----- out/types/utilities/get-styletron-server.d.ts | 5 ----- out/types/utilities/get-styletron.d.ts | 7 ++++++- out/types/utilities/with-styletron.d.ts | 5 +++++ package.json | 2 +- 14 files changed, 39 insertions(+), 28 deletions(-) rename out/types/{utilities => hooks}/use-styletron-driver.d.ts (100%) rename out/types/{utilities => hooks}/use-styletron.d.ts (100%) delete mode 100644 out/types/utilities/get-atomic-provider.d.ts delete mode 100644 out/types/utilities/get-styletron-atomic.d.ts delete mode 100644 out/types/utilities/get-styletron-client.d.ts delete mode 100644 out/types/utilities/get-styletron-server.d.ts diff --git a/out/types/context/styletron-consumer.d.ts b/out/types/context/styletron-consumer.d.ts index e45935f..f4dac3d 100644 --- a/out/types/context/styletron-consumer.d.ts +++ b/out/types/context/styletron-consumer.d.ts @@ -1,3 +1,7 @@ -/// -declare const StyletronConsumer: import("react").ExoticComponent>; +import { ReactChild } from "react"; +import { StandardEngine } from "styletron-standard"; +declare type StyletronConsumerProps = { + children: (engine: StandardEngine) => ReactChild | null; +}; +declare function StyletronConsumer(props: StyletronConsumerProps): JSX.Element; export { StyletronConsumer }; diff --git a/out/types/context/styletron-context.d.ts b/out/types/context/styletron-context.d.ts index 735c5e0..e1d368d 100644 --- a/out/types/context/styletron-context.d.ts +++ b/out/types/context/styletron-context.d.ts @@ -1,4 +1,7 @@ -/// +import { Context } from "react"; import { StandardEngine } from "styletron-standard"; -declare const StyletronContext: import("react").Context; -export { StyletronContext }; +declare type StyletronContextValue = { + engine?: StandardEngine; +}; +declare function getStyletronContext(): Context; +export { getStyletronContext }; diff --git a/out/types/context/styletron-provider.d.ts b/out/types/context/styletron-provider.d.ts index 0903fd1..00833e7 100644 --- a/out/types/context/styletron-provider.d.ts +++ b/out/types/context/styletron-provider.d.ts @@ -1,3 +1,7 @@ -/// -declare const StyletronProvider: import("react").ProviderExoticComponent>; +import { PropsWithChildren } from "react"; +import { StandardEngine } from 'styletron-standard'; +declare type StyletronProviderProps = PropsWithChildren<{ + engine: StandardEngine; +}>; +declare function StyletronProvider(props: StyletronProviderProps): JSX.Element; export { StyletronProvider }; diff --git a/out/types/utilities/use-styletron-driver.d.ts b/out/types/hooks/use-styletron-driver.d.ts similarity index 100% rename from out/types/utilities/use-styletron-driver.d.ts rename to out/types/hooks/use-styletron-driver.d.ts diff --git a/out/types/utilities/use-styletron.d.ts b/out/types/hooks/use-styletron.d.ts similarity index 100% rename from out/types/utilities/use-styletron.d.ts rename to out/types/hooks/use-styletron.d.ts diff --git a/out/types/index.d.ts b/out/types/index.d.ts index 10e6ee2..bedb6da 100644 --- a/out/types/index.d.ts +++ b/out/types/index.d.ts @@ -1,10 +1,9 @@ -import { StyletronContext } from "./context/styletron-context"; import { StyletronConsumer } from "./context/styletron-consumer"; import { StyletronProvider } from "./context/styletron-provider"; import { StyletronAtomicEngineProvider, DEFAULT_STYLETRON_HYDRATE_QUERY_SELECTOR } from "./providers/styletron-atomic-engine-provider"; import { getAtomicProvider } from "./utilities/get-provider"; import { getStyletronClient, getStyletronServer } from "./utilities/get-styletron"; -import { useStyletron } from "./utilities/use-styletron"; -import { useStyletronDriver } from "./utilities/use-styletron-driver"; +import { useStyletron } from "./hooks/use-styletron"; +import { useStyletronDriver } from "./hooks/use-styletron-driver"; import { withStyletron } from "./utilities/with-styletron"; -export { StyletronContext, StyletronConsumer, StyletronProvider, getAtomicProvider, getStyletronClient, getStyletronServer, useStyletron, useStyletronDriver, withStyletron, StyletronAtomicEngineProvider, DEFAULT_STYLETRON_HYDRATE_QUERY_SELECTOR }; +export { StyletronConsumer, StyletronProvider, getAtomicProvider, getStyletronClient, getStyletronServer, useStyletron, useStyletronDriver, withStyletron, StyletronAtomicEngineProvider, DEFAULT_STYLETRON_HYDRATE_QUERY_SELECTOR }; diff --git a/out/types/utilities/get-atomic-provider.d.ts b/out/types/utilities/get-atomic-provider.d.ts deleted file mode 100644 index d574a2e..0000000 --- a/out/types/utilities/get-atomic-provider.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StyletronAtomicEngineProvider, StyletronAtomicEngineProviderOptions } from "../providers/styletron-atomic-engine-provider"; -declare function getAtomicProvider(options?: StyletronAtomicEngineProviderOptions): StyletronAtomicEngineProvider; -export { getAtomicProvider }; diff --git a/out/types/utilities/get-provider.d.ts b/out/types/utilities/get-provider.d.ts index d574a2e..9e5c411 100644 --- a/out/types/utilities/get-provider.d.ts +++ b/out/types/utilities/get-provider.d.ts @@ -1,3 +1,9 @@ import { StyletronAtomicEngineProvider, StyletronAtomicEngineProviderOptions } from "../providers/styletron-atomic-engine-provider"; +/** + * Return a new instance of a StyletronEngineProvider + * based on StyletronAtomic as its backing engine. + * + * @param options StyletronAtomicEngine configuration options. + */ declare function getAtomicProvider(options?: StyletronAtomicEngineProviderOptions): StyletronAtomicEngineProvider; export { getAtomicProvider }; diff --git a/out/types/utilities/get-styletron-atomic.d.ts b/out/types/utilities/get-styletron-atomic.d.ts deleted file mode 100644 index e0ba387..0000000 --- a/out/types/utilities/get-styletron-atomic.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function getStyletronAtomic(): import("styletron-engine-atomic").Client | import("styletron-engine-atomic").Server; -export { getStyletronAtomic }; diff --git a/out/types/utilities/get-styletron-client.d.ts b/out/types/utilities/get-styletron-client.d.ts deleted file mode 100644 index 16ad738..0000000 --- a/out/types/utilities/get-styletron-client.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Return a new instance of a styletron client with preset defaults. - */ -declare function getStyletronClient(): import("styletron-engine-atomic").Client; -export { getStyletronClient }; diff --git a/out/types/utilities/get-styletron-server.d.ts b/out/types/utilities/get-styletron-server.d.ts deleted file mode 100644 index 11cae2a..0000000 --- a/out/types/utilities/get-styletron-server.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Return a new instance of a styletron server with preset defaults. - */ -declare function getStyletronServer(): import("styletron-engine-atomic").Server; -export { getStyletronServer }; diff --git a/out/types/utilities/get-styletron.d.ts b/out/types/utilities/get-styletron.d.ts index f583942..93f3435 100644 --- a/out/types/utilities/get-styletron.d.ts +++ b/out/types/utilities/get-styletron.d.ts @@ -1,3 +1,8 @@ +/** + * Return a new instance of a styletron client if ran client-side, + * or a new instance of a styletron server if ran server-side. + */ +declare function getStyletron(): import("styletron-engine-atomic").Client | import("styletron-engine-atomic").Server; /** * Return a new instance of a styletron client with preset defaults. */ @@ -6,4 +11,4 @@ declare function getStyletronClient(): import("styletron-engine-atomic").Client; * Return a new instance of a styletron server with preset defaults. */ declare function getStyletronServer(): import("styletron-engine-atomic").Server; -export { getStyletronClient, getStyletronServer }; +export { getStyletron, getStyletronClient, getStyletronServer }; diff --git a/out/types/utilities/with-styletron.d.ts b/out/types/utilities/with-styletron.d.ts index 937f10b..d054ebe 100644 --- a/out/types/utilities/with-styletron.d.ts +++ b/out/types/utilities/with-styletron.d.ts @@ -1,3 +1,8 @@ /// +/** + * Passes an styletron instance down the component tree. + * + * @param Component A react component to pass styletron. + */ declare const withStyletron: (Component: any) => (props: any) => JSX.Element; export { withStyletron }; diff --git a/package.json b/package.json index c43c824..63ceaa7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "styletron-react-lite", - "version": "2.1.2", + "version": "2.1.3", "description": "A lightweight styletron binding for React.", "main": "out/styletron-react-lite.cjs.js", "module": "out/styletron-react-lite.esm.js",