{"modulePath":"github.com/wavetermdev/waveterm","version":"v0.14.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package waveapp\n\n## Functions\n\n```go\nfunc DefineComponent[P any](client *Client, name string, renderFn func(ctx context.Context, props P) any) vdom.Component[P]\n```\n\n```go\nfunc ServeFileOption(w http.ResponseWriter, r *http.Request, option FileHandlerOption) error\n```\nServeFileOption handles serving content based on the provided FileHandlerOption\n\n## Types\n\n```go\ntype AppOpts struct {\n\tCloseOnCtrlC         bool\n\tGlobalKeyboardEvents bool\n\tGlobalStyles         []byte\n\tRootComponentName    string // defaults to \"App\"\n\tNewBlockFlag         string // defaults to \"n\" (set to \"-\" to disable)\n\tTargetNewBlock       bool\n\tTargetToolbar        *vdom.VDomTargetToolbar\n}\n```\n\n```go\ntype Client struct {\n\tLock               *sync.Mutex\n\tAppOpts            AppOpts\n\tRoot               *vdom.RootElem\n\tRootElem           *vdom.VDomElem\n\tRpcClient          *wshutil.WshRpc\n\tRpcContext         *wshrpc.RpcContext\n\tServerImpl         *WaveAppServerImpl\n\tIsDone             bool\n\tRouteId            string\n\tVDomContextBlockId string\n\tDoneReason         string\n\tDoneCh             chan struct{}\n\tOpts               vdom.VDomBackendOpts\n\tGlobalEventHandler func(client *Client, event vdom.VDomEvent)\n\tGlobalStylesOption *FileHandlerOption\n\tUrlHandlerMux      *mux.Router\n\tOverrideUrlHandler http.Handler\n\tNewBlockFlag       bool\n\tSetupFn            func()\n}\n```\n\n```go\nfunc MakeClient(appOpts AppOpts) *Client\n```\n\n```go\nfunc (client *Client) AddSetupFn(fn func())\n```\n\n```go\nfunc (client *Client) Connect() error\n```\n\n```go\nfunc (c *Client) CreateVDomContext(target *vdom.VDomTarget) error\n```\n\n```go\nfunc (c *Client) GetAtomVal(name string) any\n```\n\n```go\nfunc (c *Client) GetIsDone() bool\n```\n\n```go\nfunc (c *Client) RegisterComponent(name string, cfunc any) error\n```\n\n```go\nfunc (client *Client) RegisterDefaultFlags()\n```\n\n```go\nfunc (c *Client) RegisterFileHandler(path string, option FileHandlerOption)\n```\n\n```go\nfunc (c *Client) RegisterFilePrefixHandler(prefix string, optionProvider func(path string) (*FileHandlerOption, error))\n```\n\n```go\nfunc (c *Client) RegisterUrlPathHandler(path string, handler http.Handler)\n```\n\n```go\nfunc (client *Client) RunMain()\n```\n\n```go\nfunc (c *Client) SendAsyncInitiation() error\n```\n\n```go\nfunc (c *Client) SetAtomVal(name string, val any)\n```\n\n```go\nfunc (c *Client) SetAtomVals(m map[string]any)\n```\n\n```go\nfunc (c *Client) SetGlobalEventHandler(handler func(client *Client, event vdom.VDomEvent))\n```\n\n```go\nfunc (c *Client) SetOverrideUrlHandler(handler http.Handler)\n```\n\n```go\nfunc (c *Client) SetRootElem(elem *vdom.VDomElem)\n```\n\n```go\ntype FileHandlerOption struct {\n\tFilePath string    // optional file path on disk\n\tData     []byte    // optional byte slice content\n\tReader   io.Reader // optional reader for content\n\tFile     fs.File   // optional embedded or opened file\n\tMimeType string    // optional mime type\n\tETag     string    // optional ETag (if set, resource may be cached)\n}\n```\n\n```go\ntype StreamingResponseWriter struct {\n\t// contains filtered or unexported fields\n}\n```\nStreamingResponseWriter implements http.ResponseWriter interface to stream response data through a channel rather than buffering it in memory. This is particularly useful for handling large responses like video streams or file downloads.\n\n```go\nfunc NewStreamingResponseWriter(respChan chan\u003c- wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]) *StreamingResponseWriter\n```\n\n```go\nfunc (w *StreamingResponseWriter) Close() error\n```\n\n```go\nfunc (w *StreamingResponseWriter) Header() http.Header\n```\n\n```go\nfunc (w *StreamingResponseWriter) Write(data []byte) (int, error)\n```\n\n```go\nfunc (w *StreamingResponseWriter) WriteHeader(statusCode int)\n```\n\n```go\ntype WaveAppServerImpl struct {\n\tClient  *Client\n\tBlockId string\n}\n```\n\n```go\nfunc (impl *WaveAppServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom.VDomFrontendUpdate) chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate]\n```\n\n```go\nfunc (impl *WaveAppServerImpl) VDomUrlRequestCommand(ctx context.Context, data wshrpc.VDomUrlRequestData) chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]\n```\n\n```go\nfunc (*WaveAppServerImpl) WshServerImpl()\n```\n\n","path":"github.com/wavetermdev/waveterm/pkg/waveapp","name":"waveapp","synopsis":"","isRedistributable":true}
