@baeta/generator-sdk
Enumerations
GeneratorPluginVersion
Enumeration Members
Enumeration Member | Value |
---|---|
|
|
Classes
File
Extended by
Constructors
new File()
new File(
filename
,content
,tag
,options
?):File
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
|
Returns
Properties
Property | Modifier | Type | Default value |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
buildContent()
protected
buildContent():Promise
<string
>
Returns
Promise
<string
>
buildHeader()
protected
buildHeader():string
Returns
string
createComment()
protected
createComment(comment
):string
Parameters
Parameter | Type |
---|---|
|
|
Returns
string
unlink()
unlink():
Promise
<void
>
Returns
Promise
<void
>
write()
write():
Promise
<void
>
Returns
Promise
<void
>
FileBlock
Extends
Constructors
new FileBlock()
new FileBlock(
filename
,content
,start
,end
,tag
,options
?):FileBlock
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from |
---|---|---|---|---|
|
|
|
| |
|
|
|
|
‐ |
|
|
|
| |
|
|
|
| |
|
|
|
|
‐ |
|
|
|
|
Methods
addBlockToContent()
protected
addBlockToContent(existingContent
):string
Parameters
Parameter | Type |
---|---|
|
|
Returns
string
buildContent()
protected
buildContent():Promise
<string
>
Returns
Promise
<string
>
Inherited from
buildHeader()
protected
buildHeader():string
Returns
string
Inherited from
buildPadding()
protected
buildPadding(existingContent
):""
| "\n" | "\n\n"
Parameters
Parameter | Type |
---|---|
|
|
Returns
""
| "\n" | "\n\n"
createComment()
protected
createComment(comment
):string
Parameters
Parameter | Type |
---|---|
|
|
Returns
string
Inherited from
getExistingContent()
protected
getExistingContent():Promise
<readonly [string
,FileHandle
] | readonly [""
,null
]>
Returns
Promise
<readonly [string
, FileHandle
] | readonly [""
, null
]>
getSlices()
protected
getSlices(existingContent
): readonly [string
,""
,false
] | readonly [string
,string
,true
]
Parameters
Parameter | Type |
---|---|
|
|
Returns
readonly [string
, ""
, false
] | readonly [string
, string
, true
]
unlink()
unlink():
Promise
<void
>
Returns
Promise
<void
>
Overrides
write()
write():
Promise
<void
>
Returns
Promise
<void
>
Overrides
FileManager
Constructors
new FileManager()
new FileManager(
fileOptions
?):FileManager
Parameters
Parameter | Type |
---|---|
|
Returns
Properties
Property | Modifier | Type | Default value |
---|---|---|---|
|
|
|
|
|
|
|
Methods
add()
add(...
file
):void
Parameters
Parameter | Type |
---|---|
... |
|
Returns
void
createAndAdd()
createAndAdd(
filename
,content
,tag
):File
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
Returns
get()
get(
filename
):undefined
|File
Parameters
Parameter | Type |
---|---|
|
|
Returns
undefined
| File
getAll()
getAll():
File
[]
Returns
File
[]
getByTag()
getByTag(
tag
):File
[]
Parameters
Parameter | Type |
---|---|
|
|
Returns
File
[]
getPersistedFiles()
getPersistedFiles():
File
[]
Returns
File
[]
remove()
remove(
filename
):void
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
removeAll()
removeAll():
void
Returns
void
removeByTag()
removeByTag(
tag
):void
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
unlinkAll()
unlinkAll():
Promise
<void
>
Returns
Promise
<void
>
writeAll()
writeAll():
Promise
<void
[]>
Returns
Promise
<void
[]>
writeByTag()
writeByTag(
tag
):Promise
<void
[]>
Parameters
Parameter | Type |
---|---|
|
|
Returns
Promise
<void
[]>
Watcher
Constructors
new Watcher()
new Watcher(
cwd
,options
?):Watcher
Parameters
Parameter | Type |
---|---|
|
|
|
|
Returns
Methods
close()
close():
Promise
<void
>
Returns
Promise
<void
>
createSubscription()
createSubscription():
object
Returns
object
Name | Type |
---|---|
unsubscribe | () => Promise <void > |
ignore()
ignore(
pattern
):void
Parameters
Parameter | Type |
---|---|
|
Returns
void
off()
off(
event
,listener
):void
Parameters
Parameter | Type |
---|---|
|
|
|
Returns
void
on()
on(
event
,listener
):void
Parameters
Parameter | Type |
---|---|
|
|
|
Returns
void
onEvents()
onEvents(
err
,events
):void
Parameters
Parameter | Type |
---|---|
|
|
|
|
Returns
void
unignore()
unignore(
pattern
):void
Parameters
Parameter | Type |
---|---|
|
Returns
void
WatcherIgnore
Constructors
new WatcherIgnore()
new WatcherIgnore(
cwd
):WatcherIgnore
Parameters
Parameter | Type |
---|---|
|
|
Returns
Methods
ignore()
ignore(
pattern
):void
Parameters
Parameter | Type |
---|---|
|
Returns
void
isIgnored()
isIgnored(
path
):boolean
Parameters
Parameter | Type |
---|---|
|
|
Returns
boolean
isMicromatch()
isMicromatch(
pattern
):boolean
Parameters
Parameter | Type |
---|---|
|
|
Returns
boolean
resolveFile()
resolveFile(
file
):string
Parameters
Parameter | Type |
---|---|
|
|
Returns
string
unignore()
unignore(
pattern
):void
Parameters
Parameter | Type |
---|---|
|
Returns
void
Interfaces
FileOptions
Options for generated files.
Properties
Property | Type | Default value | Description |
---|---|---|---|
|
|
|
Add eslint-disable comment at the beginning of the file. |
|
|
|
Add generation notice at the beginning of the file. |
|
( |
|
Add custom header at the beginning of the file. |
|
( |
|
Edit the content of the file before writing it. |
GeneratorOptions
Options for the Baeta Generator.
Properties
Property | Type | Default value | Description |
---|---|---|---|
|
|
|
Glob pattern(s) to locate GraphQL schema files. |
|
|
|
Output path for the generated base types file. |
|
|
|
Path to the context type definition. Supports both named and default exports. Examples
|
|
|
|
Current working directory for resolving relative paths. |
|
|
|
Path to Baeta Extensions (ex. auth-extension). Only default export is supported. Example
|
|
|
Configuration options for generated files. | |
|
|
|
File extension to use in generated import statements. Set to false to omit extensions. |
|
|
|
Custom schema loaders for processing schema files. |
|
|
|
Filename for the generated module definition file. Contains type definitions and the GraphQL AST. |
|
|
|
Root directory where GraphQL modules are defined. |
|
|
|
Custom scalar type mappings. Maps GraphQL scalar types to TypeScript types. Supports global types and imports. Example
|
GeneratorPluginV1<Store>
Type Parameters
Type Parameter | Default type |
---|---|
|
|
Properties
Property | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
| |
| |
|
Loader<TOptions>
Interface for custom schema loaders.
Type Parameters
Type Parameter | Default type |
---|---|
|
|
Methods
load()
load(
pointer
,options
?):Promise
<null
|any
[]>
Parameters
Parameter | Type |
---|---|
|
|
|
|
Returns
Promise
<null
| any
[]>