@tstdl/base 0.93.182 → 0.93.184
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.
- package/api/server/api-request-token.provider.js +1 -1
- package/api/server/gateway.js +6 -1
- package/authentication/authentication.api.d.ts +13 -40
- package/authentication/authentication.api.js +5 -14
- package/authentication/client/authentication.service.d.ts +6 -14
- package/authentication/client/authentication.service.js +22 -4
- package/authentication/client/module.d.ts +1 -1
- package/authentication/client/module.js +4 -4
- package/authentication/models/index.d.ts +1 -0
- package/authentication/models/index.js +1 -0
- package/authentication/models/totp-results.model.d.ts +11 -0
- package/authentication/models/totp-results.model.js +37 -0
- package/authentication/server/authentication.api-controller.d.ts +3 -3
- package/authentication/server/authentication.api-controller.js +31 -4
- package/authentication/server/authentication.service.d.ts +5 -14
- package/authentication/server/authentication.service.js +6 -4
- package/core.d.ts +0 -5
- package/core.js +0 -8
- package/document-management/api/document-management.api.d.ts +2 -2
- package/document-management/service-models/document.service-model.d.ts +1 -1
- package/examples/config.d.ts +25 -0
- package/examples/config.js +26 -0
- package/notification/server/module.d.ts +1 -1
- package/notification/server/module.js +1 -1
- package/package.json +5 -5
- package/signals/api.d.ts +5 -1
- package/signals/api.js +3 -1
- package/signals/implementation/api.d.ts +10 -1
- package/signals/implementation/api.js +7 -1
- package/signals/implementation/asserts.d.ts +2 -2
- package/signals/implementation/asserts.js +3 -3
- package/signals/implementation/computed.d.ts +7 -34
- package/signals/implementation/computed.js +14 -83
- package/signals/implementation/configure.js +6 -2
- package/signals/implementation/effect.d.ts +65 -46
- package/signals/implementation/effect.js +97 -62
- package/signals/implementation/index.d.ts +2 -4
- package/signals/implementation/index.js +2 -4
- package/signals/implementation/linked_signal.d.ts +36 -0
- package/signals/implementation/linked_signal.js +34 -0
- package/signals/implementation/primitive/computed.d.ts +55 -0
- package/signals/implementation/primitive/computed.js +107 -0
- package/signals/implementation/primitive/effect.d.ts +26 -0
- package/signals/implementation/primitive/effect.js +31 -0
- package/signals/implementation/{equality.d.ts → primitive/equality.d.ts} +1 -1
- package/signals/implementation/{equality.js → primitive/equality.js} +1 -1
- package/signals/implementation/primitive/errors.d.ts +10 -0
- package/signals/implementation/{errors.js → primitive/errors.js} +3 -4
- package/signals/implementation/primitive/formatter.d.ts +19 -0
- package/signals/implementation/primitive/formatter.js +136 -0
- package/signals/implementation/{graph.d.ts → primitive/graph.d.ts} +68 -36
- package/signals/implementation/primitive/graph.js +386 -0
- package/signals/implementation/primitive/linked_signal.d.ts +46 -0
- package/signals/implementation/primitive/linked_signal.js +110 -0
- package/signals/implementation/primitive/signal.d.ts +31 -0
- package/signals/implementation/primitive/signal.js +80 -0
- package/signals/implementation/primitive/untracked.d.ts +12 -0
- package/signals/implementation/primitive/untracked.js +23 -0
- package/signals/implementation/{watch.d.ts → primitive/watch.d.ts} +1 -2
- package/signals/implementation/{watch.js → primitive/watch.js} +22 -16
- package/signals/implementation/resource/api.d.ts +275 -0
- package/signals/implementation/resource/api.js +26 -0
- package/signals/implementation/resource/debounce.d.ts +13 -0
- package/signals/implementation/resource/debounce.js +113 -0
- package/signals/implementation/resource/from_snapshots.d.ts +16 -0
- package/signals/implementation/resource/from_snapshots.js +44 -0
- package/signals/implementation/resource/index.d.ts +11 -0
- package/signals/implementation/resource/index.js +11 -0
- package/signals/implementation/resource/resource.d.ts +110 -0
- package/signals/implementation/resource/resource.js +402 -0
- package/signals/implementation/root_effect_scheduler.d.ts +50 -0
- package/signals/implementation/root_effect_scheduler.js +66 -0
- package/signals/implementation/signal.d.ts +42 -18
- package/signals/implementation/signal.js +29 -49
- package/signals/implementation/to-observable.d.ts +12 -5
- package/signals/implementation/to-observable.js +12 -2
- package/signals/implementation/to-signal.d.ts +9 -18
- package/signals/implementation/to-signal.js +46 -13
- package/signals/implementation/untracked.d.ts +1 -1
- package/signals/implementation/untracked.js +3 -11
- package/signals/operators/debounce.d.ts +8 -0
- package/signals/operators/debounce.js +19 -0
- package/signals/operators/derive-async.js +43 -15
- package/signals/operators/index.d.ts +2 -0
- package/signals/operators/index.js +2 -0
- package/signals/operators/throttle.d.ts +8 -0
- package/signals/operators/throttle.js +31 -0
- package/ai/genkit/tests/multi-region.test.d.ts +0 -2
- package/ai/genkit/tests/multi-region.test.js +0 -179
- package/ai/genkit/tests/token-limit-fallback.test.d.ts +0 -2
- package/ai/genkit/tests/token-limit-fallback.test.js +0 -209
- package/ai/prompts/tests/prompt-builder.test.d.ts +0 -1
- package/ai/prompts/tests/prompt-builder.test.js +0 -22
- package/ai/tests/instructions-formatter.test.d.ts +0 -1
- package/ai/tests/instructions-formatter.test.js +0 -116
- package/ai/tests/steering.test.d.ts +0 -1
- package/ai/tests/steering.test.js +0 -37
- package/api/client/tests/api-client.test.d.ts +0 -1
- package/api/client/tests/api-client.test.js +0 -194
- package/api/server/tests/csrf.middleware.test.d.ts +0 -1
- package/api/server/tests/csrf.middleware.test.js +0 -91
- package/authentication/tests/authentication-password-requirements.validator.test.d.ts +0 -1
- package/authentication/tests/authentication-password-requirements.validator.test.js +0 -29
- package/authentication/tests/authentication.api-controller.test.d.ts +0 -1
- package/authentication/tests/authentication.api-controller.test.js +0 -156
- package/authentication/tests/authentication.api-request-token.provider.test.d.ts +0 -1
- package/authentication/tests/authentication.api-request-token.provider.test.js +0 -48
- package/authentication/tests/authentication.client-error-handling.test.d.ts +0 -1
- package/authentication/tests/authentication.client-error-handling.test.js +0 -123
- package/authentication/tests/authentication.client-middleware.test.d.ts +0 -1
- package/authentication/tests/authentication.client-middleware.test.js +0 -118
- package/authentication/tests/authentication.client-service-methods.test.d.ts +0 -1
- package/authentication/tests/authentication.client-service-methods.test.js +0 -177
- package/authentication/tests/authentication.client-service-refresh.test.d.ts +0 -1
- package/authentication/tests/authentication.client-service-refresh.test.js +0 -153
- package/authentication/tests/authentication.client-service.test.d.ts +0 -1
- package/authentication/tests/authentication.client-service.test.js +0 -76
- package/authentication/tests/authentication.refresh-busy-loop.test.d.ts +0 -1
- package/authentication/tests/authentication.refresh-busy-loop.test.js +0 -84
- package/authentication/tests/authentication.service.test.d.ts +0 -1
- package/authentication/tests/authentication.service.test.js +0 -167
- package/authentication/tests/authentication.test-ancillary-service.d.ts +0 -9
- package/authentication/tests/authentication.test-ancillary-service.js +0 -27
- package/authentication/tests/brute-force-protection.test.d.ts +0 -1
- package/authentication/tests/brute-force-protection.test.js +0 -211
- package/authentication/tests/helper.test.d.ts +0 -1
- package/authentication/tests/helper.test.js +0 -122
- package/authentication/tests/password-requirements.error.test.d.ts +0 -1
- package/authentication/tests/password-requirements.error.test.js +0 -14
- package/authentication/tests/remember.api.test.d.ts +0 -1
- package/authentication/tests/remember.api.test.js +0 -117
- package/authentication/tests/remember.service.test.d.ts +0 -1
- package/authentication/tests/remember.service.test.js +0 -83
- package/authentication/tests/subject.service.test.d.ts +0 -1
- package/authentication/tests/subject.service.test.js +0 -140
- package/authentication/tests/suspended-subject.test.d.ts +0 -1
- package/authentication/tests/suspended-subject.test.js +0 -120
- package/authentication/tests/totp.enrollment.test.d.ts +0 -1
- package/authentication/tests/totp.enrollment.test.js +0 -123
- package/authentication/tests/totp.login.test.d.ts +0 -1
- package/authentication/tests/totp.login.test.js +0 -213
- package/authentication/tests/totp.recovery-codes.test.d.ts +0 -1
- package/authentication/tests/totp.recovery-codes.test.js +0 -97
- package/authentication/tests/totp.status.test.d.ts +0 -1
- package/authentication/tests/totp.status.test.js +0 -72
- package/cancellation/tests/coverage.test.d.ts +0 -1
- package/cancellation/tests/coverage.test.js +0 -49
- package/cancellation/tests/leak.test.d.ts +0 -1
- package/cancellation/tests/leak.test.js +0 -35
- package/cancellation/tests/token.test.d.ts +0 -1
- package/cancellation/tests/token.test.js +0 -136
- package/circuit-breaker/tests/circuit-breaker.test.d.ts +0 -1
- package/circuit-breaker/tests/circuit-breaker.test.js +0 -116
- package/cryptography/tests/cryptography.test.d.ts +0 -1
- package/cryptography/tests/cryptography.test.js +0 -175
- package/cryptography/tests/jwt.test.d.ts +0 -1
- package/cryptography/tests/jwt.test.js +0 -54
- package/cryptography/tests/modern.test.d.ts +0 -1
- package/cryptography/tests/modern.test.js +0 -105
- package/cryptography/tests/module.test.d.ts +0 -1
- package/cryptography/tests/module.test.js +0 -100
- package/cryptography/tests/totp.test.d.ts +0 -1
- package/cryptography/tests/totp.test.js +0 -108
- package/document-management/tests/ai-config-hierarchy.test.d.ts +0 -1
- package/document-management/tests/ai-config-hierarchy.test.js +0 -59
- package/document-management/tests/ai-config-integration.test.d.ts +0 -1
- package/document-management/tests/ai-config-integration.test.js +0 -125
- package/document-management/tests/ai-config-merge.test.d.ts +0 -1
- package/document-management/tests/ai-config-merge.test.js +0 -46
- package/document-management/tests/document-management-ai-overrides.test.d.ts +0 -1
- package/document-management/tests/document-management-ai-overrides.test.js +0 -63
- package/document-management/tests/document-management-core.test.d.ts +0 -1
- package/document-management/tests/document-management-core.test.js +0 -157
- package/document-management/tests/document-management.api.test.d.ts +0 -1
- package/document-management/tests/document-management.api.test.js +0 -101
- package/document-management/tests/document-statistics.service.test.d.ts +0 -1
- package/document-management/tests/document-statistics.service.test.js +0 -498
- package/document-management/tests/document-validation-ai-overrides.test.d.ts +0 -1
- package/document-management/tests/document-validation-ai-overrides.test.js +0 -87
- package/document-management/tests/document.service.test.d.ts +0 -1
- package/document-management/tests/document.service.test.js +0 -143
- package/document-management/tests/enum-helpers.test.d.ts +0 -1
- package/document-management/tests/enum-helpers.test.js +0 -452
- package/document-management/tests/helper.d.ts +0 -24
- package/document-management/tests/helper.js +0 -39
- package/errors/tests/format.test.d.ts +0 -1
- package/errors/tests/format.test.js +0 -84
- package/http/tests/server-timing.test.d.ts +0 -1
- package/http/tests/server-timing.test.js +0 -42
- package/injector/tests/advanced.test.d.ts +0 -1
- package/injector/tests/advanced.test.js +0 -116
- package/injector/tests/async-init.test.d.ts +0 -1
- package/injector/tests/async-init.test.js +0 -77
- package/injector/tests/basic.test.d.ts +0 -1
- package/injector/tests/basic.test.js +0 -114
- package/injector/tests/hierarchical.test.d.ts +0 -1
- package/injector/tests/hierarchical.test.js +0 -59
- package/injector/tests/leak.test.d.ts +0 -1
- package/injector/tests/leak.test.js +0 -45
- package/injector/tests/lifecycles.test.d.ts +0 -1
- package/injector/tests/lifecycles.test.js +0 -109
- package/logger/tests/pretty-print.test.d.ts +0 -1
- package/logger/tests/pretty-print.test.js +0 -60
- package/notification/tests/notification-api.test.d.ts +0 -1
- package/notification/tests/notification-api.test.js +0 -124
- package/notification/tests/notification-client.test.d.ts +0 -1
- package/notification/tests/notification-client.test.js +0 -101
- package/notification/tests/notification-flow.test.d.ts +0 -1
- package/notification/tests/notification-flow.test.js +0 -296
- package/notification/tests/notification-sse.service.test.d.ts +0 -1
- package/notification/tests/notification-sse.service.test.js +0 -43
- package/notification/tests/notification-type.service.test.d.ts +0 -1
- package/notification/tests/notification-type.service.test.js +0 -41
- package/object-storage/s3/tests/s3.object-storage.integration.test.d.ts +0 -1
- package/object-storage/s3/tests/s3.object-storage.integration.test.js +0 -303
- package/orm/tests/build-jsonb.test.d.ts +0 -1
- package/orm/tests/build-jsonb.test.js +0 -39
- package/orm/tests/data-types.test.d.ts +0 -1
- package/orm/tests/data-types.test.js +0 -39
- package/orm/tests/database-extension.test.d.ts +0 -1
- package/orm/tests/database-extension.test.js +0 -63
- package/orm/tests/database-migration.test.d.ts +0 -1
- package/orm/tests/database-migration.test.js +0 -83
- package/orm/tests/decorators.test.d.ts +0 -1
- package/orm/tests/decorators.test.js +0 -77
- package/orm/tests/encryption.test.d.ts +0 -1
- package/orm/tests/encryption.test.js +0 -31
- package/orm/tests/query-complex.test.d.ts +0 -1
- package/orm/tests/query-complex.test.js +0 -172
- package/orm/tests/query-converter-complex.test.d.ts +0 -1
- package/orm/tests/query-converter-complex.test.js +0 -131
- package/orm/tests/query-converter.test.d.ts +0 -1
- package/orm/tests/query-converter.test.js +0 -123
- package/orm/tests/repository-advanced.test.d.ts +0 -1
- package/orm/tests/repository-advanced.test.js +0 -189
- package/orm/tests/repository-attributes.test.d.ts +0 -1
- package/orm/tests/repository-attributes.test.js +0 -83
- package/orm/tests/repository-compound-primary-key.test.d.ts +0 -2
- package/orm/tests/repository-compound-primary-key.test.js +0 -226
- package/orm/tests/repository-comprehensive.test.d.ts +0 -1
- package/orm/tests/repository-comprehensive.test.js +0 -162
- package/orm/tests/repository-coverage.test.d.ts +0 -2
- package/orm/tests/repository-coverage.test.js +0 -242
- package/orm/tests/repository-cti-complex.test.d.ts +0 -1
- package/orm/tests/repository-cti-complex.test.js +0 -151
- package/orm/tests/repository-cti-embedded.test.d.ts +0 -1
- package/orm/tests/repository-cti-embedded.test.js +0 -178
- package/orm/tests/repository-cti-extensive.test.d.ts +0 -2
- package/orm/tests/repository-cti-extensive.test.js +0 -279
- package/orm/tests/repository-cti-mapping.test.d.ts +0 -2
- package/orm/tests/repository-cti-mapping.test.js +0 -108
- package/orm/tests/repository-cti-search.test.d.ts +0 -1
- package/orm/tests/repository-cti-search.test.js +0 -141
- package/orm/tests/repository-cti-soft-delete.test.d.ts +0 -2
- package/orm/tests/repository-cti-soft-delete.test.js +0 -103
- package/orm/tests/repository-cti-transactions.test.d.ts +0 -1
- package/orm/tests/repository-cti-transactions.test.js +0 -112
- package/orm/tests/repository-cti-upsert-many.test.d.ts +0 -2
- package/orm/tests/repository-cti-upsert-many.test.js +0 -115
- package/orm/tests/repository-cti.test.d.ts +0 -2
- package/orm/tests/repository-cti.test.js +0 -390
- package/orm/tests/repository-edge-cases.test.d.ts +0 -1
- package/orm/tests/repository-edge-cases.test.js +0 -178
- package/orm/tests/repository-expiration.test.d.ts +0 -2
- package/orm/tests/repository-expiration.test.js +0 -140
- package/orm/tests/repository-extra-coverage.test.d.ts +0 -2
- package/orm/tests/repository-extra-coverage.test.js +0 -402
- package/orm/tests/repository-mapping.test.d.ts +0 -2
- package/orm/tests/repository-mapping.test.js +0 -65
- package/orm/tests/repository-regression.test.d.ts +0 -1
- package/orm/tests/repository-regression.test.js +0 -288
- package/orm/tests/repository-search-coverage.test.d.ts +0 -1
- package/orm/tests/repository-search-coverage.test.js +0 -107
- package/orm/tests/repository-search.test.d.ts +0 -1
- package/orm/tests/repository-search.test.js +0 -105
- package/orm/tests/repository-soft-delete.test.d.ts +0 -1
- package/orm/tests/repository-soft-delete.test.js +0 -118
- package/orm/tests/repository-transactions-nested.test.d.ts +0 -1
- package/orm/tests/repository-transactions-nested.test.js +0 -178
- package/orm/tests/repository-types.test.d.ts +0 -1
- package/orm/tests/repository-types.test.js +0 -184
- package/orm/tests/repository-undelete.test.d.ts +0 -2
- package/orm/tests/repository-undelete.test.js +0 -201
- package/orm/tests/schema-converter.test.d.ts +0 -1
- package/orm/tests/schema-converter.test.js +0 -82
- package/orm/tests/schema-generation.test.d.ts +0 -2
- package/orm/tests/schema-generation.test.js +0 -174
- package/orm/tests/sql-helpers.test.d.ts +0 -1
- package/orm/tests/sql-helpers.test.js +0 -67
- package/orm/tests/transaction-safety.test.d.ts +0 -1
- package/orm/tests/transaction-safety.test.js +0 -81
- package/orm/tests/transactional.test.d.ts +0 -1
- package/orm/tests/transactional.test.js +0 -215
- package/orm/tests/utils.test.d.ts +0 -1
- package/orm/tests/utils.test.js +0 -70
- package/pdf/tests/utils.test.d.ts +0 -1
- package/pdf/tests/utils.test.js +0 -187
- package/process/tests/spawn.test.d.ts +0 -1
- package/process/tests/spawn.test.js +0 -182
- package/rate-limit/tests/postgres-rate-limiter.test.d.ts +0 -1
- package/rate-limit/tests/postgres-rate-limiter.test.js +0 -84
- package/renderer/tests/renderer.test.d.ts +0 -1
- package/renderer/tests/renderer.test.js +0 -88
- package/rpc/tests/rpc.integration.test.d.ts +0 -1
- package/rpc/tests/rpc.integration.test.js +0 -615
- package/signals/implementation/errors.d.ts +0 -2
- package/signals/implementation/graph.js +0 -312
- package/signals/implementation/writable-signal.d.ts +0 -48
- package/signals/implementation/writable-signal.js +0 -32
- package/task-queue/tests/coverage-branch.test.d.ts +0 -1
- package/task-queue/tests/coverage-branch.test.js +0 -395
- package/task-queue/tests/coverage-enhancement.test.d.ts +0 -1
- package/task-queue/tests/coverage-enhancement.test.js +0 -150
- package/task-queue/tests/dag.test.d.ts +0 -1
- package/task-queue/tests/dag.test.js +0 -188
- package/task-queue/tests/dependencies.test.d.ts +0 -1
- package/task-queue/tests/dependencies.test.js +0 -296
- package/task-queue/tests/enqueue-batch.test.d.ts +0 -1
- package/task-queue/tests/enqueue-batch.test.js +0 -125
- package/task-queue/tests/enqueue-item.test.d.ts +0 -1
- package/task-queue/tests/enqueue-item.test.js +0 -12
- package/task-queue/tests/fan-out-spawning.test.d.ts +0 -1
- package/task-queue/tests/fan-out-spawning.test.js +0 -94
- package/task-queue/tests/idempotent-replacement.test.d.ts +0 -1
- package/task-queue/tests/idempotent-replacement.test.js +0 -114
- package/task-queue/tests/missing-idempotent-tasks.test.d.ts +0 -1
- package/task-queue/tests/missing-idempotent-tasks.test.js +0 -39
- package/task-queue/tests/optimization-edge-cases.test.d.ts +0 -1
- package/task-queue/tests/optimization-edge-cases.test.js +0 -124
- package/task-queue/tests/queue-generic.test.d.ts +0 -1
- package/task-queue/tests/queue-generic.test.js +0 -8
- package/task-queue/tests/queue.test.d.ts +0 -1
- package/task-queue/tests/queue.test.js +0 -756
- package/task-queue/tests/shutdown.test.d.ts +0 -1
- package/task-queue/tests/shutdown.test.js +0 -41
- package/task-queue/tests/task-context.test.d.ts +0 -1
- package/task-queue/tests/task-context.test.js +0 -7
- package/task-queue/tests/task-union.test.d.ts +0 -1
- package/task-queue/tests/task-union.test.js +0 -18
- package/task-queue/tests/transactions.test.d.ts +0 -1
- package/task-queue/tests/transactions.test.js +0 -47
- package/task-queue/tests/typing.test.d.ts +0 -1
- package/task-queue/tests/typing.test.js +0 -9
- package/task-queue/tests/worker.test.d.ts +0 -1
- package/task-queue/tests/worker.test.js +0 -258
- package/task-queue/tests/zombie-parent.test.d.ts +0 -1
- package/task-queue/tests/zombie-parent.test.js +0 -45
- package/task-queue/tests/zombie-recovery.test.d.ts +0 -1
- package/task-queue/tests/zombie-recovery.test.js +0 -51
- package/utils/tests/backoff.test.d.ts +0 -1
- package/utils/tests/backoff.test.js +0 -41
- package/utils/tests/retry-with-backoff.test.d.ts +0 -1
- package/utils/tests/retry-with-backoff.test.js +0 -49
|
@@ -235,8 +235,8 @@ export declare const addOrArchiveDocumentToOrFromCollectionParametersSchema: imp
|
|
|
235
235
|
}> | undefined;
|
|
236
236
|
}>;
|
|
237
237
|
export declare const proceedDocumentWorkflowParametersSchema: import("../../schema/index.js").ObjectSchema<{
|
|
238
|
-
id: string;
|
|
239
238
|
state: "error" | "pending" | "running" | "completed" | "review" | "failed";
|
|
239
|
+
id: string;
|
|
240
240
|
}>;
|
|
241
241
|
export type MetadataParameter = SchemaOutput<typeof metadataParameterObjectSchema>;
|
|
242
242
|
export type LoadDataParameters = SchemaOutput<typeof getDataParametersSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const examplesConfig: {
|
|
2
|
+
database: {
|
|
3
|
+
host: string;
|
|
4
|
+
port: number;
|
|
5
|
+
user: string;
|
|
6
|
+
pass: string;
|
|
7
|
+
database: string;
|
|
8
|
+
schema: string;
|
|
9
|
+
};
|
|
10
|
+
ai: {
|
|
11
|
+
apiKey: string | undefined;
|
|
12
|
+
keyFile: string | undefined;
|
|
13
|
+
vertex: {
|
|
14
|
+
project: string;
|
|
15
|
+
location: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
s3: {
|
|
19
|
+
endpoint: string;
|
|
20
|
+
accessKey: string;
|
|
21
|
+
secretKey: string;
|
|
22
|
+
bucket: string | undefined;
|
|
23
|
+
bucketPerModule: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { boolean, positiveInteger, string } from '../utils/config-parser.js';
|
|
2
|
+
export const examplesConfig = {
|
|
3
|
+
database: {
|
|
4
|
+
host: string('DATABASE_HOST', '127.0.0.1'),
|
|
5
|
+
port: positiveInteger('DATABASE_PORT', 15433),
|
|
6
|
+
user: string('DATABASE_USER', 'tstdl'),
|
|
7
|
+
pass: string('DATABASE_PASS', 'wf7rq6glrk5jykne'),
|
|
8
|
+
database: string('DATABASE_NAME', 'tstdl'),
|
|
9
|
+
schema: string('DATABASE_SCHEMA', 'tstdl'),
|
|
10
|
+
},
|
|
11
|
+
ai: {
|
|
12
|
+
apiKey: string('AI_API_KEY', undefined),
|
|
13
|
+
keyFile: string('AI_API_KEY_FILE', undefined),
|
|
14
|
+
vertex: {
|
|
15
|
+
project: string('AI_VERTEX_PROJECT', 'tstdl-dev'),
|
|
16
|
+
location: string('AI_VERTEX_LOCATION', 'tstdl-dev'),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
s3: {
|
|
20
|
+
endpoint: string('S3_ENDPOINT', 'http://localhost:19552'),
|
|
21
|
+
accessKey: string('S3_ACCESS_KEY', 'tstdl-dev'),
|
|
22
|
+
secretKey: string('S3_SECRET_KEY', 'tstdl-dev'),
|
|
23
|
+
bucket: string('S3_BUCKET', undefined),
|
|
24
|
+
bucketPerModule: boolean('S3_BUCKET_PER_MODULE', true),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -13,7 +13,7 @@ export declare class NotificationConfiguration {
|
|
|
13
13
|
autoArchiveAfter?: number;
|
|
14
14
|
autoMigrate?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export declare function configureNotification({ injector, ...config }
|
|
16
|
+
export declare function configureNotification({ injector, ...config }?: NotificationConfiguration & {
|
|
17
17
|
injector?: Injector;
|
|
18
18
|
}): void;
|
|
19
19
|
/**
|
|
@@ -13,7 +13,7 @@ export class NotificationConfiguration {
|
|
|
13
13
|
autoArchiveAfter;
|
|
14
14
|
autoMigrate;
|
|
15
15
|
}
|
|
16
|
-
export function configureNotification({ injector, ...config }) {
|
|
16
|
+
export function configureNotification({ injector, ...config } = {}) {
|
|
17
17
|
const targetInjector = injector ?? Injector;
|
|
18
18
|
targetInjector.register(NotificationConfiguration, { useValue: { autoArchiveAfter: 30 * 24 * 60 * 60 * 1000, ...config } });
|
|
19
19
|
if (isDefined(config.ancillaryService)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.93.
|
|
3
|
+
"version": "0.93.184",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"test:coverage": "f() { vitest run --coverage --coverage.include=\"source/$1/**/*.ts\" source/$1; }; f",
|
|
21
21
|
"tsc:watch": "tsc --watch",
|
|
22
22
|
"tsc-alias:watch": "tsc-alias --watch",
|
|
23
|
-
"cleanup:dist": "rm -vrf dist/tools/",
|
|
23
|
+
"cleanup:dist": "rm -vrf dist/tools/ && find dist -type d -name \"tests\" -exec rm -rf {} +",
|
|
24
24
|
"copy:readmes": "cp README.md dist/ && cd source && find . -name \"README.md\" -exec cp --parents {} ../dist/ \\;",
|
|
25
25
|
"generate:migration": "./scripts/manage-orm.sh generate && npm run copy:orm",
|
|
26
26
|
"generate:readmes": "deno run --allow-run=code2prompt --allow-read --allow-write=source --allow-net=generativelanguage.googleapis.com --allow-env=GEMINI_API_KEY generate-readmes.ts",
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"type-fest": "^5.5"
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
|
-
"@aws-sdk/client-s3": "^3.
|
|
157
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
156
|
+
"@aws-sdk/client-s3": "^3.1021",
|
|
157
|
+
"@aws-sdk/s3-request-presigner": "^3.1021",
|
|
158
158
|
"@genkit-ai/google-genai": "^1.31",
|
|
159
159
|
"@google-cloud/storage": "^7.19",
|
|
160
160
|
"@toon-format/toon": "^2.1.0",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"mjml": "^4.18",
|
|
171
171
|
"nodemailer": "^8.0",
|
|
172
172
|
"pg": "^8.20",
|
|
173
|
-
"playwright": "^1.
|
|
173
|
+
"playwright": "^1.59",
|
|
174
174
|
"preact": "^10.29",
|
|
175
175
|
"preact-render-to-string": "^6.6",
|
|
176
176
|
"sharp": "^0.34",
|
package/signals/api.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Tagged } from 'type-fest';
|
|
2
2
|
import type * as Types from './implementation/index.js';
|
|
3
|
-
export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToObservableOptions, ToSignalOptions, WritableSignal } from './implementation/index.js';
|
|
3
|
+
export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToObservableOptions, ToSignalOptions, ValueEqualityFn, WritableSignal } from './implementation/index.js';
|
|
4
4
|
export type SignalsInjector = Tagged<symbol, 'injector'>;
|
|
5
5
|
export type SignalsConfiguration<TInjector = SignalsInjector> = {
|
|
6
6
|
signal: typeof Types.signal;
|
|
7
7
|
computed: typeof Types.computed;
|
|
8
8
|
effect: typeof Types.effect;
|
|
9
|
+
linkedSignal: typeof Types.linkedSignal;
|
|
9
10
|
untracked: typeof Types.untracked;
|
|
11
|
+
resource: typeof Types.resource;
|
|
10
12
|
isSignal: typeof Types.isSignal;
|
|
11
13
|
toSignal: typeof Types.toSignal;
|
|
12
14
|
toObservable: typeof Types.toObservable;
|
|
@@ -17,6 +19,8 @@ export type SignalsConfiguration<TInjector = SignalsInjector> = {
|
|
|
17
19
|
export declare let signal: typeof Types.signal;
|
|
18
20
|
export declare let computed: typeof Types.computed;
|
|
19
21
|
export declare let effect: typeof Types.effect;
|
|
22
|
+
export declare let linkedSignal: typeof Types.linkedSignal;
|
|
23
|
+
export declare let resource: typeof Types.resource;
|
|
20
24
|
export declare let untracked: typeof Types.untracked;
|
|
21
25
|
export declare let isSignal: typeof Types.isSignal;
|
|
22
26
|
export declare let toSignal: typeof Types.toSignal;
|
package/signals/api.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export let signal = throwSignalsNotConfigured;
|
|
3
3
|
export let computed = throwSignalsNotConfigured;
|
|
4
4
|
export let effect = throwSignalsNotConfigured;
|
|
5
|
+
export let linkedSignal = throwSignalsNotConfigured;
|
|
6
|
+
export let resource = throwSignalsNotConfigured;
|
|
5
7
|
export let untracked = throwSignalsNotConfigured;
|
|
6
8
|
export let isSignal = throwSignalsNotConfigured;
|
|
7
9
|
export let toSignal = throwSignalsNotConfigured;
|
|
@@ -11,7 +13,7 @@ export let getCurrentSignalsInjector = throwSignalsNotConfigured;
|
|
|
11
13
|
export let runInSignalsInjectionContext = throwSignalsNotConfigured;
|
|
12
14
|
/* eslint-enable import/no-mutable-exports */
|
|
13
15
|
export function configureSignals(configuration) {
|
|
14
|
-
({ signal, computed, effect, untracked, isSignal, toSignal, toObservable, isInSignalsInjectionContext, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
|
|
16
|
+
({ signal, computed, effect, linkedSignal, resource, untracked, isSignal, toSignal, toObservable, isInSignalsInjectionContext, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
|
|
15
17
|
}
|
|
16
18
|
function throwSignalsNotConfigured() {
|
|
17
19
|
throw new Error('Signals are not configured. Use configureDefaultSignalsImplementation() for default implementation or configureSignals() for custom implementation.');
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { SIGNAL } from '../symbol.js';
|
|
9
|
+
import type { WritableSignal } from './signal.js';
|
|
9
10
|
/**
|
|
10
11
|
* A reactive value which notifies consumers of any changes.
|
|
11
12
|
*
|
|
@@ -22,3 +23,11 @@ export interface Signal<T> {
|
|
|
22
23
|
* Checks if the given `value` is a reactive `Signal`.
|
|
23
24
|
*/
|
|
24
25
|
export declare function isSignal(value: unknown): value is Signal<unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* A comparison function which can determine if two values are equal.
|
|
28
|
+
*/
|
|
29
|
+
export type ValueEqualityFn<T> = (a: T, b: T) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if the given `value` is a writeable signal.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isWritableSignal(value: unknown): value is WritableSignal<unknown>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { SIGNAL } from '../symbol.js';
|
|
9
9
|
/**
|
|
@@ -12,3 +12,9 @@ import { SIGNAL } from '../symbol.js';
|
|
|
12
12
|
export function isSignal(value) {
|
|
13
13
|
return typeof value === 'function' && value[SIGNAL] !== undefined;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the given `value` is a writeable signal.
|
|
17
|
+
*/
|
|
18
|
+
export function isWritableSignal(value) {
|
|
19
|
+
return isSignal(value) && typeof value.set === 'function';
|
|
20
|
+
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Asserts that the current stack frame is not within a reactive context. Useful
|
|
10
|
-
* to disallow certain code from running inside a reactive context (see {@link toSignal})
|
|
10
|
+
* to disallow certain code from running inside a reactive context (see {@link toSignal})
|
|
11
11
|
*
|
|
12
12
|
* @param debugFn a reference to the function making the assertion (used for the error message).
|
|
13
13
|
*/
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { getActiveConsumer } from './graph.js';
|
|
8
|
+
import { getActiveConsumer } from './primitive/graph.js';
|
|
9
9
|
/**
|
|
10
10
|
* Asserts that the current stack frame is not within a reactive context. Useful
|
|
11
|
-
* to disallow certain code from running inside a reactive context (see {@link toSignal})
|
|
11
|
+
* to disallow certain code from running inside a reactive context (see {@link toSignal})
|
|
12
12
|
*
|
|
13
13
|
* @param debugFn a reference to the function making the assertion (used for the error message).
|
|
14
14
|
*/
|
|
@@ -3,41 +3,9 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import type { Signal } from './api.js';
|
|
9
|
-
import type { ValueEqualityFn } from './equality.js';
|
|
10
|
-
import type { ReactiveNode } from './graph.js';
|
|
11
|
-
import { SIGNAL } from './graph.js';
|
|
12
|
-
/**
|
|
13
|
-
* A computation, which derives a value from a declarative reactive expression.
|
|
14
|
-
*
|
|
15
|
-
* `Computed`s are both producers and consumers of reactivity.
|
|
16
|
-
*/
|
|
17
|
-
export interface ComputedNode<T> extends ReactiveNode {
|
|
18
|
-
/**
|
|
19
|
-
* Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`,
|
|
20
|
-
* `ERROR`).
|
|
21
|
-
*/
|
|
22
|
-
value: T;
|
|
23
|
-
/**
|
|
24
|
-
* If `value` is `ERRORED`, the error caught from the last computation attempt which will
|
|
25
|
-
* be re-thrown.
|
|
26
|
-
*/
|
|
27
|
-
error: unknown;
|
|
28
|
-
/**
|
|
29
|
-
* The computation function which will produce a new value.
|
|
30
|
-
*/
|
|
31
|
-
computation: () => T;
|
|
32
|
-
equal: ValueEqualityFn<T>;
|
|
33
|
-
}
|
|
34
|
-
export type ComputedGetter<T> = (() => T) & {
|
|
35
|
-
[SIGNAL]: ComputedNode<T>;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Create a computed signal which derives a reactive value from an expression.
|
|
39
|
-
*/
|
|
40
|
-
export declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
|
|
8
|
+
import type { Signal, ValueEqualityFn } from './api.js';
|
|
41
9
|
/**
|
|
42
10
|
* Options passed to the `computed` creation function.
|
|
43
11
|
*/
|
|
@@ -46,8 +14,13 @@ export interface CreateComputedOptions<T> {
|
|
|
46
14
|
* A comparison function which defines equality for computed values.
|
|
47
15
|
*/
|
|
48
16
|
equal?: ValueEqualityFn<T>;
|
|
17
|
+
/**
|
|
18
|
+
* A debug name for the computed signal. Used in Angular DevTools to identify the signal.
|
|
19
|
+
*/
|
|
20
|
+
debugName?: string;
|
|
49
21
|
}
|
|
50
22
|
/**
|
|
51
23
|
* Create a computed `Signal` which derives a reactive value from an expression.
|
|
24
|
+
* @see [Computed signals](guide/signals#computed-signals)
|
|
52
25
|
*/
|
|
53
26
|
export declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
|
|
@@ -1,92 +1,23 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { defaultEquals } from './equality.js';
|
|
3
|
-
import { consumerAfterComputation, consumerBeforeComputation, producerAccessed, producerUpdateValueVersion, REACTIVE_NODE, SIGNAL } from './graph.js';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const computed = () => {
|
|
11
|
-
// Check if the value needs updating before returning it.
|
|
12
|
-
producerUpdateValueVersion(node);
|
|
13
|
-
// Record that someone looked at this signal.
|
|
14
|
-
producerAccessed(node);
|
|
15
|
-
if (node.value === ERRORED) {
|
|
16
|
-
throw node.error;
|
|
17
|
-
}
|
|
18
|
-
return node.value;
|
|
19
|
-
};
|
|
20
|
-
computed[SIGNAL] = node;
|
|
21
|
-
return computed;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A dedicated symbol used before a computed value has been calculated for the first time.
|
|
25
|
-
* Explicitly typed as `any` so we can use it as signal's value.
|
|
26
|
-
*/
|
|
27
|
-
const UNSET = /* @__PURE__ */ Symbol('UNSET');
|
|
28
|
-
/**
|
|
29
|
-
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
|
|
30
|
-
* is in progress. Used to detect cycles in computation chains.
|
|
31
|
-
* Explicitly typed as `any` so we can use it as signal's value.
|
|
32
|
-
*/
|
|
33
|
-
const COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');
|
|
34
|
-
/**
|
|
35
|
-
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
|
|
36
|
-
* failed. The thrown error is cached until the computation gets dirty again.
|
|
37
|
-
* Explicitly typed as `any` so we can use it as signal's value.
|
|
38
|
-
*/
|
|
39
|
-
const ERRORED = /* @__PURE__ */ Symbol('ERRORED');
|
|
40
|
-
const COMPUTED_NODE = {
|
|
41
|
-
...REACTIVE_NODE,
|
|
42
|
-
value: UNSET,
|
|
43
|
-
dirty: true,
|
|
44
|
-
error: null,
|
|
45
|
-
equal: defaultEquals,
|
|
46
|
-
producerMustRecompute(node) {
|
|
47
|
-
// Force a recomputation if there's no current value, or if the current value is in the
|
|
48
|
-
// process of being calculated (which should throw an error).
|
|
49
|
-
return node.value === UNSET || node.value === COMPUTING;
|
|
50
|
-
},
|
|
51
|
-
producerRecomputeValue(node) {
|
|
52
|
-
if (node.value === COMPUTING) {
|
|
53
|
-
// Our computation somehow led to a cyclic read of itself.
|
|
54
|
-
throw new Error('Detected cycle in computations.');
|
|
55
|
-
}
|
|
56
|
-
const oldValue = node.value;
|
|
57
|
-
node.value = COMPUTING;
|
|
58
|
-
const prevConsumer = consumerBeforeComputation(node);
|
|
59
|
-
let newValue;
|
|
60
|
-
try {
|
|
61
|
-
newValue = node.computation();
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
newValue = ERRORED;
|
|
65
|
-
node.error = err;
|
|
66
|
-
}
|
|
67
|
-
finally {
|
|
68
|
-
consumerAfterComputation(node, prevConsumer);
|
|
69
|
-
}
|
|
70
|
-
if (oldValue !== UNSET &&
|
|
71
|
-
oldValue !== ERRORED &&
|
|
72
|
-
newValue !== ERRORED &&
|
|
73
|
-
node.equal(oldValue, newValue)) {
|
|
74
|
-
// No change to `valueVersion` - old and new values are
|
|
75
|
-
// semantically equivalent.
|
|
76
|
-
node.value = oldValue;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
node.value = newValue;
|
|
80
|
-
node.version++;
|
|
81
|
-
},
|
|
82
|
-
};
|
|
8
|
+
import { isDevMode } from '../../core.js';
|
|
9
|
+
import { SIGNAL } from '../symbol.js';
|
|
10
|
+
import { createComputed } from './primitive/computed.js';
|
|
83
11
|
/**
|
|
84
12
|
* Create a computed `Signal` which derives a reactive value from an expression.
|
|
13
|
+
* @see [Computed signals](guide/signals#computed-signals)
|
|
85
14
|
*/
|
|
86
15
|
export function computed(computation, options) {
|
|
87
|
-
const getter = createComputed(computation);
|
|
88
|
-
if (
|
|
89
|
-
|
|
16
|
+
const getter = createComputed(computation, options?.equal);
|
|
17
|
+
if (isDevMode()) {
|
|
18
|
+
const debugName = options?.debugName;
|
|
19
|
+
getter[SIGNAL].debugName = debugName;
|
|
20
|
+
getter.toString = () => `[Computed${debugName ? ' (' + debugName + ')' : ''}: ${getter()}]`;
|
|
90
21
|
}
|
|
91
22
|
return getter;
|
|
92
23
|
}
|
|
@@ -2,10 +2,12 @@ import { configureSignals } from '../api.js';
|
|
|
2
2
|
import { isSignal } from './api.js';
|
|
3
3
|
import { computed } from './computed.js';
|
|
4
4
|
import { effect } from './effect.js';
|
|
5
|
+
import { linkedSignal } from './linked_signal.js';
|
|
6
|
+
import { resource } from './resource/resource.js';
|
|
7
|
+
import { signal } from './signal.js';
|
|
5
8
|
import { toObservable } from './to-observable.js';
|
|
6
9
|
import { toSignal } from './to-signal.js';
|
|
7
10
|
import { untracked } from './untracked.js';
|
|
8
|
-
import { signal } from './writable-signal.js';
|
|
9
11
|
/**
|
|
10
12
|
* registers default signals implementation in container
|
|
11
13
|
*/
|
|
@@ -15,11 +17,13 @@ export function configureDefaultSignalsImplementation() {
|
|
|
15
17
|
computed,
|
|
16
18
|
effect,
|
|
17
19
|
untracked,
|
|
20
|
+
linkedSignal,
|
|
21
|
+
resource,
|
|
18
22
|
isSignal,
|
|
19
23
|
toSignal,
|
|
20
24
|
toObservable,
|
|
21
25
|
isInSignalsInjectionContext: () => true,
|
|
22
26
|
getCurrentSignalsInjector: () => null,
|
|
23
|
-
runInSignalsInjectionContext: (_, fn) => fn()
|
|
27
|
+
runInSignalsInjectionContext: (_, fn) => fn(),
|
|
24
28
|
});
|
|
25
29
|
}
|
|
@@ -1,45 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
1
|
+
/** biome-ignore-all lint: <explanation> */
|
|
8
2
|
import type { SignalsInjector } from '../api.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* previous effect run might have started.
|
|
13
|
-
*/
|
|
14
|
-
export type EffectCleanupFn = () => void;
|
|
15
|
-
/**
|
|
16
|
-
* A callback passed to the effect function that makes it possible to register cleanup logic.
|
|
17
|
-
*/
|
|
18
|
-
export type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
|
|
19
|
-
export interface SchedulableEffect {
|
|
20
|
-
run(): void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* A scheduler which manages the execution of effects.
|
|
24
|
-
*/
|
|
25
|
-
export declare abstract class EffectScheduler {
|
|
26
|
-
/**
|
|
27
|
-
* Schedule the given effect to be executed at a later time.
|
|
28
|
-
*
|
|
29
|
-
* It is an error to attempt to execute any effects synchronously during a scheduling operation.
|
|
30
|
-
*/
|
|
31
|
-
abstract scheduleEffect(e: SchedulableEffect): void;
|
|
32
|
-
/**
|
|
33
|
-
* Run any scheduled effects.
|
|
34
|
-
*/
|
|
35
|
-
abstract flush(): void;
|
|
36
|
-
}
|
|
37
|
-
export declare class TstdlEffectScheduler implements EffectScheduler {
|
|
38
|
-
private readonly queue;
|
|
39
|
-
private hasPendingFlush;
|
|
40
|
-
scheduleEffect(effect: SchedulableEffect): void;
|
|
41
|
-
flush(): void;
|
|
42
|
-
}
|
|
3
|
+
import { SIGNAL } from '../symbol.js';
|
|
4
|
+
import { type BaseEffectNode } from './primitive/effect.js';
|
|
5
|
+
import { type EffectScheduler, type SchedulableEffect } from './root_effect_scheduler.js';
|
|
43
6
|
/**
|
|
44
7
|
* A global reactive effect, which can be manually destroyed.
|
|
45
8
|
*/
|
|
@@ -49,8 +12,15 @@ export interface EffectRef {
|
|
|
49
12
|
*/
|
|
50
13
|
destroy(): void;
|
|
51
14
|
}
|
|
15
|
+
export declare class EffectRefImpl implements EffectRef {
|
|
16
|
+
[SIGNAL]: EffectNode;
|
|
17
|
+
constructor(node: EffectNode);
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
52
20
|
/**
|
|
53
21
|
* Options passed to the `effect` function.
|
|
22
|
+
*
|
|
23
|
+
* @publicApi 20.0
|
|
54
24
|
*/
|
|
55
25
|
export interface CreateEffectOptions {
|
|
56
26
|
/**
|
|
@@ -65,17 +35,66 @@ export interface CreateEffectOptions {
|
|
|
65
35
|
*
|
|
66
36
|
* If this is `false` (the default) the effect will automatically register itself to be cleaned up
|
|
67
37
|
* with the current `DestroyRef`.
|
|
38
|
+
*
|
|
39
|
+
* If this is `true` and you want to use the effect outside an injection context, you still
|
|
40
|
+
* need to provide an `Injector` to the effect.
|
|
68
41
|
*/
|
|
69
42
|
manualCleanup?: boolean;
|
|
70
43
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* Using effects to synchronize data by writing to signals can lead to confusing and potentially
|
|
74
|
-
* incorrect behavior, and should be enabled only when necessary.
|
|
44
|
+
* @deprecated no longer required, signal writes are allowed by default.
|
|
75
45
|
*/
|
|
76
46
|
allowSignalWrites?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A debug name for the effect. Used in Angular DevTools to identify the effect.
|
|
49
|
+
*/
|
|
50
|
+
debugName?: string;
|
|
77
51
|
}
|
|
78
52
|
/**
|
|
79
|
-
*
|
|
53
|
+
* An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
|
|
54
|
+
* before the next effect run. The cleanup function makes it possible to "cancel" any work that the
|
|
55
|
+
* previous effect run might have started.
|
|
56
|
+
*
|
|
57
|
+
* @see [Effect cleanup functions](guide/signals#effect-cleanup-functions)
|
|
58
|
+
*
|
|
59
|
+
* @publicApi 20.0
|
|
60
|
+
*/
|
|
61
|
+
export type EffectCleanupFn = () => void;
|
|
62
|
+
/**
|
|
63
|
+
* A callback passed to the effect function that makes it possible to register cleanup logic.
|
|
64
|
+
*
|
|
65
|
+
* @see [Effect cleanup functions](guide/signals#effect-cleanup-functions)
|
|
66
|
+
*
|
|
67
|
+
* @publicApi 20.0
|
|
68
|
+
*/
|
|
69
|
+
export type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Registers an "effect" that will be scheduled & executed whenever the signals that it reads
|
|
72
|
+
* changes.
|
|
73
|
+
*
|
|
74
|
+
* Angular has two different kinds of effect: component effects and root effects. Component effects
|
|
75
|
+
* are created when `effect()` is called from a component, directive, or within a service of a
|
|
76
|
+
* component/directive. Root effects are created when `effect()` is called from outside the
|
|
77
|
+
* component tree, such as in a root service.
|
|
78
|
+
*
|
|
79
|
+
* The two effect types differ in their timing. Component effects run as a component lifecycle
|
|
80
|
+
* event during Angular's synchronization (change detection) process, and can safely read input
|
|
81
|
+
* signals or create/destroy views that depend on component state. Root effects run as microtasks
|
|
82
|
+
* and have no connection to the component tree or change detection.
|
|
83
|
+
*
|
|
84
|
+
* `effect()` must be run in injection context, unless the `injector` option is manually specified.
|
|
85
|
+
*
|
|
86
|
+
* @see [Effects](guide/signals#effects)
|
|
87
|
+
*
|
|
88
|
+
* @publicApi 20.0
|
|
80
89
|
*/
|
|
81
90
|
export declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
|
|
91
|
+
export interface EffectNode extends BaseEffectNode, SchedulableEffect {
|
|
92
|
+
cleanupFns: EffectCleanupFn[] | undefined;
|
|
93
|
+
onDestroyFns: (() => void)[] | null;
|
|
94
|
+
}
|
|
95
|
+
export interface RootEffectNode extends EffectNode {
|
|
96
|
+
scheduler: EffectScheduler;
|
|
97
|
+
}
|
|
98
|
+
export declare const EFFECT_NODE: Omit<EffectNode, 'fn' | 'destroy' | 'injector' | 'notifier'>;
|
|
99
|
+
export declare const ROOT_EFFECT_NODE: Omit<RootEffectNode, 'fn' | 'scheduler' | 'notifier' | 'injector'>;
|
|
100
|
+
export declare function createRootEffect(fn: (onCleanup: EffectCleanupRegisterFn) => void, scheduler: EffectScheduler): RootEffectNode;
|