Documentation ¶
Index ¶
- func ImportPathEqual(ip1, ip2 *ImportPath) bool
- func ImportPathsEqual(l1, l2 []*ImportPath) bool
- type Config
- type ImportPath
- func NewEntActionImportPath(typ string) *ImportPath
- func NewEntGraphQLImportPath(typ string) *ImportPath
- func NewEntImportPath(typ string) *ImportPath
- func NewGQLClassImportPath(typ string) *ImportPath
- func NewGQLImportPath(typ string) *ImportPath
- func NewGraphQLJSONImportPath(typ string) *ImportPath
- func NewGraphQLScalarsImportPath(typ string) *ImportPath
- func NewLocalEntConnectionImportPath(typ string) *ImportPath
- func NewLocalEntImportPath(typ string) *ImportPath
- func NewLocalGraphQLEntImportPath(typ string) *ImportPath
- func NewLocalGraphQLInputEntImportPath(typ string) *ImportPath
- func NewTypesEntImportPath(typ string) *ImportPath
- type Imports
- func (imps *Imports) ConditionallyReserveImportPath(imp *ImportPath, external bool) (string, error)
- func (imps *Imports) Export(path string, exports ...string) (string, error)
- func (imps *Imports) ExportAll(path string) (string, error)
- func (imps *Imports) ExportAllAs(path, as string) (string, error)
- func (imps *Imports) FuncMap() template.FuncMap
- func (imps *Imports) Reserve(path string, imports ...string) (string, error)
- func (imps *Imports) ReserveAll(path, as string) (string, error)
- func (imps *Imports) ReserveDefault(path, defaultImport string, imports ...string) (string, error)
- func (imps *Imports) ReserveImportPath(imp *ImportPath, external bool) (string, error)
- func (imps *Imports) String() (string, error)
- func (imps *Imports) Use(impItem string) (string, error)
- func (imps *Imports) UseMaybe(export string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPathEqual ¶ added in v0.0.38
func ImportPathEqual(ip1, ip2 *ImportPath) bool
func ImportPathsEqual ¶ added in v0.0.38
func ImportPathsEqual(l1, l2 []*ImportPath) bool
Types ¶
type ImportPath ¶ added in v0.0.38
type ImportPath struct { ImportPath string `json:"importPath"` Import string `json:"import"` DefaultImport bool `json:"defaultImport,omitempty"` // we name this originalImport so that clients everywhere can just keep calling useImport .Import OriginalImport string `json:"originalImport,omitempty"` // only used in graphql (at least for now) // defaults to no. if function, call it instead of just referencing the import when used? Function bool `json:"function,omitempty"` Class bool `json:"class,omitempty"` TransformedForGraphQLMutation bool `json:"transformedForGraphQLMutation,omitempty"` TransformedForExternalEnt bool `json:"transformedForExternalEnt,omitempty"` // automatically imported and we don't need to use it // imported as follows: `import "{path}";` SideEffect bool `json:"sideEffect"` }
func NewEntActionImportPath ¶ added in v0.0.38
func NewEntActionImportPath(typ string) *ImportPath
func NewEntGraphQLImportPath ¶ added in v0.0.38
func NewEntGraphQLImportPath(typ string) *ImportPath
func NewEntImportPath ¶ added in v0.0.38
func NewEntImportPath(typ string) *ImportPath
func NewGQLClassImportPath ¶ added in v0.1.0
func NewGQLClassImportPath(typ string) *ImportPath
func NewGQLImportPath ¶ added in v0.0.38
func NewGQLImportPath(typ string) *ImportPath
NewGQLImportPath creates a new import from "graphql"
func NewGraphQLJSONImportPath ¶ added in v0.0.38
func NewGraphQLJSONImportPath(typ string) *ImportPath
func NewGraphQLScalarsImportPath ¶ added in v0.1.8
func NewGraphQLScalarsImportPath(typ string) *ImportPath
func NewLocalEntConnectionImportPath ¶ added in v0.0.38
func NewLocalEntConnectionImportPath(typ string) *ImportPath
func NewLocalEntImportPath ¶ added in v0.0.38
func NewLocalEntImportPath(typ string) *ImportPath
func NewLocalGraphQLEntImportPath ¶ added in v0.0.38
func NewLocalGraphQLEntImportPath(typ string) *ImportPath
func NewLocalGraphQLInputEntImportPath ¶ added in v0.1.0
func NewLocalGraphQLInputEntImportPath(typ string) *ImportPath
func NewTypesEntImportPath ¶ added in v0.1.0
func NewTypesEntImportPath(typ string) *ImportPath
type Imports ¶
type Imports struct {
// contains filtered or unexported fields
}
Imports keeps track of imports in a generated typescript file
func NewImports ¶
NewImports is the constructor for Imports filePath is path that's currently being written
func (*Imports) ConditionallyReserveImportPath ¶ added in v0.1.0
func (imps *Imports) ConditionallyReserveImportPath(imp *ImportPath, external bool) (string, error)
ConditionallyReserveImportPath skips importing when the import path is same as file path
func (*Imports) ReserveAll ¶
ReserveAll reserves importing all from a path as the alias
func (*Imports) ReserveDefault ¶
ReserveDefault reserves the default export from a path and a list of exports
func (*Imports) ReserveImportPath ¶ added in v0.0.38
func (imps *Imports) ReserveImportPath(imp *ImportPath, external bool) (string, error)
ReserveImportPath takes an instance of importPath and reserves importing from it should be default eventually
Click to show internal directories.
Click to hide internal directories.