diff --git a/basics/calculator.md b/basics/calculator.md new file mode 100644 index 0000000..24a2b97 --- /dev/null +++ b/basics/calculator.md @@ -0,0 +1,69 @@ +# Component definitions + +## Simple calculator + +> nuget source //code.sharp8n.com/api/packages/Sharp8N/nuget/index.json +> nuget package S8n.Components.Basics + +```yaml +code: basics.calculator +description: Do simple operations for numbers in `args` input. +inputs: + - operator: string enum { add, subtract, multiply, divide } + - args: object[] +outputs: + - result: object +class: S8n.Components.Basics.Calculator +methods: Calc() +``` + +## Generic version + +```yaml +code: basics.calculator +description: Do simple operations for numbers in `args` input. T typeof INumberBase<> +inputs: + - operator: string enum { add, subtract, multiply, divide } + - args: T[] +outputs: + - result: T +class: S8n.Components.Basics.Calculator +methods: Calc() +``` + +```vue + + + +```