mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
improve StartTunnel validation and GC (#3062)
* improve StartTunnel validation and GC * update sdk formatting
This commit is contained in:
@@ -45,9 +45,10 @@ export interface ActionInfo<
|
||||
readonly _INPUT: Type
|
||||
}
|
||||
|
||||
export class Action<Id extends T.ActionId, Type extends Record<string, any>>
|
||||
implements ActionInfo<Id, Type>
|
||||
{
|
||||
export class Action<
|
||||
Id extends T.ActionId,
|
||||
Type extends Record<string, any>,
|
||||
> implements ActionInfo<Id, Type> {
|
||||
readonly _INPUT: Type = null as any as Type
|
||||
private prevInputSpec: Record<
|
||||
string,
|
||||
@@ -148,8 +149,7 @@ export class Action<Id extends T.ActionId, Type extends Record<string, any>>
|
||||
|
||||
export class Actions<
|
||||
AllActions extends Record<T.ActionId, Action<T.ActionId, any>>,
|
||||
> implements InitScript
|
||||
{
|
||||
> implements InitScript {
|
||||
private constructor(private readonly actions: AllActions) {}
|
||||
static of(): Actions<{}> {
|
||||
return new Actions({})
|
||||
|
||||
@@ -109,9 +109,11 @@ export class DropPromise<T> implements Promise<T> {
|
||||
}
|
||||
}
|
||||
|
||||
export class DropGenerator<T = unknown, TReturn = any, TNext = unknown>
|
||||
implements AsyncGenerator<T, TReturn, TNext>
|
||||
{
|
||||
export class DropGenerator<
|
||||
T = unknown,
|
||||
TReturn = any,
|
||||
TNext = unknown,
|
||||
> implements AsyncGenerator<T, TReturn, TNext> {
|
||||
private static dropFns: { [id: number]: () => void } = {}
|
||||
private static registry = new FinalizationRegistry((id: number) => {
|
||||
const drop = DropGenerator.dropFns[id]
|
||||
|
||||
Reference in New Issue
Block a user