add some comments, bump to rc4

This commit is contained in:
Matt Hill
2023-05-03 16:09:32 -06:00
parent 9a1dd5a399
commit 0ddd35c8d7
14 changed files with 127 additions and 43 deletions

View File

@@ -3,8 +3,8 @@ import { Effects } from "../types"
export class GetSystemSmtp {
constructor(readonly effects: Effects) {}
/** This should be used as the primary method in main since it allows the main to
* restart if the wrapper data changes
/**
* Returns the system SMTP credentials. Restarts the service if the credentials change
*/
const() {
return this.effects.getSystemSmtp({
@@ -12,8 +12,7 @@ export class GetSystemSmtp {
})
}
/**
* Returns the wrapper data once and then never again
* Doesn't restart the server when the wrapper data changes
* Returns the system SMTP credentials. Does nothing if the credentials change
*/
once() {
return this.effects.getSystemSmtp({
@@ -21,7 +20,7 @@ export class GetSystemSmtp {
})
}
/**
* Keeps giving the latest wrapper data as it changes
* Watches the system SMTP credentials. Takes a custom callback function to run whenever the credentials change
*/
async *watch() {
while (true) {

View File

@@ -89,6 +89,11 @@ export class FileHelper<A> {
}),
)
}
/**
* Create a File Helper for an arbitrary file type.
*
* Provide custom functions for translating data to the file format and visa versa.
*/
static raw<A>(
path: string,
volume: string,
@@ -97,6 +102,9 @@ export class FileHelper<A> {
) {
return new FileHelper<A>(path, volume, toFile, fromFile)
}
/**
* Create a File Helper for a .json file
*/
static json<A>(
path: string,
volume: string,
@@ -113,6 +121,9 @@ export class FileHelper<A> {
},
)
}
/**
* Create a File Helper for a .toml file
*/
static toml<A extends Record<string, unknown>>(
path: string,
volume: string,
@@ -129,6 +140,9 @@ export class FileHelper<A> {
},
)
}
/**
* Create a File Helper for a .yaml file
*/
static yaml<A extends Record<string, unknown>>(
path: string,
volume: string,

View File

@@ -12,8 +12,8 @@ export class GetWrapperData<WrapperData, Path extends string> {
} = {},
) {}
/** This should be used as the primary method in main since it allows the main to
* restart if the wrapper data changes
/**
* Returns the value of WrapperData at the provided path. Restart the service if the value changes
*/
const() {
return this.effects.getWrapperData<WrapperData, Path>({
@@ -23,8 +23,7 @@ export class GetWrapperData<WrapperData, Path extends string> {
})
}
/**
* Returns the wrapper data once and then never again
* Doesn't restart the server when the wrapper data changes
* Returns the value of WrapperData at the provided path. Does nothing if the value changes
*/
once() {
return this.effects.getWrapperData<WrapperData, Path>({
@@ -33,8 +32,9 @@ export class GetWrapperData<WrapperData, Path extends string> {
callback: () => {},
})
}
/**
* Keeps giving the latest wrapper data as it changes
* Watches the value of WrapperData at the provided path. Takes a custom callback function to run whenever the value changes
*/
async *watch() {
while (true) {