Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Type definition missing for KVNamespace.getWithMetadata() #57

Closed
neodon opened this issue Aug 19, 2020 · 3 comments
Closed

Type definition missing for KVNamespace.getWithMetadata() #57

neodon opened this issue Aug 19, 2020 · 3 comments

Comments

@neodon
Copy link

neodon commented Aug 19, 2020

Thank you for maintaining this package--it makes writing worker code so much easier.

I noticed there is a new method for KVNamespace: getWithMetadata(). It is not in the type definitions, however, so I've had to patch it in myself:

declare global {
  export interface KVNamespace {
    getWithMetadata(key: string): KVValue<{ value: string; metadata: any }>
  }
}

I'm sure that is not quite the best way to type the function. If you could add the proper type definition, I will give my cat an extra treat.

I may attempt to add the proper type definition and submit a PR.

@GregBrimble
Copy link
Member

Hey @neodon ! I've got a PR up for just that right here, #54 . We were just getting it reviewed, but it slipped through the cracks. We'll try get it merged in shortly.

cc @ispivey

@neodon
Copy link
Author

neodon commented Aug 19, 2020

Thank you! My PR looked quite similar, but I missed a couple things. Glad you're already on top of things.

@koeninger
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants