LineEditor constructor

LineEditor({
  1. required Stream<List<int>> input,
  2. required void output(
    1. String
    ),
  3. required FutureOr<void> onLine(
    1. String line
    ),
  4. required CommandHistory history,
  5. bool interactive = true,
  6. void setRawMode(
    1. bool raw
    )?,
  7. void onInterrupt()?,
  8. void onEof()?,
  9. void onRaw(
    1. List<int> bytes
    )?,
  10. Future<List<String>> onComplete(
    1. String word,
    2. bool isCommand
    )?,
})

Implementation

LineEditor({
  required Stream<List<int>> input,
  required void Function(String) output,
  required FutureOr<void> Function(String line) onLine,
  required CommandHistory history,
  this.interactive = true,
  void Function(bool raw)? setRawMode,
  void Function()? onInterrupt,
  void Function()? onEof,
  void Function(List<int> bytes)? onRaw,
  Future<List<String>> Function(String word, bool isCommand)? onComplete,
}) : _input = input,
     _output = output,
     _onLine = onLine,
     _history = history,
     _setRawMode = setRawMode,
     _onInterrupt = onInterrupt,
     _onEof = onEof,
     _onRaw = onRaw,
     _onComplete = onComplete {
  _histIndex = _history.entries.length;
}