| 1 |
import MaskedPattern, { MaskedPatternState, type MaskedPatternOptions } from './pattern'; |
| 2 |
import { AppendFlags } from './base'; |
| 3 |
import ChangeDetails from '../core/change-details'; |
| 4 |
import { TailDetails } from '../core/tail-details'; |
| 5 |
export type MaskedEnumOptions = Omit<MaskedPatternOptions, 'mask'> & Pick<MaskedEnum, 'enum'> & Partial<Pick<MaskedEnum, 'matchValue'>>; |
| 6 |
export type MaskedEnumPatternOptions = MaskedPatternOptions & Partial<Pick<MaskedEnum, 'enum' | 'matchValue'>>; |
| 7 |
/** Pattern which validates enum values */ |
| 8 |
export default class MaskedEnum extends MaskedPattern { |
| 9 |
enum: Array<string>; |
| 10 |
/** Match enum value */ |
| 11 |
matchValue: (enumStr: string, inputStr: string, matchFrom: number) => boolean; |
| 12 |
static DEFAULTS: typeof MaskedPattern.DEFAULTS & Pick<MaskedEnum, 'matchValue'>; |
| 13 |
constructor(opts?: MaskedEnumOptions); |
| 14 |
updateOptions(opts: Partial<MaskedEnumOptions>): void; |
| 15 |
_update(opts: Partial<MaskedEnumOptions>): void; |
| 16 |
_appendCharRaw(ch: string, flags?: AppendFlags<MaskedPatternState>): ChangeDetails; |
| 17 |
extractTail(fromPos?: number, toPos?: number): TailDetails; |
| 18 |
remove(fromPos?: number, toPos?: number): ChangeDetails; |
| 19 |
get isComplete(): boolean; |
| 20 |
} |
| 21 |
//# sourceMappingURL=enum.d.ts.map |