UNPKG

react-native-advanced-input-mask

Version:

Text input mask for React Native on iOS, Android and web. Synchronous and easy formatting without hustle

21 lines (13 loc) 408 B
import type { Next } from "../types"; abstract class State { child: State | null = null; constructor(child: State | null) { this.child = child; } abstract accept: (char: string) => Next | null; nextState = (): State => this.child!; autocomplete = (): Next | null => null; toString = (): string => `BASE -> ${this.child ? this.child.toString() : "null"}`; } export default State;