Skip to content

Latest commit

 

History

History
136 lines (111 loc) · 3.47 KB

File metadata and controls

136 lines (111 loc) · 3.47 KB

InteractivePrompt (interface)

This API is a work-in-progress and is subject to change at any time.

interface InteractivePrompt {
  prompt?: () => string;
  printInput?: (input: string) => void;
  historyFileName?: string;
  getCompletions?: (
    line: string,
    pos: number,
  ) => {
    tab: Array<string>;
    pos: number;
    ctx: {
      [key: string | number | symbol]: any;
    };
  };
  handleInput: (input: string) => void;
  start(): void;
}

InteractivePrompt.prompt (function property)

prompt?: () => string;

InteractivePrompt.printInput (function property)

printInput?: (input: string) => void;

InteractivePrompt.historyFileName (string property)

historyFileName?: string;

InteractivePrompt.getCompletions (function property)

getCompletions?: (line: string, pos: number) => {
  tab: Array<string>;
  pos: number;
  ctx: {
    [key: string | number | symbol]: any;
  };
};

InteractivePrompt.handleInput (function property)

handleInput: (input: string) => void;

InteractivePrompt.start (method)

start(): void;

InteractivePromptConstructor (interface)

This API is a work-in-progress and is subject to change at any time.

interface InteractivePromptConstructor {
  new (
    handleInput: (input: string) => void,
    options?: {
      prompt?: () => string;
      printInput?: (input: string) => void;
      historyFileName?: string;
      getCompletions?: (
        line: string,
        pos: number,
      ) => {
        tab: Array<string>;
        pos: number;
        ctx: {
          [key: string | number | symbol]: any;
        };
      };
    },
  ): InteractivePrompt;
  prototype: InteractivePrompt;
}

InteractivePromptConstructor new(...) (construct signature)

new (handleInput: (input: string) => void, options?: {
  prompt?: () => string;
  printInput?: (input: string) => void;
  historyFileName?: string;
  getCompletions?: (line: string, pos: number) => {
    tab: Array<string>;
    pos: number;
    ctx: {
      [key: string | number | symbol]: any;
    };
  };
}): InteractivePrompt;

InteractivePromptConstructor.prototype (InteractivePrompt property)

prototype: InteractivePrompt;

InteractivePrompt (InteractivePromptConstructor)

This API is a work-in-progress and is subject to change at any time.

var InteractivePrompt: InteractivePromptConstructor;