MCPcopy
hub / github.com/bombshell-dev/clack / constructor

Method constructor

packages/core/src/prompts/confirm.ts:19–37  ·  view source on GitHub ↗
(opts: ConfirmOptions)

Source from the content-addressed store, hash-verified

17 }
18
19 constructor(opts: ConfirmOptions) {
20 super(opts, false);
21 this.value = !!opts.initialValue;
22
23 this.on('userInput', () => {
24 this.value = this._value;
25 });
26
27 this.on('confirm', (confirm) => {
28 this.output.write(cursor.move(0, -1));
29 this.value = confirm;
30 this.state = 'submit';
31 this.close();
32 });
33
34 this.on('cursor', () => {
35 this.value = !this.value;
36 });
37 }
38}

Callers

nothing calls this directly

Calls 2

onMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected