d2wasm

package
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2025 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(args []js.Value) (interface{}, error)

func Decode

func Decode(args []js.Value) (interface{}, error)

func Encode

func Encode(args []js.Value) (interface{}, error)

func GetBoardAtPosition

func GetBoardAtPosition(args []js.Value) (interface{}, error)

func GetCompletions

func GetCompletions(args []js.Value) (interface{}, error)

func GetELKGraph

func GetELKGraph(args []js.Value) (interface{}, error)

func GetObjOrder

func GetObjOrder(args []js.Value) (interface{}, error)

func GetParentID

func GetParentID(args []js.Value) (interface{}, error)

func GetRefRanges

func GetRefRanges(args []js.Value) (interface{}, error)

func GetVersion

func GetVersion(args []js.Value) (interface{}, error)

func Render

func Render(args []js.Value) (interface{}, error)

Types

type BoardPositionResponse

type BoardPositionResponse struct {
	BoardPath []string `json:"boardPath"`
}

type CompileRequest

type CompileRequest struct {
	FS   map[string]string `json:"fs"`
	Opts *RenderOptions    `json:"options"`
}

type CompileResponse

type CompileResponse struct {
	FS      map[string]string `json:"fs"`
	Diagram d2target.Diagram  `json:"diagram"`
	Graph   d2graph.Graph     `json:"graph"`
}

type CompletionResponse

type CompletionResponse struct {
	Items []map[string]interface{} `json:"items"`
}

type D2API

type D2API struct {
	// contains filtered or unexported fields
}

func NewD2API

func NewD2API() *D2API

func (*D2API) ExportTo

func (api *D2API) ExportTo(target js.Value)

func (*D2API) Register

func (api *D2API) Register(name string, fn func(args []js.Value) (interface{}, error))

type RefRangesResponse

type RefRangesResponse struct {
	Ranges       []d2ast.Range `json:"ranges"`
	ImportRanges []d2ast.Range `json:"importRanges"`
}

type RenderOptions

type RenderOptions struct {
	Layout  *string `json:"layout"`
	Sketch  *bool   `json:"sketch"`
	ThemeID *int64  `json:"themeID"`
}

type RenderRequest

type RenderRequest struct {
	Diagram *d2target.Diagram `json:"diagram"`
	Opts    *RenderOptions    `json:"options"`
}

type WASMError

type WASMError struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

func (*WASMError) Error

func (e *WASMError) Error() string

type WASMResponse

type WASMResponse struct {
	Data  interface{} `json:"data,omitempty"`
	Error *WASMError  `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL