import { CB, Maybe, Nullable } from "vest-utils";

//#region src/Isolate/IsolateKeys.d.ts
declare enum IsolateKeys {
  Type = "$type",
  Keys = "keys",
  Key = "key",
  Parent = "parent",
  Data = "data",
  AllowReorder = "allowReorder",
  Transient = "transient",
  Status = "status",
  AbortController = "abortController",
  Children = "children",
}
//#endregion
//#region src/Isolate/IsolateStatus.d.ts
declare const IsolateStatus: {
  readonly DONE: "DONE";
  readonly HAS_PENDING: "HAS_PENDING";
  readonly INITIAL: "INITIAL";
  readonly PENDING: "PENDING";
};
type IsolateStatus = (typeof IsolateStatus)[keyof typeof IsolateStatus];
//#endregion
//#region src/Isolate/IsolateTypes.d.ts
type IsolateKey = Nullable<string>;
type TIsolate<P extends IsolatePayload = IsolatePayload> = {
  [IsolateKeys.AllowReorder]?: boolean;
  [IsolateKeys.Transient]?: boolean;
  [IsolateKeys.Parent]: Nullable<TIsolate>;
  [IsolateKeys.Type]: string;
  [IsolateKeys.Keys]: Nullable<Record<string, TIsolate>>;
  [IsolateKeys.Data]: DataOnly<P>;
  [IsolateKeys.Status]: IsolateStatus;
  [IsolateKeys.AbortController]: Nullable<AbortController>;
  children: Nullable<TIsolate[]>;
  key: IsolateKey;
  output: any;
} & UsedFeaturesOnly<P>;
type DataOnly<P extends IsolatePayload> = Omit<P, keyof IsolateFeatures>;
type UsedFeaturesOnly<P extends IsolatePayload> = Pick<P, keyof IsolateFeatures>;
type IsolatePayload<P = Record<string, any>> = P & IsolateFeatures;
type IsolateFeatures = {
  [IsolateKeys.AllowReorder]?: boolean;
  [IsolateKeys.Transient]?: boolean;
  [IsolateKeys.Status]?: IsolateStatus;
};
//#endregion
//#region src/Isolate/Isolate.d.ts
declare class Isolate {
  static create<Payload extends IsolatePayload>(type: string, callback: CB, payload?: Maybe<Payload>, key?: IsolateKey): TIsolate<Payload>;
  static isIsolate(node: any): node is TIsolate;
}
//#endregion
export { IsolateStatus as a, TIsolate as i, IsolateKey as n, IsolateKeys as o, IsolatePayload as r, Isolate as t };
//# sourceMappingURL=Isolate-C-a7xY5w.d.cts.map