summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/terminal_private.json
blob: 7b8802b38cf705853a08020d1e3376e49accd41a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "terminalPrivate",
    "nodoc": true,
    "platforms": ["chromeos"],
    "types": [],
    "functions": [
      {
        "name": "openTerminalProcess",
        "type": "function",
        "description": "Starts new process.",
        "parameters": [
          {
            "type": "string",
            "name": "processName",
            "description": "Name of the process to open. Initially only 'crosh' is supported. Another processes may be added in future."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": false,
            "description": "Returns pid of the launched process. If no process was launched returns -1.",
            "parameters": [
              {
                "name": "pid",
                "description": "Pid of the launched process.",
                "type": "integer"
              }
            ]
          }
        ]
      },
      {
        "name": "closeTerminalProcess",
        "type": "function",
        "description": "Closes previousy opened process.",
        "parameters": [
          {
            "name": "pid",
            "type": "integer",
            "description": "Process id of the process we want to close."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "description": "Function that gets called when close operation is started for the process. Returns success of the function.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "sendInput",
        "type": "function",
        "description": "Sends input that will be routed to stdin of the process with the specified pid.",
        "parameters": [
          {
            "name": "pid",
            "type": "integer",
            "description": "The pid of the process to which we want to send input."
          },
          {
            "name": "input",
            "type": "string",
            "description": "Input we are sending to the process."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "description": "Callback that will be called when sendInput method ends. Returns success.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "onTerminalResize",
        "type": "function",
        "description": "Notify the process with the id pid that terminal window size has changed.",
        "parameters": [
          {
            "name": "pid",
            "type": "integer",
            "description": "The pid of the process."
          },
          {
            "name": "width",
            "type": "integer",
            "description": "New window width (as column count)."
          },
          {
            "name": "height",
            "type": "integer",
            "description": "New window height (as row count)."
          },
          {
            "name": "callback",
            "type": "function",
            "optional": true,
            "description": "Callback that will be called when sendInput method ends. Returns success.",
            "parameters": [
              {
                "name": "success",
                "type": "boolean"
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onProcessOutput",
        "type": "function",
        "description": "Fired when an opened process writes something to its output.",
        "parameters": [
          {
            "name": "pid",
            "type": "integer",
            "description": "Pid of the process from which the output came."
          },
          {
            "name": "type",
            "type": "string",
            "description": "Type of the output stream from which output came. When process exits, output type will be set to exit",
            "enum": ["stdout", "stderr", "exit"]
          },
          {
            "name": "text",
            "type": "string",
            "description": "Text that was written to the output stream."
          }
        ]
      }
    ]
  }
]