domain-glossary-procedure
Version:
A declaration of intuitive and unambiguous **Procedure** resources and mechanisms.
41 lines (27 loc) • 955 B
Markdown


A declaration of intuitive and unambiguous **Procedure** resources and mechanisms.
declare a ubiquitious language for
- resources related to `Procedure`s
- Procedure
- mechanisms related to `Procedure`s
- etc
```sh
npm install domain-glossary-procedure
```
```ts
// given: a simple procedure
const doIt: Procedure<{ reason: string }, void, { done: true }> = (input: {
reason: string;
}) => {
return { done: true };
};
// then: can extract the output type
const reason: ProcedureInput<typeof doIt>['reason'] = '821'; // ✅ knows that reason is a string
const reason: ProcedureInput<typeof doIt>['reason'] = 821; // 🛑 errors that reason is not a number
```