From 3699454b1e6aa8451ac05a61a67b41531815ffbe Mon Sep 17 00:00:00 2001 From: Vitali Semianiaka Date: Mon, 9 Feb 2026 17:37:51 +0300 Subject: [PATCH] first component def --- basics/calculator.md | 69 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 basics/calculator.md 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 + + + +```