Window package is now a full core.Service with typed IPC messages. Register(Platform) factory closure captures platform adapter for WithService. OnStartup queries config and registers query/task handlers. Platform events converted to IPC actions via trackWindow. Co-Authored-By: Virgil <virgil@lethean.io>
15 lines
477 B
Go
15 lines
477 B
Go
package window
|
|
|
|
import "forge.lthn.ai/core/go/pkg/core"
|
|
|
|
// Register creates a factory closure that captures the Platform adapter.
|
|
// The returned function has the signature WithService requires: func(*Core) (any, error).
|
|
func Register(p Platform) func(*core.Core) (any, error) {
|
|
return func(c *core.Core) (any, error) {
|
|
return &Service{
|
|
ServiceRuntime: core.NewServiceRuntime[Options](c, Options{}),
|
|
platform: p,
|
|
manager: NewManager(p),
|
|
}, nil
|
|
}
|
|
}
|