Attribute
查看 MarkdownThis page lists the TypeScript SDK names for Attributes. The doc comment of each API gives its parameters, defaults, and errors. Read them in the TypeScript SDK API reference.
API names
| Task | TypeScript API | Dex behavior |
|---|---|---|
| Define a singleton Attribute | Attribute | Attributes |
| Define an AttributeMap | AttributeMap | Attributes |
| Declare it in the Flow | attributes of the PersistenceSchema returned from getPersistenceSchema | Flow definition |
| Read, write, and delete a value in a Step or RPC | get, set, and delete | Commits |
| Address one AttributeMap instance | AttributeMap.instance, or the instance argument of get, set, and delete | Attributes |
| Count AttributeMap instances and list their keys | AttributeMap.getMapSize and AttributeMap.getAllInstanceKeys | Selective state loading |
| Load AttributeMap values for a method | AttributeMap.load, with the load fields of StepOptions or RPCOptions | Selective state loading |
| Lock a value for a read-modify-write | lock, with the lock fields of StepOptions or lockAttributes of RPCOptions | Locks |
| Index a value for search | AttributeIndex and IndexType | Indexes |
| Project writes to an Attribute Store | syncToAttributeStore | Attribute sync |
| Store a value that can be erased | hardDeleteOnNull | Hard-delete Attributes |
| Set a value when the Flow starts | attributes of StartFlowOptions, with InitialAttribute.of or InitialAttribute.mapValue | Attributes at start |
| Read values from outside the Flow | Client.getAttributes | Read Attributes |
| Wait until a value matches | Client.waitForAttributeMatch | Wait for an Attribute match |
Example
Example: examples/typescript/src/primitives/attribute/attribute-flow.ts