@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
33 lines (32 loc) • 1.19 kB
TypeScript
/**
* MSKCC DSM 2021, 2023
*/
import PropTypes from 'prop-types';
import { ReactNode } from 'react';
export type TextDir = 'ltr' | 'rtl' | 'auto';
export type GetTextDirection = (text: string | string[] | undefined) => TextDir;
export interface TextDirectionProps {
children: ReactNode | undefined;
dir?: TextDir;
getTextDirection?: GetTextDirection;
}
declare function TextDirection({ children, dir, getTextDirection, }: TextDirectionProps): JSX.Element;
declare namespace TextDirection {
var propTypes: {
/**
* Provide children to be rendered inside of this component
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify the text direction for rendered children
*/
dir: PropTypes.Requireable<string>;
/**
* Optionally provide a custom function to get the text direction for a piece
* of text. Whatever is returned will become the value of the `dir` attribute
* on a node of text. Should return one of: 'ltr', 'rtl', or 'auto'
*/
getTextDirection: PropTypes.Requireable<(...args: any[]) => any>;
};
}
export { TextDirection };