mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
57308c46af
* chore: resolve no-redundant-type-constituents and test/mock no-explicit-any warnings Clears 36 lint warnings: all 5 no-redundant-type-constituents, 6 no-misused-spread (via narrowing getPartitionWhereClause's return type to WhereAttributeHash), and 25 no-explicit-any in test/mock files. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: resolve no-base-to-string warnings in tests Convert userProvisioner try/catch error assertions to Jest's .rejects.toThrow() idiom, and cast webhook test body to string. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: resolve no-explicit-any warnings in cancan and tracing Tighten types in the cancan policy framework and tracing decorators. Constructor / generic-function upper bounds keep `any` where TypeScript variance requires it, scoped to single-line oxlint-disable comments. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
42 lines
605 B
TypeScript
42 lines
605 B
TypeScript
export default class Queue {
|
|
done() {
|
|
//
|
|
}
|
|
|
|
on() {
|
|
//
|
|
}
|
|
|
|
count() {
|
|
return 0;
|
|
}
|
|
|
|
getDelayedCount() {
|
|
return 0;
|
|
}
|
|
|
|
add = function (data: unknown) {
|
|
const job = this.createJob(data);
|
|
|
|
if (!this.handler) {
|
|
return;
|
|
}
|
|
|
|
this.handler(job, this.done);
|
|
};
|
|
|
|
process = function (handler: (job: unknown, done: () => void) => void) {
|
|
if (this.handler) {
|
|
throw Error("Cannot define a handler more than once per Queue instance");
|
|
}
|
|
|
|
this.handler = handler;
|
|
};
|
|
|
|
createJob = function (data: unknown) {
|
|
return {
|
|
data,
|
|
};
|
|
};
|
|
}
|