@bunt/unit
Advanced tools
Comparing version 0.24.40 to 0.24.45
import { IServiceResolver } from "../interfaces"; | ||
export declare type ResolveService<T> = T extends IServiceResolver<infer S> ? Promise<S> : T; | ||
export declare type ApplyContext<C> = C & { | ||
export type ResolveService<T> = T extends IServiceResolver<infer S> ? Promise<S> : T; | ||
export type ApplyContext<C> = C & { | ||
[K in keyof C]: C[K] extends IServiceResolver<infer S> ? S : C[K]; | ||
}; |
import { Fn, Promisify } from "@bunt/util"; | ||
import { Action } from "./Action"; | ||
import { ApplyContext, Context } from "./Context"; | ||
export declare type ActionAny<C extends Context = Context, S extends StateType | null = any, R = any> = Action<C, S, R>; | ||
export declare type ContextArg<C extends Context> = (() => Promisify<C>) | Promisify<C>; | ||
export declare type ActionCtor<A extends ActionAny> = { | ||
export type ActionAny<C extends Context = Context, S extends StateType | null = any, R = any> = Action<C, S, R>; | ||
export type ContextArg<C extends Context> = (() => Promisify<C>) | Promisify<C>; | ||
export type ActionCtor<A extends ActionAny> = { | ||
new (context: ApplyContext<ActionContext<A>>, state: ActionState<A>): A; | ||
prototype: A; | ||
}; | ||
export declare type ActionImport<A extends ActionAny> = Fn<[], Promise<{ | ||
export type ActionImport<A extends ActionAny> = Fn<[], Promise<{ | ||
default: ActionCtor<A>; | ||
}>>; | ||
export declare type AsyncActionFactory<A extends ActionAny> = { | ||
export type AsyncActionFactory<A extends ActionAny> = { | ||
factory: ActionImport<A>; | ||
}; | ||
export declare type ActionFactory<A extends ActionAny> = ActionCtor<A> | AsyncActionFactory<A>; | ||
export declare type ActionContext<A> = A extends ActionAny<infer T> ? T : never; | ||
export declare type ActionState<A> = A extends ActionAny<any, infer T> ? T : never; | ||
export declare type ActionReturn<A> = A extends ActionAny<any, any, infer T> ? T : never; | ||
export declare type ResolvableValue<T> = Promise<T> | (() => T | Promise<T>); | ||
export type ActionFactory<A extends ActionAny> = ActionCtor<A> | AsyncActionFactory<A>; | ||
export type ActionContext<A> = A extends ActionAny<infer T> ? T : never; | ||
export type ActionState<A> = A extends ActionAny<any, infer T> ? T : never; | ||
export type ActionReturn<A> = A extends ActionAny<any, any, infer T> ? T : never; | ||
export type ResolvableValue<T> = Promise<T> | (() => T | Promise<T>); | ||
export interface IServiceResolver<T> { | ||
resolve(): Promise<T>; | ||
} | ||
export declare type StateType = Record<string, any> | null; | ||
export type StateType = Record<string, any> | null; | ||
export interface IShadowState<T> { | ||
getShadowState(): T; | ||
} | ||
export declare type ActionTransactionFinish = (reason: unknown | null) => void; | ||
export declare type ActionTransactionStart<C> = (action: string, context: ApplyContext<C>) => ActionTransactionFinish; | ||
export declare type ActionTransactionCatch<C> = (reason: unknown, context: ApplyContext<C>) => void; | ||
export declare type ActionTransactionHandlers<C> = { | ||
export type ActionTransactionFinish = (reason: unknown | null) => void; | ||
export type ActionTransactionStart<C> = (action: string, context: ApplyContext<C>) => ActionTransactionFinish; | ||
export type ActionTransactionCatch<C> = (reason: unknown, context: ApplyContext<C>) => void; | ||
export type ActionTransactionHandlers<C> = { | ||
start?: ActionTransactionStart<C>; | ||
error?: ActionTransactionCatch<C>; | ||
}; |
@@ -1,2 +0,2 @@ | ||
export declare type EnvRecord = Record<string, string>; | ||
export type EnvRecord = Record<string, string>; | ||
export declare class EnvReader<T extends EnvRecord> { | ||
@@ -3,0 +3,0 @@ #private; |
@@ -16,6 +16,6 @@ import { Promisify } from "@bunt/util"; | ||
} | ||
export declare type HeartbeatTarget = Record<any, any> | ((...args: unknown[]) => unknown); | ||
export declare type HeartbeatRunningQueue = PromiseLike<unknown>; | ||
export declare type DisposableFn = () => Promisify<void>; | ||
export declare type DisposableType = DisposableFn | IDisposable; | ||
export declare type RuntimeTask = () => Promisify<unknown>; | ||
export type HeartbeatTarget = Record<any, any> | ((...args: unknown[]) => unknown); | ||
export type HeartbeatRunningQueue = PromiseLike<unknown>; | ||
export type DisposableFn = () => Promisify<void>; | ||
export type DisposableType = DisposableFn | IDisposable; | ||
export type RuntimeTask = () => Promisify<unknown>; |
import { KeyOf } from "@bunt/util"; | ||
export declare type DSNOptions<O extends Record<string, any> = Record<string, any>> = O; | ||
export type DSNOptions<O extends Record<string, any> = Record<string, any>> = O; | ||
export interface IDSNConnection<O extends DSNOptions> { | ||
@@ -4,0 +4,0 @@ host: string; |
{ | ||
"name": "@bunt/unit", | ||
"version": "0.24.40", | ||
"version": "0.24.45", | ||
"keywords": [ | ||
@@ -32,3 +32,3 @@ "typescript" | ||
"license": "MIT", | ||
"gitHead": "914f04f6a85b23bce91453de66413e2f51bba450" | ||
"gitHead": "e15ed9b7a07c91e46ca69d511e9c71d8be7a0696" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97826