@asaidimu/utils-artifacts 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.mts +11 -10
  2. package/index.d.ts +11 -10
  3. package/package.json +1 -1
package/index.d.mts CHANGED
@@ -352,16 +352,17 @@ interface ArtifactFactoryContext<TRegistry extends Record<string, any>, TState e
352
352
  */
353
353
  onDispose(callback: ArtifactCleanup): void;
354
354
  /**
355
- * Starts a stream process for a Singleton artifact, allowing it to emit
356
- * multiple values over time. The callback receives an `ArtifactStreamContext`
357
- * for emitting values and managing the stream lifecycle.
358
- * @param callback The function that implements the streaming logic. This
359
- * callback can return an optional cleanup function as an alternative to
360
- * listening to the provided signal
361
- * @throws {SystemError} if called on a Transient artifact, as Transient artifacts
362
- * do not maintain a persistent value.
363
- */
364
- stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => void | Promise<void> | (() => (void | Promise<void>))): void;
355
+ * Starts a streaming process for a Singleton artifact.
356
+ * The callback receives an `ArtifactStreamContext` to emit values and manage the
357
+ * stream's lifecycle. It can return a cleanup function (or a Promise resolving
358
+ * to one) to handle resource disposal.
359
+ * * @param callback - The streaming logic implementation. Can be synchronous or
360
+ * asynchronous, optionally returning a cleanup function.
361
+ * @throws {SystemError} If called on a Transient artifact, as they do not
362
+ * support persistent streaming states.
363
+ */
364
+ stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => (void | (() => void | Promise<void>)) | Promise<void | (() => void | Promise<void>)>): void;
365
+ stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => (void | (() => (void | Promise<void>))) | Promise<(void | (() => (void | Promise<void>)))>): void;
365
366
  }
366
367
  /**
367
368
  * A function that performs cleanup or disposal logic for an artifact, potentially asynchronously.
package/index.d.ts CHANGED
@@ -352,16 +352,17 @@ interface ArtifactFactoryContext<TRegistry extends Record<string, any>, TState e
352
352
  */
353
353
  onDispose(callback: ArtifactCleanup): void;
354
354
  /**
355
- * Starts a stream process for a Singleton artifact, allowing it to emit
356
- * multiple values over time. The callback receives an `ArtifactStreamContext`
357
- * for emitting values and managing the stream lifecycle.
358
- * @param callback The function that implements the streaming logic. This
359
- * callback can return an optional cleanup function as an alternative to
360
- * listening to the provided signal
361
- * @throws {SystemError} if called on a Transient artifact, as Transient artifacts
362
- * do not maintain a persistent value.
363
- */
364
- stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => void | Promise<void> | (() => (void | Promise<void>))): void;
355
+ * Starts a streaming process for a Singleton artifact.
356
+ * The callback receives an `ArtifactStreamContext` to emit values and manage the
357
+ * stream's lifecycle. It can return a cleanup function (or a Promise resolving
358
+ * to one) to handle resource disposal.
359
+ * * @param callback - The streaming logic implementation. Can be synchronous or
360
+ * asynchronous, optionally returning a cleanup function.
361
+ * @throws {SystemError} If called on a Transient artifact, as they do not
362
+ * support persistent streaming states.
363
+ */
364
+ stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => (void | (() => void | Promise<void>)) | Promise<void | (() => void | Promise<void>)>): void;
365
+ stream(callback: (ctx: ArtifactStreamContext<TState, TArtifact>) => (void | (() => (void | Promise<void>))) | Promise<(void | (() => (void | Promise<void>)))>): void;
365
366
  }
366
367
  /**
367
368
  * A function that performs cleanup or disposal logic for an artifact, potentially asynchronously.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaidimu/utils-artifacts",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Reactive artifact container.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",