From 7643b3d8589a797efe553bf33be5cbb160fc793e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 14 Sep 2021 23:03:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20module=20exports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/forms/Form.stories.jsx | 2 +- src/hooks/{useValidatedState.ts => useFormState.ts} | 0 src/index.ts | 5 +++++ src/types.ts | 5 ----- 4 files changed, 6 insertions(+), 6 deletions(-) rename src/hooks/{useValidatedState.ts => useFormState.ts} (100%) diff --git a/src/components/forms/Form.stories.jsx b/src/components/forms/Form.stories.jsx index f974674..46f0213 100644 --- a/src/components/forms/Form.stories.jsx +++ b/src/components/forms/Form.stories.jsx @@ -12,7 +12,7 @@ import { FormCheckboxGroup } from "./FormCheckboxGroup" import { FormRow } from "./FormRow" import { Button } from "../inputs/Button" import { Parenthesis } from "../panels/Parenthesis" -import { useFormState } from "../../hooks/useValidatedState" +import { useFormState } from "../../hooks/useFormState" export default { diff --git a/src/hooks/useValidatedState.ts b/src/hooks/useFormState.ts similarity index 100% rename from src/hooks/useValidatedState.ts rename to src/hooks/useFormState.ts diff --git a/src/index.ts b/src/index.ts index 64cab0b..40804b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +import {BluelibHTMLProps, BluelibProps, ClassNames, State, Validator, Validity} from "./types"; + export {Ruby} from "./components/annotations/Ruby" export {Chapter} from "./components/chapters/Chapter" @@ -51,3 +53,6 @@ export {Table} from "./components/tables/Table" export {Bluelib} from "./components/Bluelib" export {Bluelib as default} from "./components/Bluelib" + +export {usePromise} from "./hooks/usePromise" +export {useFormState} from "./hooks/useFormState" diff --git a/src/types.ts b/src/types.ts index 664ea02..27d7a71 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,7 +7,6 @@ export type ClassNames = ClassNamesArgument export type State = [Value, React.Dispatch>] -export type StateContext = React.Context | undefined> export interface BluelibProps { @@ -20,9 +19,6 @@ export interface BluelibProps { export interface BluelibHTMLProps extends BluelibProps, React.HTMLProps {} -export type InputValue = readonly string[] | string | number | undefined - - /** * An optionally async function that checks if a value is acceptable for a certain form field or not. * @@ -41,4 +37,3 @@ export type Validator = (value: T, abort: AbortSignal) => Promise | * - `null` means that the value is in progress of being checked. */ export type Validity = boolean | null | undefined -