Dans mon application RN, j'ai l'interface suivante.
interface IProps extends Props<IProps> {
label?: string;
editable?: boolean;
maxLength?: number;
autoCorrect?: boolean;
placeholder?: string;
// tslint:disable-next-line: max-line-length
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters' | undefined;
// tslint:disable-next-line: max-line-length
returnKeyType?: 'none' | 'done' | 'search' | 'default' | 'go' | 'next' | 'send' | 'previous' | 'google' | 'join' | 'route' | 'yahoo' | 'emergency-call';
// tslint:disable-next-line: max-line-length
keyboardType?: 'default' | 'email-address' | 'numeric' | 'phone-pad' | 'visible-password' | 'ascii-capable' | 'numbers-and-punctuation' | 'url' | 'number-pad' | 'name-phone-pad' | 'decimal-pad' | 'twitter' | 'web-search' | undefined;
secureTextEntry?: boolean;
inputStyle?: object;
containerStyle?: object;
inputContainerStyle?: object;
}
Ici, le type autoCapitalize, returnKeyType est un enum. Il semble laid de définir l'ensemble de l'enum ici. Existe-t-il une meilleure approche ?