You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/browser-repl/README.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,20 @@ const runtime = new IframeRuntime(serviceProvider);
31
31
Shell is a React component with the following properties:
32
32
33
33
-`runtime: Runtime`: The runtime used to evaluate code.
34
-
-`onOutputChanged?: (output: readonly ShellOutputEntry[]) => void`: A function called each time the output changes with an array of `ShellOutputEntryes`.
35
-
-`onHistoryChanged?: (history: readonly string[]) => void`: A function called each time the history changes with an array of history entries ordered from the most recent to the oldest entry.
34
+
-`onOutputChanged?: (output: ShellOutputEntry[]) => void`: A function called each time the output changes with an array of `ShellOutputEntryes`.
35
+
-`onHistoryChanged?: (history: string[]) => void`: A function called each time the history changes with an array of history entries ordered from the most recent to the oldest entry.
36
+
-`onEditorChanged?: (editor: EditorRef | null) => void`: A function called each time the editor ref changes. Can be used to call editor methods.
37
+
-`onOperationStarted: () => void`: A function called when an operation has begun.
38
+
-`onOperationEnd: () => void`: A function called when an operation has completed (both error and success).
36
39
-`redactInfo?: boolean`: If set, the shell will omit or redact entries containing sensitive info from history. Defaults to `false`.
37
40
-`maxOutputLength?: number`: The maxiumum number of lines to keep in the output. Defaults to `1000`.
38
41
-`maxHistoryLength?: number`: The maxiumum number of lines to keep in the history. Defaults to `1000`.
39
-
-`initialOutput?: readonly ShellOutputEntry[]`: An array of entries to be displayed in the output area. Can be used to restore the output between sessions, or to setup a greeting message. **Note**: new entries will not be appended to the array.
40
-
-`initialHistory?: readonly string[]`: An array of history entries to prepopulate the history.
42
+
-`initialEvaluate?: string|string[]`: A set of input strings to evaluate right after shell is mounted.
43
+
-`inputText?: string`: Initial text for the input field.
44
+
-`output?: ShellOutputEntry[]`: An array of entries to be displayed in the output area. Can be used to restore the output between sessions, or to setup a greeting message. **Note**: new entries will not be appended to the array.
45
+
-`history?: readonly string[]`: An array of history entries to prepopulate the history.
41
46
Can be used to restore the history between sessions. Entries must be ordered from the most recent to the oldest. Note: new entries will not be appended to the array.
47
+
-`isOperationInProgress?: boolean`: Can be used to restore the value between sessions.
0 commit comments