Skip to content

Export un-exported types in TextField #2824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/textField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import {
FieldContextType,
TextFieldMethods,
TextFieldRef,
Validator
Validator,
ValidationMessagePositionType,
MandatoryIndication
} from './types';
import {shouldHidePlaceholder} from './Presenter';
import Input from './Input';
Expand Down Expand Up @@ -229,7 +231,9 @@ export {
TextFieldMethods,
TextFieldRef,
ValidationMessagePosition as TextFieldValidationMessagePosition,
Validator as TextFieldValidator
Validator as TextFieldValidator,
ValidationMessagePositionType as TextFieldValidationMessagePositionType,
MandatoryIndication as TextFieldMandatoryIndication
};
export default asBaseComponent<TextFieldProps, StaticMembers>(forwardRef(TextField as any), {
modifiersOptions: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/textField/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export enum ValidationMessagePosition {
BOTTOM = 'bottom'
}

type ValidationMessagePositionType = `${ValidationMessagePosition}` | ValidationMessagePosition;
export type ValidationMessagePositionType = `${ValidationMessagePosition}` | ValidationMessagePosition;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not enough to export them just here
You will also need to export them in the main TextField file and then also in the src/index


export type Validator = Function | keyof typeof formValidators;

Expand All @@ -54,7 +54,7 @@ export interface FieldStateProps extends InputProps {
onChangeValidity?: (isValid: boolean) => void;
}

interface MandatoryIndication {
export interface MandatoryIndication {
/**
* Whether to show a mandatory field indication.
*/
Expand Down
18 changes: 11 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ import * as Incubator from './incubator';
export {
ExpandableOverlayProps,
ExpandableOverlayMethods,
TextFieldProps,
TextFieldMethods,
TextFieldRef,
TextFieldValidationMessagePosition,
TextFieldValidator,
FieldContextType,
ToastProps,
ToastPresets,
PanViewProps,
Expand Down Expand Up @@ -163,7 +157,17 @@ export {
export {default as Text, TextProps} from './components/text';
// @ts-expect-error
export {default as TextArea} from './components/textArea';
export {default as TextField} from './components/textField';
export {
default as TextField,
TextFieldProps,
TextFieldMethods,
TextFieldRef,
TextFieldValidationMessagePosition,
TextFieldValidationMessagePositionType,
TextFieldMandatoryIndication,
TextFieldValidator,
FieldContextType
} from './components/textField';
// @ts-expect-error
export {default as Toast} from './components/toast';
export {default as TouchableOpacity, TouchableOpacityProps} from './components/touchableOpacity';
Expand Down