This library cannot be used without casting ctx as unknown as ExecutionContext or any while instantiate in latest DurableObject that extends DurableObject class:
export class TestServiceDurableObject extends DurableObject {
private readonly logger: BaselimeLogger;
public constructor(state: DurableObjectState, environment: Environment) {
super(state, environment);
this.logger = new BaselimeLogger({
apiKey: environment[TestSecrets.baselimeApiKey],
ctx: state,
isLocalDev: environment.IS_LOCAL_DEV === "true",
service: "test-service",
namespace: "test-service-durable-object",
});
}
public async sayHello(name: string): Promise<string> {
return `Hello, ${name}!`;
}
}
this is because DurableObjectState which is an execution context doesn't implement passThroughOnException(): void; from ExecutionContext. But I can see that you are using only waitUntil(promise: Promise<any>): void; from this type so this context type could be narrowed to use this library without type casting.
This library cannot be used without casting ctx
as unknown as ExecutionContextoranywhile instantiate in latest DurableObject that extendsDurableObjectclass:this is because
DurableObjectStatewhich is an execution context doesn't implementpassThroughOnException(): void;fromExecutionContext. But I can see that you are using onlywaitUntil(promise: Promise<any>): void;from this type so this context type could be narrowed to use this library without type casting.