forked from linuswillner/react-console-emulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
44 lines (44 loc) · 1.38 KB
/
config.js
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
export default {
globalStyles: {
maxHeight: '300px'
},
commands: {
echo: {
description: 'Echoes a passed string.',
usage: 'echo <string>',
fn: function () {
return `${Array.from(arguments).join(' ')}`
}
},
danger: {
description: 'This command returns HTML. It will only work with terminals that have danger mode enabled.',
fn: () => 'I can<br/>use HTML in this<br/>and it will be parsed'
},
async: {
description: 'This command runs an asynchronous task.',
fn: async () => {
const asyncTask = async () => 'Hello from a promise!'
const result = await asyncTask()
return result
}
},
delay: {
description: 'Delays return of value by 1000 ms.',
fn: () => {
return new Promise(resolve => {
setTimeout(() => resolve('Finished!'), 1000)
})
}
},
html: {
description: 'Returns a raw HTML string.',
fn: async () => '<span style="color:#c386ff">Hello</span> <span style="color:#fa8072">World</span>'
}
},
casingCommands: {
CaSeMatTeRs: {
description: 'In terminals with case-insensitive matching, this command can be executed regardless of whether the casing is correct.',
fn: () => 'This command is called "CaSeMatTeRs", but in case-insensitive terminals it can also be called with "casematters"!'
}
}
}