```interface SESSIONInterface

interface SESSIONInterface {
session: TokenResponse | null;
created: boolean;
createdDate: Date;
endOfLife: number;
state: DurableObjectState;
app: Hono;
}
interface SESSIONInterface {
session: TokenResponse | null;
created: boolean;
createdDate: Date;
endOfLife: number;
state: DurableObjectState;
app: Hono;
}
4 Replies
Erwin
Erwin3y ago
That makes sense because the type of stored is Map<string, SESSIONInterface["session" | ... | ...]>> So according to your type, every value in that map could be any of the types. Is there a particular reason you store them in separate keys btw>
janat08
janat08OP3y ago
no other than not knowing if it will merge or replace
Erwin
Erwin3y ago
If you always save the entire object, you should be good.
janat08
janat08OP3y ago
You couldve typed in like so: type OptionsFlags<Type> = { [Property in keyof Type]: Type[Property]; }; Is there an actual way of typing it currently on my side that removes the error?
Want results from more Discord servers?
Add your server