Skip to content

Commit

Permalink
types: Improve types on proxyHyperDurables
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Frank committed Jun 15, 2022
1 parent 89af18e commit ba059af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ticketbridge/hyper-durable",
"version": "0.1.15",
"version": "0.1.16",
"description": "Object-like access to Durable Object properties and methods",
"repository": {
"type": "git",
Expand Down
7 changes: 4 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ export class HyperNamespaceProxy<DO extends HyperDurable<any, Env>, Env> {
get(id: DurableObjectId): HyperStub<DO, Env>;
}

export function proxyHyperDurables<DO extends HyperDurable<any, Env>, Env>(
// TODO: Don't rely on undocumented behavior
export function proxyHyperDurables<Bindings extends Record<K, typeof DO>, Env, K extends string, DO extends HyperDurable<any, Env>>(
env: Env,
doBindings: { [key: string]: new (state: DurableObjectState, env: Env) => DO }
doBindings: Bindings
): {
[Prop in keyof typeof doBindings]: HyperNamespaceProxy<DO, Env>
[Prop in keyof Bindings]: HyperNamespaceProxy<Bindings[Prop], Env>
}

0 comments on commit ba059af

Please sign in to comment.