Constructs a DurableObjectBinding instance.
Optionalsettings: DurableObjectSettings
Resolved settings. Defaults to resolve('durableObject'), so callers
normally construct this with no arguments at all.
Private Optional ReadonlylocationDefault location hint applied when creating stubs.
Private ReadonlysettingsThis accessor’s settings, resolved on first read.
The binding name this instance resolves.
The binding name as declared in wrangler.json.
Derives the object id for a name without creating a stub.
The Worker environment.
The name to derive the object id from.
The derived object id.
Checks whether the binding is available on the given environment.
Use this to degrade gracefully when a binding is optional.
The Worker environment.
true when the binding is present.
Resolves the binding, failing fast when it is not configured.
The Worker environment.
The resolved binding.
MissingBindingError When the binding is absent from the environment.
Returns the stub for an existing object id.
The Worker environment.
The object id, either as an id or its string form.
The stub for that object.
Returns the stub for the object derived from a name.
The same name always maps to the same object, which is what makes this the usual way to shard state by tenant, room, or user.
The Worker environment.
The name to derive the object id from.
The stub for that object.
MissingBindingError When the Durable Object binding is absent.
Creates a brand new object and returns its stub.
The Worker environment.
The stub for the newly created object.
PrivatestubBuilds the stub options carrying the configured location hint.
The stub options, or undefined when no hint is configured.
Resolves the binding without throwing.
The Worker environment.
The resolved binding, or null when it is not configured.
Accessor for the Durable Object namespace binding (
durable_objectsinwrangler.json).Example
Author
Bayu Dwiyan Satria
Version
1.0.0
Since
1.0.0