customfunction param first param second returns export function add ( first , second ) { return first + second ; } customfunction param invocation export function clock ( invocation ) { const timer = setInterval ( ( ) => { const time = currentTime ( ) ; invocation . setResult ( time ) ; } , 1000 ) ; invocation . onCanceled = ( ) => { clearInterval ( timer ) ; } ; } returns export function currentTime ( ) { return new Date ( ) . toLocaleTimeString ( ) ; } customfunction param incrementBy param invocation export function increment ( incrementBy , invocation ) { let result = 0 ; const timer = setInterval ( ( ) => { result += incrementBy ; invocation . setResult ( result ) ; } , 1000 ) ; invocation . onCanceled = ( ) => { clearInterval ( timer ) ; } ; } customfunction param message returns export function logMessage ( message ) { console . log ( message ) ; return message ; }