Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wasm): Add empty functions for js builds to enable WASM builds #887

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added WASM stub.
BigJk committed May 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1f36905db4886bbaa4c5d1612486680b8103e69e
9 changes: 9 additions & 0 deletions signals_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//go:build js
// +build js

package tea

// listenForResize is not available in js runtime.
func (p *Program) listenForResize(done chan struct{}) {
close(done)
}
21 changes: 21 additions & 0 deletions tty_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build js
// +build js

package tea

import (
"errors"
"os"
)

func (p *Program) initInput() error {
return errors.New("unavailable in js")
}

func (p *Program) restoreInput() error {
return errors.New("unavailable in js")
}

func openInputTTY() (*os.File, error) {
return nil, errors.New("unavailable in js")
}