<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<
typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>
>
<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(
tag: Tag,
extended: Shapes
): ReturnType<
typeof facetStoreRegistration<
Tag,
QueueStoreAnalyticsContract<Tag>,
Shapes
>
>Register this queue on an app Store.Service — built-in analytics spec with the tag's
itemSchema injected. Pass a bare spec object to add app-specific methods (merged with built-in):
WorkPool.store(Mail)
WorkPool.store(Mail, {
campaignAudit: campaignAuditSchema,
}, ({ campaignAudit, entry }) => ({
appendCampaignAudit: campaignAudit.append,
}))export function function store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>> (+1 overload)Register this queue on an app
Store.Service
— built-in analytics spec with the tag's
itemSchema injected. Pass a bare spec object to add app-specific methods (merged with built-in):
WorkPool.store(Mail)
WorkPool.store(Mail, {
campaignAudit: campaignAuditSchema,
}, ({ campaignAudit, entry }) => ({
appendCampaignAudit: campaignAudit.append,
}))
store<const function (type parameter) Tag in store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>>Tag extends QueueStoreTag>(tag: const Tag extends QueueStoreTagtag: function (type parameter) Tag in store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>>Tag): type ReturnType<
T extends (...args: any) => any
> = T extends (...args: any) => infer R ? R : any
Obtain the return type of a function type
ReturnType<
typeof function facetStoreRegistration<const Tag extends StoreScopeTag, const BuiltIn extends Store.StoreContractValue>(tag: Tag, builtIn: BuiltIn): RegisteredWithContract<ScopeKeyOf<Tag>, BuiltIn["spec"], BuiltIn, Tag> (+2 overloads)facetStoreRegistration<function (type parameter) Tag in store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>>Tag, type QueueStoreAnalyticsContract<Tag extends QueueStoreTag> = StoreContractDef<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<Tag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}> & Pipeable
The read-extended analytics contract type for a tag.
QueueStoreAnalyticsContract<function (type parameter) Tag in store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>>Tag>>
>;
export function function store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>> (+1 overload)Register this queue on an app
Store.Service
— built-in analytics spec with the tag's
itemSchema injected. Pass a bare spec object to add app-specific methods (merged with built-in):
WorkPool.store(Mail)
WorkPool.store(Mail, {
campaignAudit: campaignAuditSchema,
}, ({ campaignAudit, entry }) => ({
appendCampaignAudit: campaignAudit.append,
}))
store<
const function (type parameter) Tag in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Tag extends QueueStoreTag,
const function (type parameter) Shapes in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Shapes extends type StoreShapes = {
readonly [x: string]: Store.StoreShapeInput;
}
StoreShapes,
>(tag: const Tag extends QueueStoreTagtag: function (type parameter) Tag in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Tag, extended: const Shapes extends StoreShapesextended: function (type parameter) Shapes in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Shapes): type ReturnType<
T extends (...args: any) => any
> = T extends (...args: any) => infer R ? R : any
Obtain the return type of a function type
ReturnType<
typeof function facetStoreRegistration<const Tag extends StoreScopeTag, const BuiltIn extends Store.StoreContractValue>(tag: Tag, builtIn: BuiltIn): RegisteredWithContract<ScopeKeyOf<Tag>, BuiltIn["spec"], BuiltIn, Tag> (+2 overloads)facetStoreRegistration<function (type parameter) Tag in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Tag, type QueueStoreAnalyticsContract<Tag extends QueueStoreTag> = StoreContractDef<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<Tag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}> & Pipeable
The read-extended analytics contract type for a tag.
QueueStoreAnalyticsContract<function (type parameter) Tag in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Tag>, function (type parameter) Shapes in store<const Tag extends QueueStoreTag, const Shapes extends StoreShapes>(tag: Tag, extended: Shapes): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>, Shapes>>Shapes>
>;
export function function store<const Tag extends QueueStoreTag>(tag: Tag): ReturnType<typeof facetStoreRegistration<Tag, QueueStoreAnalyticsContract<Tag>>> (+1 overload)Register this queue on an app
Store.Service
— built-in analytics spec with the tag's
itemSchema injected. Pass a bare spec object to add app-specific methods (merged with built-in):
WorkPool.store(Mail)
WorkPool.store(Mail, {
campaignAudit: campaignAuditSchema,
}, ({ campaignAudit, entry }) => ({
appendCampaignAudit: campaignAudit.append,
}))
store(tag: QueueStoreTag(parameter) tag: {
key: string;
}
tag: QueueStoreTag, extended: | Readonly<
Record<string, Store.StoreShapeInput>
>
| undefined
extended?: type StoreShapes = {
readonly [x: string]: Store.StoreShapeInput;
}
StoreShapes) {
const const contract: Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>
contract = makeQueueStoreAnalyticsContract<QueueStoreTag>(tag: QueueStoreTag): Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<...>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>
Build the read-extended analytics contract for a queue tag — the lean base (event shape →
record + events)
Store.extend
ed with the advanced analytics reads
(
QueueStoreReads
). Because extend is fed the base alongside its methods builder, the
concrete read-method types survive onto the resolved handle (see the concrete-preservation
guarantee on
Store.extend
). Pure derivations close over the event shape's read;
changes() resolves the live journal stream via
Store.changes
on the base contract
(whose event shape it selects).
makeQueueStoreAnalyticsContract(tag: QueueStoreTag(parameter) tag: {
key: string;
}
tag);
return extended: | Readonly<
Record<string, Store.StoreShapeInput>
>
| undefined
extended === var undefinedundefined
? facetStoreRegistration<QueueStoreTag, Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<...>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>>(tag: QueueStoreTag, builtIn: Store.StoreContractValue<...>): RegisteredWithContract<...> (+2 overloads)
facetStoreRegistration(tag: QueueStoreTag(parameter) tag: {
key: string;
}
tag, const contract: Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>
contract)
: facetStoreRegistration<QueueStoreTag, Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<...>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>, Readonly<...>>(tag: QueueStoreTag, builtIn: Store.StoreContractValue<...>, extended: Readonly<...>): RegisteredWithContract<...> (+2 overloads)
facetStoreRegistration(tag: QueueStoreTag(parameter) tag: {
key: string;
}
tag, const contract: Store.StoreContractValue<{
readonly event: Store.StoreShapeDef<Schema.Union<readonly [Schema.TaggedStruct<"Start", {
readonly key: Schema.String;
}>, Schema.TaggedStruct<"Enqueued", {
readonly entries: Schema.$Array<Schema.Struct<{
readonly item: QueueItemSchemaFromTag<QueueStoreTag>;
readonly entryId: Schema.String;
readonly key: Schema.optional<Schema.String>;
readonly priority: Schema.Literals<readonly ["high", "normal", "low"]>;
readonly attempts: Schema.Number;
readonly timestamps: Schema.Struct<{
readonly enqueuedAt: Schema.DateTimeUtc;
readonly startedAt: Schema.optionalKey<Schema.DateTimeUtc>;
readonly completedAt: Schema.optionalKey<...>;
readonly interruptedAt: Schema.optionalKey<...>;
}>;
readonly batchId: Schema.optional<...>;
readonly releaseId: Schema.optional<...>;
readonly sourceHyperlinkId: Schema.optional<...>;
readonly attributes: Schema.optional<...>;
}>>;
readonly priority: Schema.Literals<...>;
readonly batchId: Schema.optionalKey<...>;
}>, ... 12 more ..., Schema.TaggedStruct<...>]>>;
} & ImplicitLogShape, {
...;
} & {
...;
}>
contract, extended: Readonly<
Record<string, Store.StoreShapeInput>
>
extended);
}