penguin/AstroJS

Javascript framework for my blog

resolver-go/internal/closure/types.go

raw ยท 593 bytes

package closure

type CompilePayload struct {
	ExternSources []SourceInput
	JSSources     []SourceInput
	Defines       map[string]any
}

type SourceInput struct {
	Name   string `json:"name"`
	Source string `json:"source"`
}

type CompileRequest struct {
	ExternSources []SourceInput  `json:"externSources,omitempty"`
	JSSources     []SourceInput  `json:"jsSources"`
	Defines       map[string]any `json:"defines,omitempty"`
}

type CompileResponse struct {
	OK       bool     `json:"ok"`
	JS       string   `json:"js"`
	Warnings []string `json:"warnings"`
	Errors   []string `json:"errors"`
}