@@ -56,7 +56,7 @@ export default class Prompt {
5656 /**
5757 * Unsubscribe all listeners
5858 */
59- protected unsubscribe ( ) {
59+ protected unsubscribe ( ) : void {
6060 this . _subscribers . clear ( ) ;
6161 }
6262
@@ -78,7 +78,7 @@ export default class Prompt {
7878 * @param event - The event name
7979 * @param cb - The callback
8080 */
81- public on < T extends keyof ClackEvents > ( event : T , cb : ClackEvents [ T ] ) {
81+ public on < T extends keyof ClackEvents > ( event : T , cb : ClackEvents [ T ] ) : void {
8282 this . setSubscriber ( event , { cb } ) ;
8383 }
8484
@@ -87,7 +87,7 @@ export default class Prompt {
8787 * @param event - The event name
8888 * @param cb - The callback
8989 */
90- public once < T extends keyof ClackEvents > ( event : T , cb : ClackEvents [ T ] ) {
90+ public once < T extends keyof ClackEvents > ( event : T , cb : ClackEvents [ T ] ) : void {
9191 this . setSubscriber ( event , { cb, once : true } ) ;
9292 }
9393
@@ -96,7 +96,7 @@ export default class Prompt {
9696 * @param event - The event name
9797 * @param data - The data to pass to the callback
9898 */
99- public emit < T extends keyof ClackEvents > ( event : T , ...data : Parameters < ClackEvents [ T ] > ) {
99+ public emit < T extends keyof ClackEvents > ( event : T , ...data : Parameters < ClackEvents [ T ] > ) : void {
100100 const cbs = this . _subscribers . get ( event ) ?? [ ] ;
101101 const cleanup : ( ( ) => void ) [ ] = [ ] ;
102102
@@ -113,7 +113,7 @@ export default class Prompt {
113113 }
114114 }
115115
116- public prompt ( ) {
116+ public prompt ( ) : Promise < string | symbol > {
117117 return new Promise < string | symbol > ( ( resolve , reject ) => {
118118 if ( this . _abortSignal ) {
119119 if ( this . _abortSignal . aborted ) {
@@ -229,7 +229,7 @@ export default class Prompt {
229229 }
230230 }
231231
232- protected close ( ) {
232+ protected close ( ) : void {
233233 this . input . unpipe ( ) ;
234234 this . input . removeListener ( 'keypress' , this . onKeypress ) ;
235235 this . output . write ( '\n' ) ;
0 commit comments