openalgo-script 0.1.0-alpha.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1200 -0
- package/README.md +49 -28
- package/dist/adapters/charts/alerts.d.ts +70 -0
- package/dist/adapters/charts/alerts.d.ts.map +1 -0
- package/dist/adapters/charts/alerts.js +52 -0
- package/dist/adapters/charts/alerts.js.map +1 -0
- package/dist/adapters/charts/bars.d.ts +39 -0
- package/dist/adapters/charts/bars.d.ts.map +1 -0
- package/dist/adapters/charts/bars.js +32 -0
- package/dist/adapters/charts/bars.js.map +1 -0
- package/dist/adapters/charts/candles.d.ts +40 -0
- package/dist/adapters/charts/candles.d.ts.map +1 -0
- package/dist/adapters/charts/candles.js +85 -0
- package/dist/adapters/charts/candles.js.map +1 -0
- package/dist/adapters/charts/colours.d.ts +47 -0
- package/dist/adapters/charts/colours.d.ts.map +1 -0
- package/dist/adapters/charts/colours.js +80 -0
- package/dist/adapters/charts/colours.js.map +1 -0
- package/dist/adapters/charts/columns.d.ts +37 -0
- package/dist/adapters/charts/columns.d.ts.map +1 -0
- package/dist/adapters/charts/columns.js +56 -0
- package/dist/adapters/charts/columns.js.map +1 -0
- package/dist/adapters/charts/contract.d.ts +278 -0
- package/dist/adapters/charts/contract.d.ts.map +1 -0
- package/dist/adapters/charts/contract.js +2 -0
- package/dist/adapters/charts/contract.js.map +1 -0
- package/dist/adapters/charts/descriptor.d.ts +48 -0
- package/dist/adapters/charts/descriptor.d.ts.map +1 -0
- package/dist/adapters/charts/descriptor.js +111 -0
- package/dist/adapters/charts/descriptor.js.map +1 -0
- package/dist/adapters/charts/drawings.d.ts +43 -0
- package/dist/adapters/charts/drawings.d.ts.map +1 -0
- package/dist/adapters/charts/drawings.js +172 -0
- package/dist/adapters/charts/drawings.js.map +1 -0
- package/dist/adapters/charts/errors.d.ts +28 -0
- package/dist/adapters/charts/errors.d.ts.map +1 -0
- package/dist/adapters/charts/errors.js +21 -0
- package/dist/adapters/charts/errors.js.map +1 -0
- package/dist/adapters/charts/fields.d.ts +33 -0
- package/dist/adapters/charts/fields.d.ts.map +1 -0
- package/dist/adapters/charts/fields.js +51 -0
- package/dist/adapters/charts/fields.js.map +1 -0
- package/dist/adapters/charts/fills.d.ts +23 -0
- package/dist/adapters/charts/fills.d.ts.map +1 -0
- package/dist/adapters/charts/fills.js +48 -0
- package/dist/adapters/charts/fills.js.map +1 -0
- package/dist/adapters/charts/index.d.ts +37 -0
- package/dist/adapters/charts/index.d.ts.map +1 -0
- package/dist/adapters/charts/index.js +33 -0
- package/dist/adapters/charts/index.js.map +1 -0
- package/dist/adapters/charts/levels.d.ts +39 -0
- package/dist/adapters/charts/levels.d.ts.map +1 -0
- package/dist/adapters/charts/levels.js +61 -0
- package/dist/adapters/charts/levels.js.map +1 -0
- package/dist/adapters/charts/markers.d.ts +41 -0
- package/dist/adapters/charts/markers.d.ts.map +1 -0
- package/dist/adapters/charts/markers.js +75 -0
- package/dist/adapters/charts/markers.js.map +1 -0
- package/dist/adapters/charts/paint.d.ts +61 -0
- package/dist/adapters/charts/paint.d.ts.map +1 -0
- package/dist/adapters/charts/paint.js +47 -0
- package/dist/adapters/charts/paint.js.map +1 -0
- package/dist/adapters/charts/plots.d.ts +39 -0
- package/dist/adapters/charts/plots.d.ts.map +1 -0
- package/dist/adapters/charts/plots.js +117 -0
- package/dist/adapters/charts/plots.js.map +1 -0
- package/dist/adapters/charts/produced.d.ts +57 -0
- package/dist/adapters/charts/produced.d.ts.map +1 -0
- package/dist/adapters/charts/produced.js +11 -0
- package/dist/adapters/charts/produced.js.map +1 -0
- package/dist/adapters/charts/requests.d.ts +114 -0
- package/dist/adapters/charts/requests.d.ts.map +1 -0
- package/dist/adapters/charts/requests.js +277 -0
- package/dist/adapters/charts/requests.js.map +1 -0
- package/dist/adapters/charts/run.d.ts +147 -0
- package/dist/adapters/charts/run.d.ts.map +1 -0
- package/dist/adapters/charts/run.js +148 -0
- package/dist/adapters/charts/run.js.map +1 -0
- package/dist/adapters/charts/settings.d.ts +78 -0
- package/dist/adapters/charts/settings.d.ts.map +1 -0
- package/dist/adapters/charts/settings.js +225 -0
- package/dist/adapters/charts/settings.js.map +1 -0
- package/dist/adapters/charts/surfaces.d.ts +204 -0
- package/dist/adapters/charts/surfaces.d.ts.map +1 -0
- package/dist/adapters/charts/surfaces.js +2 -0
- package/dist/adapters/charts/surfaces.js.map +1 -0
- package/dist/adapters/charts/tables.d.ts +65 -0
- package/dist/adapters/charts/tables.d.ts.map +1 -0
- package/dist/adapters/charts/tables.js +84 -0
- package/dist/adapters/charts/tables.js.map +1 -0
- package/dist/core/catalogue/catalogue.generated.d.ts +98 -10
- package/dist/core/catalogue/catalogue.generated.d.ts.map +1 -1
- package/dist/core/catalogue/catalogue.generated.js +17 -9
- package/dist/core/catalogue/catalogue.generated.js.map +1 -1
- package/dist/core/catalogue/values.generated.d.ts +25 -0
- package/dist/core/catalogue/values.generated.d.ts.map +1 -1
- package/dist/core/check/arguments.d.ts +41 -0
- package/dist/core/check/arguments.d.ts.map +1 -0
- package/dist/core/check/arguments.js +84 -0
- package/dist/core/check/arguments.js.map +1 -0
- package/dist/core/check/call-sites.d.ts +22 -0
- package/dist/core/check/call-sites.d.ts.map +1 -0
- package/dist/core/check/call-sites.js +329 -0
- package/dist/core/check/call-sites.js.map +1 -0
- package/dist/core/check/call-warmup.d.ts +37 -0
- package/dist/core/check/call-warmup.d.ts.map +1 -0
- package/dist/core/check/call-warmup.js +97 -0
- package/dist/core/check/call-warmup.js.map +1 -0
- package/dist/core/check/calls.d.ts +33 -0
- package/dist/core/check/calls.d.ts.map +1 -0
- package/dist/core/check/calls.js +348 -0
- package/dist/core/check/calls.js.map +1 -0
- package/dist/core/check/check.d.ts +23 -0
- package/dist/core/check/check.d.ts.map +1 -0
- package/dist/core/check/check.js +163 -0
- package/dist/core/check/check.js.map +1 -0
- package/dist/core/check/checked.d.ts +198 -0
- package/dist/core/check/checked.d.ts.map +1 -0
- package/dist/core/check/checked.js +19 -0
- package/dist/core/check/checked.js.map +1 -0
- package/dist/core/check/checker.d.ts +182 -0
- package/dist/core/check/checker.d.ts.map +1 -0
- package/dist/core/check/checker.js +280 -0
- package/dist/core/check/checker.js.map +1 -0
- package/dist/core/check/conditional.d.ts +35 -0
- package/dist/core/check/conditional.d.ts.map +1 -0
- package/dist/core/check/conditional.js +100 -0
- package/dist/core/check/conditional.js.map +1 -0
- package/dist/core/check/constant.d.ts +47 -0
- package/dist/core/check/constant.d.ts.map +1 -0
- package/dist/core/check/constant.js +101 -0
- package/dist/core/check/constant.js.map +1 -0
- package/dist/core/check/declaration.d.ts +33 -0
- package/dist/core/check/declaration.d.ts.map +1 -0
- package/dist/core/check/declaration.js +181 -0
- package/dist/core/check/declaration.js.map +1 -0
- package/dist/core/check/expressions.d.ts +36 -0
- package/dist/core/check/expressions.d.ts.map +1 -0
- package/dist/core/check/expressions.js +398 -0
- package/dist/core/check/expressions.js.map +1 -0
- package/dist/core/check/functions.d.ts +31 -0
- package/dist/core/check/functions.d.ts.map +1 -0
- package/dist/core/check/functions.js +238 -0
- package/dist/core/check/functions.js.map +1 -0
- package/dist/core/check/handles.d.ts +48 -0
- package/dist/core/check/handles.d.ts.map +1 -0
- package/dist/core/check/handles.js +43 -0
- package/dist/core/check/handles.js.map +1 -0
- package/dist/core/check/index.d.ts +30 -0
- package/dist/core/check/index.d.ts.map +1 -0
- package/dist/core/check/index.js +26 -0
- package/dist/core/check/index.js.map +1 -0
- package/dist/core/check/library-bars.d.ts +7 -0
- package/dist/core/check/library-bars.d.ts.map +1 -0
- package/dist/core/check/library-bars.js +181 -0
- package/dist/core/check/library-bars.js.map +1 -0
- package/dist/core/check/library-orders.d.ts +5 -0
- package/dist/core/check/library-orders.d.ts.map +1 -0
- package/dist/core/check/library-orders.js +250 -0
- package/dist/core/check/library-orders.js.map +1 -0
- package/dist/core/check/library-output.d.ts +7 -0
- package/dist/core/check/library-output.d.ts.map +1 -0
- package/dist/core/check/library-output.js +195 -0
- package/dist/core/check/library-output.js.map +1 -0
- package/dist/core/check/library-series.d.ts +3 -0
- package/dist/core/check/library-series.d.ts.map +1 -0
- package/dist/core/check/library-series.js +415 -0
- package/dist/core/check/library-series.js.map +1 -0
- package/dist/core/check/library.d.ts +204 -0
- package/dist/core/check/library.d.ts.map +1 -0
- package/dist/core/check/library.js +198 -0
- package/dist/core/check/library.js.map +1 -0
- package/dist/core/check/literals.d.ts +19 -0
- package/dist/core/check/literals.d.ts.map +1 -0
- package/dist/core/check/literals.js +22 -0
- package/dist/core/check/literals.js.map +1 -0
- package/dist/core/check/outputs.d.ts +31 -0
- package/dist/core/check/outputs.d.ts.map +1 -0
- package/dist/core/check/outputs.js +113 -0
- package/dist/core/check/outputs.js.map +1 -0
- package/dist/core/check/statements.d.ts +25 -0
- package/dist/core/check/statements.d.ts.map +1 -0
- package/dist/core/check/statements.js +377 -0
- package/dist/core/check/statements.js.map +1 -0
- package/dist/core/check/suggest.d.ts +25 -0
- package/dist/core/check/suggest.d.ts.map +1 -0
- package/dist/core/check/suggest.js +61 -0
- package/dist/core/check/suggest.js.map +1 -0
- package/dist/core/check/surface.d.ts +38 -0
- package/dist/core/check/surface.d.ts.map +1 -0
- package/dist/core/check/surface.js +100 -0
- package/dist/core/check/surface.js.map +1 -0
- package/dist/core/check/tags.d.ts +4 -0
- package/dist/core/check/tags.d.ts.map +1 -0
- package/dist/core/check/tags.js +54 -0
- package/dist/core/check/tags.js.map +1 -0
- package/dist/core/check/types.d.ts +153 -0
- package/dist/core/check/types.d.ts.map +1 -0
- package/dist/core/check/types.js +221 -0
- package/dist/core/check/types.js.map +1 -0
- package/dist/core/check/warmup.d.ts +73 -0
- package/dist/core/check/warmup.d.ts.map +1 -0
- package/dist/core/check/warmup.js +62 -0
- package/dist/core/check/warmup.js.map +1 -0
- package/dist/core/diagnostics/collector.d.ts +12 -0
- package/dist/core/diagnostics/collector.d.ts.map +1 -1
- package/dist/core/diagnostics/collector.js +27 -1
- package/dist/core/diagnostics/collector.js.map +1 -1
- package/dist/core/emit/calls.d.ts +38 -0
- package/dist/core/emit/calls.d.ts.map +1 -0
- package/dist/core/emit/calls.js +347 -0
- package/dist/core/emit/calls.js.map +1 -0
- package/dist/core/emit/canonical.d.ts +39 -0
- package/dist/core/emit/canonical.d.ts.map +1 -0
- package/dist/core/emit/canonical.js +71 -0
- package/dist/core/emit/canonical.js.map +1 -0
- package/dist/core/emit/channels.d.ts +28 -0
- package/dist/core/emit/channels.d.ts.map +1 -0
- package/dist/core/emit/channels.js +110 -0
- package/dist/core/emit/channels.js.map +1 -0
- package/dist/core/emit/code.d.ts +75 -0
- package/dist/core/emit/code.d.ts.map +1 -0
- package/dist/core/emit/code.js +104 -0
- package/dist/core/emit/code.js.map +1 -0
- package/dist/core/emit/colours.d.ts +35 -0
- package/dist/core/emit/colours.d.ts.map +1 -0
- package/dist/core/emit/colours.js +50 -0
- package/dist/core/emit/colours.js.map +1 -0
- package/dist/core/emit/context.d.ts +271 -0
- package/dist/core/emit/context.d.ts.map +1 -0
- package/dist/core/emit/context.js +358 -0
- package/dist/core/emit/context.js.map +1 -0
- package/dist/core/emit/defaults.d.ts +45 -0
- package/dist/core/emit/defaults.d.ts.map +1 -0
- package/dist/core/emit/defaults.js +116 -0
- package/dist/core/emit/defaults.js.map +1 -0
- package/dist/core/emit/emit.d.ts +13 -0
- package/dist/core/emit/emit.d.ts.map +1 -0
- package/dist/core/emit/emit.js +281 -0
- package/dist/core/emit/emit.js.map +1 -0
- package/dist/core/emit/events.d.ts +21 -0
- package/dist/core/emit/events.d.ts.map +1 -0
- package/dist/core/emit/events.js +112 -0
- package/dist/core/emit/events.js.map +1 -0
- package/dist/core/emit/expressions.d.ts +23 -0
- package/dist/core/emit/expressions.d.ts.map +1 -0
- package/dist/core/emit/expressions.js +253 -0
- package/dist/core/emit/expressions.js.map +1 -0
- package/dist/core/emit/functions.d.ts +30 -0
- package/dist/core/emit/functions.d.ts.map +1 -0
- package/dist/core/emit/functions.js +171 -0
- package/dist/core/emit/functions.js.map +1 -0
- package/dist/core/emit/gaps.d.ts +34 -0
- package/dist/core/emit/gaps.d.ts.map +1 -0
- package/dist/core/emit/gaps.js +16 -0
- package/dist/core/emit/gaps.js.map +1 -0
- package/dist/core/emit/index.d.ts +29 -0
- package/dist/core/emit/index.d.ts.map +1 -0
- package/dist/core/emit/index.js +23 -0
- package/dist/core/emit/index.js.map +1 -0
- package/dist/core/emit/inputs.d.ts +47 -0
- package/dist/core/emit/inputs.d.ts.map +1 -0
- package/dist/core/emit/inputs.js +150 -0
- package/dist/core/emit/inputs.js.map +1 -0
- package/dist/core/emit/layout.d.ts +73 -0
- package/dist/core/emit/layout.d.ts.map +1 -0
- package/dist/core/emit/layout.js +126 -0
- package/dist/core/emit/layout.js.map +1 -0
- package/dist/core/emit/meta.d.ts +14 -0
- package/dist/core/emit/meta.d.ts.map +1 -0
- package/dist/core/emit/meta.js +68 -0
- package/dist/core/emit/meta.js.map +1 -0
- package/dist/core/emit/opcodes.d.ts +28 -0
- package/dist/core/emit/opcodes.d.ts.map +1 -0
- package/dist/core/emit/opcodes.js +137 -0
- package/dist/core/emit/opcodes.js.map +1 -0
- package/dist/core/emit/outputs.d.ts +67 -0
- package/dist/core/emit/outputs.d.ts.map +1 -0
- package/dist/core/emit/outputs.js +293 -0
- package/dist/core/emit/outputs.js.map +1 -0
- package/dist/core/emit/pool.d.ts +33 -0
- package/dist/core/emit/pool.d.ts.map +1 -0
- package/dist/core/emit/pool.js +79 -0
- package/dist/core/emit/pool.js.map +1 -0
- package/dist/core/emit/program.d.ts +333 -0
- package/dist/core/emit/program.d.ts.map +1 -0
- package/dist/core/emit/program.js +15 -0
- package/dist/core/emit/program.js.map +1 -0
- package/dist/core/emit/registers.d.ts +35 -0
- package/dist/core/emit/registers.d.ts.map +1 -0
- package/dist/core/emit/registers.js +170 -0
- package/dist/core/emit/registers.js.map +1 -0
- package/dist/core/emit/request-scope.d.ts +36 -0
- package/dist/core/emit/request-scope.d.ts.map +1 -0
- package/dist/core/emit/request-scope.js +41 -0
- package/dist/core/emit/request-scope.js.map +1 -0
- package/dist/core/emit/requests.d.ts +69 -0
- package/dist/core/emit/requests.d.ts.map +1 -0
- package/dist/core/emit/requests.js +230 -0
- package/dist/core/emit/requests.js.map +1 -0
- package/dist/core/emit/requires.d.ts +4 -0
- package/dist/core/emit/requires.d.ts.map +1 -0
- package/dist/core/emit/requires.js +71 -0
- package/dist/core/emit/requires.js.map +1 -0
- package/dist/core/emit/sha256.d.ts +24 -0
- package/dist/core/emit/sha256.d.ts.map +1 -0
- package/dist/core/emit/sha256.js +109 -0
- package/dist/core/emit/sha256.js.map +1 -0
- package/dist/core/emit/statements.d.ts +20 -0
- package/dist/core/emit/statements.d.ts.map +1 -0
- package/dist/core/emit/statements.js +393 -0
- package/dist/core/emit/statements.js.map +1 -0
- package/dist/core/emit/values.d.ts +80 -0
- package/dist/core/emit/values.d.ts.map +1 -0
- package/dist/core/emit/values.js +242 -0
- package/dist/core/emit/values.js.map +1 -0
- package/dist/core/engine/alerts.d.ts +66 -0
- package/dist/core/engine/alerts.d.ts.map +1 -0
- package/dist/core/engine/alerts.js +119 -0
- package/dist/core/engine/alerts.js.map +1 -0
- package/dist/core/engine/arithmetic.d.ts +82 -0
- package/dist/core/engine/arithmetic.d.ts.map +1 -0
- package/dist/core/engine/arithmetic.js +141 -0
- package/dist/core/engine/arithmetic.js.map +1 -0
- package/dist/core/engine/bars.d.ts +95 -0
- package/dist/core/engine/bars.d.ts.map +1 -0
- package/dist/core/engine/bars.js +133 -0
- package/dist/core/engine/bars.js.map +1 -0
- package/dist/core/engine/budget.d.ts +162 -0
- package/dist/core/engine/budget.d.ts.map +1 -0
- package/dist/core/engine/budget.js +188 -0
- package/dist/core/engine/budget.js.map +1 -0
- package/dist/core/engine/channels.d.ts +106 -0
- package/dist/core/engine/channels.d.ts.map +1 -0
- package/dist/core/engine/channels.js +99 -0
- package/dist/core/engine/channels.js.map +1 -0
- package/dist/core/engine/drawings.d.ts +64 -0
- package/dist/core/engine/drawings.d.ts.map +1 -0
- package/dist/core/engine/drawings.js +67 -0
- package/dist/core/engine/drawings.js.map +1 -0
- package/dist/core/engine/engine.d.ts +140 -0
- package/dist/core/engine/engine.d.ts.map +1 -0
- package/dist/core/engine/engine.js +405 -0
- package/dist/core/engine/engine.js.map +1 -0
- package/dist/core/engine/errors.d.ts +64 -0
- package/dist/core/engine/errors.d.ts.map +1 -0
- package/dist/core/engine/errors.js +63 -0
- package/dist/core/engine/errors.js.map +1 -0
- package/dist/core/engine/frames.d.ts +48 -0
- package/dist/core/engine/frames.d.ts.map +1 -0
- package/dist/core/engine/frames.js +41 -0
- package/dist/core/engine/frames.js.map +1 -0
- package/dist/core/engine/grids.d.ts +25 -0
- package/dist/core/engine/grids.d.ts.map +1 -0
- package/dist/core/engine/grids.js +77 -0
- package/dist/core/engine/grids.js.map +1 -0
- package/dist/core/engine/guard.d.ts +4 -0
- package/dist/core/engine/guard.d.ts.map +1 -0
- package/dist/core/engine/guard.js +46 -0
- package/dist/core/engine/guard.js.map +1 -0
- package/dist/core/engine/host.d.ts +219 -0
- package/dist/core/engine/host.d.ts.map +1 -0
- package/dist/core/engine/host.js +38 -0
- package/dist/core/engine/host.js.map +1 -0
- package/dist/core/engine/index.d.ts +49 -0
- package/dist/core/engine/index.d.ts.map +1 -0
- package/dist/core/engine/index.js +33 -0
- package/dist/core/engine/index.js.map +1 -0
- package/dist/core/engine/inputs.d.ts +77 -0
- package/dist/core/engine/inputs.d.ts.map +1 -0
- package/dist/core/engine/inputs.js +205 -0
- package/dist/core/engine/inputs.js.map +1 -0
- package/dist/core/engine/ledger/call.d.ts +63 -0
- package/dist/core/engine/ledger/call.d.ts.map +1 -0
- package/dist/core/engine/ledger/call.js +136 -0
- package/dist/core/engine/ledger/call.js.map +1 -0
- package/dist/core/engine/ledger/closable.d.ts +155 -0
- package/dist/core/engine/ledger/closable.d.ts.map +1 -0
- package/dist/core/engine/ledger/closable.js +173 -0
- package/dist/core/engine/ledger/closable.js.map +1 -0
- package/dist/core/engine/ledger/holdings.d.ts +194 -0
- package/dist/core/engine/ledger/holdings.d.ts.map +1 -0
- package/dist/core/engine/ledger/holdings.js +237 -0
- package/dist/core/engine/ledger/holdings.js.map +1 -0
- package/dist/core/engine/ledger/index.d.ts +19 -0
- package/dist/core/engine/ledger/index.d.ts.map +1 -0
- package/dist/core/engine/ledger/index.js +2 -0
- package/dist/core/engine/ledger/index.js.map +1 -0
- package/dist/core/engine/ledger/intent.d.ts +106 -0
- package/dist/core/engine/ledger/intent.d.ts.map +1 -0
- package/dist/core/engine/ledger/intent.js +21 -0
- package/dist/core/engine/ledger/intent.js.map +1 -0
- package/dist/core/engine/ledger/ledger.d.ts +143 -0
- package/dist/core/engine/ledger/ledger.d.ts.map +1 -0
- package/dist/core/engine/ledger/ledger.js +237 -0
- package/dist/core/engine/ledger/ledger.js.map +1 -0
- package/dist/core/engine/ledger/place.d.ts +75 -0
- package/dist/core/engine/ledger/place.d.ts.map +1 -0
- package/dist/core/engine/ledger/place.js +174 -0
- package/dist/core/engine/ledger/place.js.map +1 -0
- package/dist/core/engine/ledger/positions.d.ts +68 -0
- package/dist/core/engine/ledger/positions.d.ts.map +1 -0
- package/dist/core/engine/ledger/positions.js +114 -0
- package/dist/core/engine/ledger/positions.js.map +1 -0
- package/dist/core/engine/ledger/refuse.d.ts +43 -0
- package/dist/core/engine/ledger/refuse.d.ts.map +1 -0
- package/dist/core/engine/ledger/refuse.js +329 -0
- package/dist/core/engine/ledger/refuse.js.map +1 -0
- package/dist/core/engine/ledger/row.d.ts +176 -0
- package/dist/core/engine/ledger/row.d.ts.map +1 -0
- package/dist/core/engine/ledger/row.js +169 -0
- package/dist/core/engine/ledger/row.js.map +1 -0
- package/dist/core/engine/ledger/sizing.d.ts +142 -0
- package/dist/core/engine/ledger/sizing.d.ts.map +1 -0
- package/dist/core/engine/ledger/sizing.js +223 -0
- package/dist/core/engine/ledger/sizing.js.map +1 -0
- package/dist/core/engine/library/arrays.d.ts +14 -0
- package/dist/core/engine/library/arrays.d.ts.map +1 -0
- package/dist/core/engine/library/arrays.js +285 -0
- package/dist/core/engine/library/arrays.js.map +1 -0
- package/dist/core/engine/library/averages.d.ts +9 -0
- package/dist/core/engine/library/averages.d.ts.map +1 -0
- package/dist/core/engine/library/averages.js +41 -0
- package/dist/core/engine/library/averages.js.map +1 -0
- package/dist/core/engine/library/binding.d.ts +230 -0
- package/dist/core/engine/library/binding.d.ts.map +1 -0
- package/dist/core/engine/library/binding.js +109 -0
- package/dist/core/engine/library/binding.js.map +1 -0
- package/dist/core/engine/library/chart.d.ts +3 -0
- package/dist/core/engine/library/chart.d.ts.map +1 -0
- package/dist/core/engine/library/chart.js +83 -0
- package/dist/core/engine/library/chart.js.map +1 -0
- package/dist/core/engine/library/colours.d.ts +26 -0
- package/dist/core/engine/library/colours.d.ts.map +1 -0
- package/dist/core/engine/library/colours.js +81 -0
- package/dist/core/engine/library/colours.js.map +1 -0
- package/dist/core/engine/library/dates.d.ts +3 -0
- package/dist/core/engine/library/dates.d.ts.map +1 -0
- package/dist/core/engine/library/dates.js +75 -0
- package/dist/core/engine/library/dates.js.map +1 -0
- package/dist/core/engine/library/index.d.ts +13 -0
- package/dist/core/engine/library/index.d.ts.map +1 -0
- package/dist/core/engine/library/index.js +86 -0
- package/dist/core/engine/library/index.js.map +1 -0
- package/dist/core/engine/library/maths.d.ts +3 -0
- package/dist/core/engine/library/maths.d.ts.map +1 -0
- package/dist/core/engine/library/maths.js +89 -0
- package/dist/core/engine/library/maths.js.map +1 -0
- package/dist/core/engine/library/objects.d.ts +3 -0
- package/dist/core/engine/library/objects.d.ts.map +1 -0
- package/dist/core/engine/library/objects.js +199 -0
- package/dist/core/engine/library/objects.js.map +1 -0
- package/dist/core/engine/library/oscillators.d.ts +3 -0
- package/dist/core/engine/library/oscillators.d.ts.map +1 -0
- package/dist/core/engine/library/oscillators.js +29 -0
- package/dist/core/engine/library/oscillators.js.map +1 -0
- package/dist/core/engine/library/ranges.d.ts +3 -0
- package/dist/core/engine/library/ranges.d.ts.map +1 -0
- package/dist/core/engine/library/ranges.js +23 -0
- package/dist/core/engine/library/ranges.js.map +1 -0
- package/dist/core/engine/library/series.d.ts +3 -0
- package/dist/core/engine/library/series.d.ts.map +1 -0
- package/dist/core/engine/library/series.js +46 -0
- package/dist/core/engine/library/series.js.map +1 -0
- package/dist/core/engine/library/state.d.ts +35 -0
- package/dist/core/engine/library/state.d.ts.map +1 -0
- package/dist/core/engine/library/state.js +19 -0
- package/dist/core/engine/library/state.js.map +1 -0
- package/dist/core/engine/library/studies.d.ts +3 -0
- package/dist/core/engine/library/studies.d.ts.map +1 -0
- package/dist/core/engine/library/studies.js +35 -0
- package/dist/core/engine/library/studies.js.map +1 -0
- package/dist/core/engine/library/text.d.ts +6 -0
- package/dist/core/engine/library/text.d.ts.map +1 -0
- package/dist/core/engine/library/text.js +280 -0
- package/dist/core/engine/library/text.js.map +1 -0
- package/dist/core/engine/library/trend.d.ts +3 -0
- package/dist/core/engine/library/trend.d.ts.map +1 -0
- package/dist/core/engine/library/trend.js +29 -0
- package/dist/core/engine/library/trend.js.map +1 -0
- package/dist/core/engine/library/volume.d.ts +3 -0
- package/dist/core/engine/library/volume.d.ts.map +1 -0
- package/dist/core/engine/library/volume.js +51 -0
- package/dist/core/engine/library/volume.js.map +1 -0
- package/dist/core/engine/load.d.ts +45 -0
- package/dist/core/engine/load.d.ts.map +1 -0
- package/dist/core/engine/load.js +60 -0
- package/dist/core/engine/load.js.map +1 -0
- package/dist/core/engine/machine.d.ts +107 -0
- package/dist/core/engine/machine.d.ts.map +1 -0
- package/dist/core/engine/machine.js +337 -0
- package/dist/core/engine/machine.js.map +1 -0
- package/dist/core/engine/memory.d.ts +60 -0
- package/dist/core/engine/memory.d.ts.map +1 -0
- package/dist/core/engine/memory.js +92 -0
- package/dist/core/engine/memory.js.map +1 -0
- package/dist/core/engine/operations.d.ts +62 -0
- package/dist/core/engine/operations.d.ts.map +1 -0
- package/dist/core/engine/operations.js +149 -0
- package/dist/core/engine/operations.js.map +1 -0
- package/dist/core/engine/orders.d.ts +56 -0
- package/dist/core/engine/orders.d.ts.map +1 -0
- package/dist/core/engine/orders.js +83 -0
- package/dist/core/engine/orders.js.map +1 -0
- package/dist/core/engine/registers.d.ts +50 -0
- package/dist/core/engine/registers.d.ts.map +1 -0
- package/dist/core/engine/registers.js +85 -0
- package/dist/core/engine/registers.js.map +1 -0
- package/dist/core/engine/request-body.d.ts +138 -0
- package/dist/core/engine/request-body.d.ts.map +1 -0
- package/dist/core/engine/request-body.js +227 -0
- package/dist/core/engine/request-body.js.map +1 -0
- package/dist/core/engine/request-plan.d.ts +79 -0
- package/dist/core/engine/request-plan.d.ts.map +1 -0
- package/dist/core/engine/request-plan.js +228 -0
- package/dist/core/engine/request-plan.js.map +1 -0
- package/dist/core/engine/requests.d.ts +105 -0
- package/dist/core/engine/requests.d.ts.map +1 -0
- package/dist/core/engine/requests.js +260 -0
- package/dist/core/engine/requests.js.map +1 -0
- package/dist/core/engine/results.d.ts +40 -0
- package/dist/core/engine/results.d.ts.map +1 -0
- package/dist/core/engine/results.js +2 -0
- package/dist/core/engine/results.js.map +1 -0
- package/dist/core/engine/series.d.ts +61 -0
- package/dist/core/engine/series.d.ts.map +1 -0
- package/dist/core/engine/series.js +41 -0
- package/dist/core/engine/series.js.map +1 -0
- package/dist/core/engine/session/hours.d.ts +49 -0
- package/dist/core/engine/session/hours.d.ts.map +1 -0
- package/dist/core/engine/session/hours.js +31 -0
- package/dist/core/engine/session/hours.js.map +1 -0
- package/dist/core/engine/session/index.d.ts +17 -0
- package/dist/core/engine/session/index.d.ts.map +1 -0
- package/dist/core/engine/session/index.js +3 -0
- package/dist/core/engine/session/index.js.map +1 -0
- package/dist/core/engine/session/record.d.ts +56 -0
- package/dist/core/engine/session/record.d.ts.map +1 -0
- package/dist/core/engine/session/record.js +165 -0
- package/dist/core/engine/session/record.js.map +1 -0
- package/dist/core/engine/session/spec.d.ts +19 -0
- package/dist/core/engine/session/spec.d.ts.map +1 -0
- package/dist/core/engine/session/spec.js +31 -0
- package/dist/core/engine/session/spec.js.map +1 -0
- package/dist/core/engine/timeframe.d.ts +59 -0
- package/dist/core/engine/timeframe.d.ts.map +1 -0
- package/dist/core/engine/timeframe.js +140 -0
- package/dist/core/engine/timeframe.js.map +1 -0
- package/dist/core/engine/types.d.ts +15 -0
- package/dist/core/engine/types.d.ts.map +1 -0
- package/dist/core/engine/types.js +2 -0
- package/dist/core/engine/types.js.map +1 -0
- package/dist/core/engine/values/heap.d.ts +134 -0
- package/dist/core/engine/values/heap.d.ts.map +1 -0
- package/dist/core/engine/values/heap.js +230 -0
- package/dist/core/engine/values/heap.js.map +1 -0
- package/dist/core/engine/values/index.d.ts +13 -0
- package/dist/core/engine/values/index.d.ts.map +1 -0
- package/dist/core/engine/values/index.js +3 -0
- package/dist/core/engine/values/index.js.map +1 -0
- package/dist/core/engine/values/value.d.ts +82 -0
- package/dist/core/engine/values/value.d.ts.map +1 -0
- package/dist/core/engine/values/value.js +134 -0
- package/dist/core/engine/values/value.js.map +1 -0
- package/dist/core/engine/verify-budgets.d.ts +35 -0
- package/dist/core/engine/verify-budgets.d.ts.map +1 -0
- package/dist/core/engine/verify-budgets.js +172 -0
- package/dist/core/engine/verify-budgets.js.map +1 -0
- package/dist/core/engine/verify-code.d.ts +32 -0
- package/dist/core/engine/verify-code.d.ts.map +1 -0
- package/dist/core/engine/verify-code.js +278 -0
- package/dist/core/engine/verify-code.js.map +1 -0
- package/dist/core/engine/verify-requests.d.ts +44 -0
- package/dist/core/engine/verify-requests.d.ts.map +1 -0
- package/dist/core/engine/verify-requests.js +220 -0
- package/dist/core/engine/verify-requests.js.map +1 -0
- package/dist/core/engine/verify-shape.d.ts +46 -0
- package/dist/core/engine/verify-shape.d.ts.map +1 -0
- package/dist/core/engine/verify-shape.js +147 -0
- package/dist/core/engine/verify-shape.js.map +1 -0
- package/dist/core/engine/verify-tables.d.ts +19 -0
- package/dist/core/engine/verify-tables.d.ts.map +1 -0
- package/dist/core/engine/verify-tables.js +171 -0
- package/dist/core/engine/verify-tables.js.map +1 -0
- package/dist/core/engine/verify.d.ts +19 -0
- package/dist/core/engine/verify.d.ts.map +1 -0
- package/dist/core/engine/verify.js +309 -0
- package/dist/core/engine/verify.js.map +1 -0
- package/dist/core/index.d.ts +61 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +48 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/parse/expressions.js +1 -1
- package/dist/core/parse/expressions.js.map +1 -1
- package/dist/core/parse/names.d.ts +7 -1
- package/dist/core/parse/names.d.ts.map +1 -1
- package/dist/core/parse/names.js +28 -2
- package/dist/core/parse/names.js.map +1 -1
- package/dist/core/stdlib/averages/exponential.d.ts +51 -0
- package/dist/core/stdlib/averages/exponential.d.ts.map +1 -0
- package/dist/core/stdlib/averages/exponential.js +72 -0
- package/dist/core/stdlib/averages/exponential.js.map +1 -0
- package/dist/core/stdlib/averages/index.d.ts +7 -0
- package/dist/core/stdlib/averages/index.d.ts.map +1 -0
- package/dist/core/stdlib/averages/index.js +5 -0
- package/dist/core/stdlib/averages/index.js.map +1 -0
- package/dist/core/stdlib/averages/select.d.ts +35 -0
- package/dist/core/stdlib/averages/select.d.ts.map +1 -0
- package/dist/core/stdlib/averages/select.js +43 -0
- package/dist/core/stdlib/averages/select.js.map +1 -0
- package/dist/core/stdlib/averages/shaped.d.ts +61 -0
- package/dist/core/stdlib/averages/shaped.d.ts.map +1 -0
- package/dist/core/stdlib/averages/shaped.js +126 -0
- package/dist/core/stdlib/averages/shaped.js.map +1 -0
- package/dist/core/stdlib/averages/simple.d.ts +58 -0
- package/dist/core/stdlib/averages/simple.d.ts.map +1 -0
- package/dist/core/stdlib/averages/simple.js +92 -0
- package/dist/core/stdlib/averages/simple.js.map +1 -0
- package/dist/core/stdlib/calendar/civil.d.ts +56 -0
- package/dist/core/stdlib/calendar/civil.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/civil.js +70 -0
- package/dist/core/stdlib/calendar/civil.js.map +1 -0
- package/dist/core/stdlib/calendar/fields.d.ts +36 -0
- package/dist/core/stdlib/calendar/fields.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/fields.js +93 -0
- package/dist/core/stdlib/calendar/fields.js.map +1 -0
- package/dist/core/stdlib/calendar/format.d.ts +19 -0
- package/dist/core/stdlib/calendar/format.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/format.js +51 -0
- package/dist/core/stdlib/calendar/format.js.map +1 -0
- package/dist/core/stdlib/calendar/index.d.ts +7 -0
- package/dist/core/stdlib/calendar/index.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/index.js +5 -0
- package/dist/core/stdlib/calendar/index.js.map +1 -0
- package/dist/core/stdlib/calendar/zone.d.ts +53 -0
- package/dist/core/stdlib/calendar/zone.d.ts.map +1 -0
- package/dist/core/stdlib/calendar/zone.js +138 -0
- package/dist/core/stdlib/calendar/zone.js.map +1 -0
- package/dist/core/stdlib/index.d.ts +57 -0
- package/dist/core/stdlib/index.d.ts.map +1 -0
- package/dist/core/stdlib/index.js +51 -0
- package/dist/core/stdlib/index.js.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts +38 -0
- package/dist/core/stdlib/maths/arithmetic.d.ts.map +1 -0
- package/dist/core/stdlib/maths/arithmetic.js +66 -0
- package/dist/core/stdlib/maths/arithmetic.js.map +1 -0
- package/dist/core/stdlib/maths/elementary.d.ts +65 -0
- package/dist/core/stdlib/maths/elementary.d.ts.map +1 -0
- package/dist/core/stdlib/maths/elementary.js +93 -0
- package/dist/core/stdlib/maths/elementary.js.map +1 -0
- package/dist/core/stdlib/maths/index.d.ts +4 -0
- package/dist/core/stdlib/maths/index.d.ts.map +1 -0
- package/dist/core/stdlib/maths/index.js +4 -0
- package/dist/core/stdlib/maths/index.js.map +1 -0
- package/dist/core/stdlib/maths/rounding.d.ts +43 -0
- package/dist/core/stdlib/maths/rounding.d.ts.map +1 -0
- package/dist/core/stdlib/maths/rounding.js +62 -0
- package/dist/core/stdlib/maths/rounding.js.map +1 -0
- package/dist/core/stdlib/momentum/convergence.d.ts +36 -0
- package/dist/core/stdlib/momentum/convergence.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/convergence.js +48 -0
- package/dist/core/stdlib/momentum/convergence.js.map +1 -0
- package/dist/core/stdlib/momentum/index.d.ts +6 -0
- package/dist/core/stdlib/momentum/index.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/index.js +6 -0
- package/dist/core/stdlib/momentum/index.js.map +1 -0
- package/dist/core/stdlib/momentum/pressure.d.ts +43 -0
- package/dist/core/stdlib/momentum/pressure.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/pressure.js +103 -0
- package/dist/core/stdlib/momentum/pressure.js.map +1 -0
- package/dist/core/stdlib/momentum/rates.d.ts +74 -0
- package/dist/core/stdlib/momentum/rates.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rates.js +134 -0
- package/dist/core/stdlib/momentum/rates.js.map +1 -0
- package/dist/core/stdlib/momentum/rsi.d.ts +21 -0
- package/dist/core/stdlib/momentum/rsi.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/rsi.js +30 -0
- package/dist/core/stdlib/momentum/rsi.js.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts +44 -0
- package/dist/core/stdlib/momentum/stochastic.d.ts.map +1 -0
- package/dist/core/stdlib/momentum/stochastic.js +97 -0
- package/dist/core/stdlib/momentum/stochastic.js.map +1 -0
- package/dist/core/stdlib/series/changes.d.ts +59 -0
- package/dist/core/stdlib/series/changes.d.ts.map +1 -0
- package/dist/core/stdlib/series/changes.js +129 -0
- package/dist/core/stdlib/series/changes.js.map +1 -0
- package/dist/core/stdlib/series/conditions.d.ts +34 -0
- package/dist/core/stdlib/series/conditions.d.ts.map +1 -0
- package/dist/core/stdlib/series/conditions.js +52 -0
- package/dist/core/stdlib/series/conditions.js.map +1 -0
- package/dist/core/stdlib/series/extremes.d.ts +29 -0
- package/dist/core/stdlib/series/extremes.d.ts.map +1 -0
- package/dist/core/stdlib/series/extremes.js +62 -0
- package/dist/core/stdlib/series/extremes.js.map +1 -0
- package/dist/core/stdlib/series/index.d.ts +9 -0
- package/dist/core/stdlib/series/index.d.ts.map +1 -0
- package/dist/core/stdlib/series/index.js +7 -0
- package/dist/core/stdlib/series/index.js.map +1 -0
- package/dist/core/stdlib/series/pivots.d.ts +25 -0
- package/dist/core/stdlib/series/pivots.d.ts.map +1 -0
- package/dist/core/stdlib/series/pivots.js +42 -0
- package/dist/core/stdlib/series/pivots.js.map +1 -0
- package/dist/core/stdlib/series/statistics.d.ts +64 -0
- package/dist/core/stdlib/series/statistics.d.ts.map +1 -0
- package/dist/core/stdlib/series/statistics.js +148 -0
- package/dist/core/stdlib/series/statistics.js.map +1 -0
- package/dist/core/stdlib/series/totals.d.ts +68 -0
- package/dist/core/stdlib/series/totals.d.ts.map +1 -0
- package/dist/core/stdlib/series/totals.js +115 -0
- package/dist/core/stdlib/series/totals.js.map +1 -0
- package/dist/core/stdlib/trend/directional.d.ts +69 -0
- package/dist/core/stdlib/trend/directional.d.ts.map +1 -0
- package/dist/core/stdlib/trend/directional.js +151 -0
- package/dist/core/stdlib/trend/directional.js.map +1 -0
- package/dist/core/stdlib/trend/index.d.ts +4 -0
- package/dist/core/stdlib/trend/index.d.ts.map +1 -0
- package/dist/core/stdlib/trend/index.js +4 -0
- package/dist/core/stdlib/trend/index.js.map +1 -0
- package/dist/core/stdlib/trend/psar.d.ts +33 -0
- package/dist/core/stdlib/trend/psar.d.ts.map +1 -0
- package/dist/core/stdlib/trend/psar.js +86 -0
- package/dist/core/stdlib/trend/psar.js.map +1 -0
- package/dist/core/stdlib/trend/supertrend.d.ts +30 -0
- package/dist/core/stdlib/trend/supertrend.d.ts.map +1 -0
- package/dist/core/stdlib/trend/supertrend.js +65 -0
- package/dist/core/stdlib/trend/supertrend.js.map +1 -0
- package/dist/core/stdlib/values/bar.d.ts +39 -0
- package/dist/core/stdlib/values/bar.d.ts.map +1 -0
- package/dist/core/stdlib/values/bar.js +33 -0
- package/dist/core/stdlib/values/bar.js.map +1 -0
- package/dist/core/stdlib/values/index.d.ts +11 -0
- package/dist/core/stdlib/values/index.d.ts.map +1 -0
- package/dist/core/stdlib/values/index.js +6 -0
- package/dist/core/stdlib/values/index.js.map +1 -0
- package/dist/core/stdlib/values/lookback.d.ts +83 -0
- package/dist/core/stdlib/values/lookback.d.ts.map +1 -0
- package/dist/core/stdlib/values/lookback.js +134 -0
- package/dist/core/stdlib/values/lookback.js.map +1 -0
- package/dist/core/stdlib/values/region.d.ts +55 -0
- package/dist/core/stdlib/values/region.d.ts.map +1 -0
- package/dist/core/stdlib/values/region.js +73 -0
- package/dist/core/stdlib/values/region.js.map +1 -0
- package/dist/core/stdlib/values/tail.d.ts +44 -0
- package/dist/core/stdlib/values/tail.d.ts.map +1 -0
- package/dist/core/stdlib/values/tail.js +23 -0
- package/dist/core/stdlib/values/tail.js.map +1 -0
- package/dist/core/stdlib/values/value.d.ts +64 -0
- package/dist/core/stdlib/values/value.d.ts.map +1 -0
- package/dist/core/stdlib/values/value.js +61 -0
- package/dist/core/stdlib/values/value.js.map +1 -0
- package/dist/core/stdlib/volatility/bands.d.ts +50 -0
- package/dist/core/stdlib/volatility/bands.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/bands.js +101 -0
- package/dist/core/stdlib/volatility/bands.js.map +1 -0
- package/dist/core/stdlib/volatility/deviation.d.ts +43 -0
- package/dist/core/stdlib/volatility/deviation.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/deviation.js +75 -0
- package/dist/core/stdlib/volatility/deviation.js.map +1 -0
- package/dist/core/stdlib/volatility/index.d.ts +6 -0
- package/dist/core/stdlib/volatility/index.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/index.js +5 -0
- package/dist/core/stdlib/volatility/index.js.map +1 -0
- package/dist/core/stdlib/volatility/measures.d.ts +48 -0
- package/dist/core/stdlib/volatility/measures.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/measures.js +73 -0
- package/dist/core/stdlib/volatility/measures.js.map +1 -0
- package/dist/core/stdlib/volatility/range.d.ts +69 -0
- package/dist/core/stdlib/volatility/range.d.ts.map +1 -0
- package/dist/core/stdlib/volatility/range.js +86 -0
- package/dist/core/stdlib/volatility/range.js.map +1 -0
- package/dist/core/stdlib/volume/accumulation.d.ts +61 -0
- package/dist/core/stdlib/volume/accumulation.d.ts.map +1 -0
- package/dist/core/stdlib/volume/accumulation.js +127 -0
- package/dist/core/stdlib/volume/accumulation.js.map +1 -0
- package/dist/core/stdlib/volume/flow.d.ts +60 -0
- package/dist/core/stdlib/volume/flow.d.ts.map +1 -0
- package/dist/core/stdlib/volume/flow.js +125 -0
- package/dist/core/stdlib/volume/flow.js.map +1 -0
- package/dist/core/stdlib/volume/index.d.ts +5 -0
- package/dist/core/stdlib/volume/index.d.ts.map +1 -0
- package/dist/core/stdlib/volume/index.js +4 -0
- package/dist/core/stdlib/volume/index.js.map +1 -0
- package/dist/core/stdlib/volume/weighted.d.ts +52 -0
- package/dist/core/stdlib/volume/weighted.d.ts.map +1 -0
- package/dist/core/stdlib/volume/weighted.js +64 -0
- package/dist/core/stdlib/volume/weighted.js.map +1 -0
- package/dist/core/version/version.generated.d.ts +2 -2
- package/dist/core/version/version.generated.d.ts.map +1 -1
- package/dist/core/version/version.generated.js +2 -2
- package/dist/core/version/version.generated.js.map +1 -1
- package/package.json +38 -14
- package/spec/errors.json +382 -183
- package/src/adapters/charts/alerts.ts +116 -0
- package/src/adapters/charts/bars.ts +63 -0
- package/src/adapters/charts/candles.ts +137 -0
- package/src/adapters/charts/colours.ts +113 -0
- package/src/adapters/charts/columns.ts +99 -0
- package/src/adapters/charts/contract.ts +320 -0
- package/src/adapters/charts/descriptor.ts +199 -0
- package/src/adapters/charts/drawings.ts +213 -0
- package/src/adapters/charts/errors.ts +45 -0
- package/src/adapters/charts/fields.ts +74 -0
- package/src/adapters/charts/fills.ts +71 -0
- package/src/adapters/charts/index.ts +78 -0
- package/src/adapters/charts/levels.ts +92 -0
- package/src/adapters/charts/markers.ts +119 -0
- package/src/adapters/charts/paint.ts +101 -0
- package/src/adapters/charts/plots.ts +185 -0
- package/src/adapters/charts/produced.ts +68 -0
- package/src/adapters/charts/requests.ts +357 -0
- package/src/adapters/charts/run.ts +327 -0
- package/src/adapters/charts/settings.ts +273 -0
- package/src/adapters/charts/surfaces.ts +238 -0
- package/src/adapters/charts/tables.ts +155 -0
- package/src/core/catalogue/catalogue.generated.ts +17 -9
- package/src/core/catalogue/values.generated.ts +8 -0
- package/src/core/check/arguments.ts +126 -0
- package/src/core/check/call-sites.ts +385 -0
- package/src/core/check/call-warmup.ts +121 -0
- package/src/core/check/calls.ts +412 -0
- package/src/core/check/check.ts +183 -0
- package/src/core/check/checked.ts +228 -0
- package/src/core/check/checker.ts +393 -0
- package/src/core/check/conditional.ts +143 -0
- package/src/core/check/constant.ts +127 -0
- package/src/core/check/declaration.ts +230 -0
- package/src/core/check/expressions.ts +471 -0
- package/src/core/check/functions.ts +283 -0
- package/src/core/check/handles.ts +75 -0
- package/src/core/check/index.ts +67 -0
- package/src/core/check/library-bars.ts +194 -0
- package/src/core/check/library-orders.ts +290 -0
- package/src/core/check/library-output.ts +241 -0
- package/src/core/check/library-series.ts +457 -0
- package/src/core/check/library.ts +374 -0
- package/src/core/check/literals.ts +35 -0
- package/src/core/check/outputs.ts +152 -0
- package/src/core/check/statements.ts +465 -0
- package/src/core/check/suggest.ts +63 -0
- package/src/core/check/surface.ts +115 -0
- package/src/core/check/tags.ts +94 -0
- package/src/core/check/types.ts +260 -0
- package/src/core/check/warmup.ts +100 -0
- package/src/core/diagnostics/collector.ts +27 -1
- package/src/core/emit/calls.ts +415 -0
- package/src/core/emit/canonical.ts +81 -0
- package/src/core/emit/channels.ts +144 -0
- package/src/core/emit/code.ts +155 -0
- package/src/core/emit/colours.ts +75 -0
- package/src/core/emit/context.ts +461 -0
- package/src/core/emit/defaults.ts +150 -0
- package/src/core/emit/emit.ts +313 -0
- package/src/core/emit/events.ts +141 -0
- package/src/core/emit/expressions.ts +292 -0
- package/src/core/emit/functions.ts +195 -0
- package/src/core/emit/gaps.ts +44 -0
- package/src/core/emit/index.ts +74 -0
- package/src/core/emit/inputs.ts +179 -0
- package/src/core/emit/layout.ts +165 -0
- package/src/core/emit/meta.ts +104 -0
- package/src/core/emit/opcodes.ts +160 -0
- package/src/core/emit/outputs.ts +357 -0
- package/src/core/emit/pool.ts +102 -0
- package/src/core/emit/program.ts +385 -0
- package/src/core/emit/registers.ts +179 -0
- package/src/core/emit/request-scope.ts +52 -0
- package/src/core/emit/requests.ts +258 -0
- package/src/core/emit/requires.ts +91 -0
- package/src/core/emit/sha256.ts +119 -0
- package/src/core/emit/statements.ts +438 -0
- package/src/core/emit/values.ts +284 -0
- package/src/core/engine/alerts.ts +152 -0
- package/src/core/engine/arithmetic.ts +165 -0
- package/src/core/engine/bars.ts +224 -0
- package/src/core/engine/budget.ts +284 -0
- package/src/core/engine/channels.ts +171 -0
- package/src/core/engine/drawings.ts +127 -0
- package/src/core/engine/engine.ts +498 -0
- package/src/core/engine/errors.ts +100 -0
- package/src/core/engine/frames.ts +85 -0
- package/src/core/engine/grids.ts +98 -0
- package/src/core/engine/guard.ts +71 -0
- package/src/core/engine/host.ts +251 -0
- package/src/core/engine/index.ts +93 -0
- package/src/core/engine/inputs.ts +263 -0
- package/src/core/engine/ledger/call.ts +218 -0
- package/src/core/engine/ledger/closable.ts +269 -0
- package/src/core/engine/ledger/holdings.ts +354 -0
- package/src/core/engine/ledger/index.ts +28 -0
- package/src/core/engine/ledger/intent.ts +112 -0
- package/src/core/engine/ledger/ledger.ts +314 -0
- package/src/core/engine/ledger/place.ts +277 -0
- package/src/core/engine/ledger/positions.ts +123 -0
- package/src/core/engine/ledger/refuse.ts +378 -0
- package/src/core/engine/ledger/row.ts +318 -0
- package/src/core/engine/ledger/sizing.ts +292 -0
- package/src/core/engine/library/arrays.ts +316 -0
- package/src/core/engine/library/averages.ts +97 -0
- package/src/core/engine/library/binding.ts +325 -0
- package/src/core/engine/library/chart.ts +115 -0
- package/src/core/engine/library/colours.ts +111 -0
- package/src/core/engine/library/dates.ts +109 -0
- package/src/core/engine/library/index.ts +103 -0
- package/src/core/engine/library/maths.ts +134 -0
- package/src/core/engine/library/objects.ts +265 -0
- package/src/core/engine/library/oscillators.ts +124 -0
- package/src/core/engine/library/ranges.ts +51 -0
- package/src/core/engine/library/series.ts +236 -0
- package/src/core/engine/library/state.ts +47 -0
- package/src/core/engine/library/studies.ts +150 -0
- package/src/core/engine/library/text.ts +303 -0
- package/src/core/engine/library/trend.ts +79 -0
- package/src/core/engine/library/volume.ts +101 -0
- package/src/core/engine/load.ts +104 -0
- package/src/core/engine/machine.ts +446 -0
- package/src/core/engine/memory.ts +129 -0
- package/src/core/engine/operations.ts +171 -0
- package/src/core/engine/orders.ts +121 -0
- package/src/core/engine/registers.ts +104 -0
- package/src/core/engine/request-body.ts +328 -0
- package/src/core/engine/request-plan.ts +270 -0
- package/src/core/engine/requests.ts +382 -0
- package/src/core/engine/results.ts +41 -0
- package/src/core/engine/series.ts +82 -0
- package/src/core/engine/session/hours.ts +86 -0
- package/src/core/engine/session/index.ts +17 -0
- package/src/core/engine/session/record.ts +191 -0
- package/src/core/engine/session/spec.ts +45 -0
- package/src/core/engine/timeframe.ts +161 -0
- package/src/core/engine/types.ts +47 -0
- package/src/core/engine/values/heap.ts +295 -0
- package/src/core/engine/values/index.ts +34 -0
- package/src/core/engine/values/value.ts +158 -0
- package/src/core/engine/verify-budgets.ts +202 -0
- package/src/core/engine/verify-code.ts +332 -0
- package/src/core/engine/verify-requests.ts +255 -0
- package/src/core/engine/verify-shape.ts +164 -0
- package/src/core/engine/verify-tables.ts +176 -0
- package/src/core/engine/verify.ts +341 -0
- package/src/core/index.ts +128 -6
- package/src/core/parse/expressions.ts +1 -1
- package/src/core/parse/names.ts +29 -2
- package/src/core/stdlib/averages/exponential.ts +119 -0
- package/src/core/stdlib/averages/index.ts +45 -0
- package/src/core/stdlib/averages/select.ts +71 -0
- package/src/core/stdlib/averages/shaped.ts +161 -0
- package/src/core/stdlib/averages/simple.ts +139 -0
- package/src/core/stdlib/calendar/civil.ts +89 -0
- package/src/core/stdlib/calendar/fields.ts +124 -0
- package/src/core/stdlib/calendar/format.ts +71 -0
- package/src/core/stdlib/calendar/index.ts +15 -0
- package/src/core/stdlib/calendar/zone.ts +161 -0
- package/src/core/stdlib/index.ts +400 -0
- package/src/core/stdlib/maths/arithmetic.ts +74 -0
- package/src/core/stdlib/maths/elementary.ts +124 -0
- package/src/core/stdlib/maths/index.ts +43 -0
- package/src/core/stdlib/maths/rounding.ts +78 -0
- package/src/core/stdlib/momentum/convergence.ts +82 -0
- package/src/core/stdlib/momentum/index.ts +47 -0
- package/src/core/stdlib/momentum/pressure.ts +141 -0
- package/src/core/stdlib/momentum/rates.ts +188 -0
- package/src/core/stdlib/momentum/rsi.ts +49 -0
- package/src/core/stdlib/momentum/stochastic.ts +147 -0
- package/src/core/stdlib/series/changes.ts +177 -0
- package/src/core/stdlib/series/conditions.ts +74 -0
- package/src/core/stdlib/series/extremes.ts +92 -0
- package/src/core/stdlib/series/index.ts +83 -0
- package/src/core/stdlib/series/pivots.ts +63 -0
- package/src/core/stdlib/series/statistics.ts +207 -0
- package/src/core/stdlib/series/totals.ts +164 -0
- package/src/core/stdlib/trend/directional.ts +196 -0
- package/src/core/stdlib/trend/index.ts +13 -0
- package/src/core/stdlib/trend/psar.ts +131 -0
- package/src/core/stdlib/trend/supertrend.ts +100 -0
- package/src/core/stdlib/values/bar.ts +54 -0
- package/src/core/stdlib/values/index.ts +14 -0
- package/src/core/stdlib/values/lookback.ts +198 -0
- package/src/core/stdlib/values/region.ts +86 -0
- package/src/core/stdlib/values/tail.ts +58 -0
- package/src/core/stdlib/values/value.ts +82 -0
- package/src/core/stdlib/volatility/bands.ts +178 -0
- package/src/core/stdlib/volatility/deviation.ts +111 -0
- package/src/core/stdlib/volatility/index.ts +48 -0
- package/src/core/stdlib/volatility/measures.ts +96 -0
- package/src/core/stdlib/volatility/range.ts +143 -0
- package/src/core/stdlib/volume/accumulation.ts +152 -0
- package/src/core/stdlib/volume/flow.ts +173 -0
- package/src/core/stdlib/volume/index.ts +43 -0
- package/src/core/stdlib/volume/weighted.ts +101 -0
- package/src/core/version/version.generated.ts +2 -2
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The declared inputs, in both directions.
|
|
3
|
+
*
|
|
4
|
+
* Out: one settings row per `input()` call, which is the whole of the generated
|
|
5
|
+
* settings dialog. The program already carries the label, the group, the help
|
|
6
|
+
* text, the bounds and the choices, because a settings dialog and a legend have
|
|
7
|
+
* to exist before the first bar runs, so nothing here decides anything. It
|
|
8
|
+
* translates a `kind` into the control a chart renders.
|
|
9
|
+
*
|
|
10
|
+
* Back in: what a dialog stored, turned into the values the engine validates.
|
|
11
|
+
* Two kinds need work and the rest pass through untouched. A colour arrives as a
|
|
12
|
+
* CSS string and has to become four numbers. A choice arrives as a string even
|
|
13
|
+
* when the script wrote numbers, because a select control has string values, so
|
|
14
|
+
* the stored string is matched against the declared options and the option's own
|
|
15
|
+
* value is what the engine is given.
|
|
16
|
+
*
|
|
17
|
+
* **A value the host stored and this module cannot convert is passed through
|
|
18
|
+
* rather than replaced.** The engine refuses it with OS6019, naming the key and
|
|
19
|
+
* the rule it broke. Substituting the default here would be a settings dialog
|
|
20
|
+
* that silently ignores what a user typed, which is the failure `2.6` is written
|
|
21
|
+
* to prevent, and it would hide it one layer further down than the engine does.
|
|
22
|
+
*
|
|
23
|
+
* **And a stored value the engine will refuse is not a value this adapter has.**
|
|
24
|
+
* The declared shape is built before anything runs, so a settings map holding a
|
|
25
|
+
* precision of 99 against an input declared `max = 8` put 99 into
|
|
26
|
+
* `plots[0].priceFormat`, which a host can show in a legend or on a price scale
|
|
27
|
+
* before the calculation that refuses it has been asked for. What a stored value
|
|
28
|
+
* is worth has one answer and it is the engine's own: `checkSetting` is the
|
|
29
|
+
* function the load refuses with, asked here before the load exists. A value it
|
|
30
|
+
* will not take reads as the **declared default** in the declared shape, and
|
|
31
|
+
* travels to the engine exactly as the host stored it, so the run still stops
|
|
32
|
+
* with OS6019 naming the key and the bound.
|
|
33
|
+
*
|
|
34
|
+
* Neither half of that is a fallback. The value is not repaired, because the
|
|
35
|
+
* same map still refuses; and the shape is not withheld, because the settings
|
|
36
|
+
* dialog a reader corrects the value in is built from the descriptor, and a
|
|
37
|
+
* study that refuses to describe itself is one whose bad setting cannot be
|
|
38
|
+
* reached. What a host is handed meanwhile is the shape the script declared,
|
|
39
|
+
* which is the shape the study has until a settings map the engine takes
|
|
40
|
+
* arrives.
|
|
41
|
+
*/
|
|
42
|
+
import type { CompiledInput, CompiledProgram, Constant } from '../../core/emit/index.js';
|
|
43
|
+
import { checkSetting, constantValue } from '../../core/engine/index.js';
|
|
44
|
+
import type { ColourValue, Value } from '../../core/engine/index.js';
|
|
45
|
+
import { cssColour, isColourValue, parseColour } from './colours.js';
|
|
46
|
+
import type { ChartInput, ChartSettings, ChartSource } from './contract.js';
|
|
47
|
+
import type { InputLookup } from './fields.js';
|
|
48
|
+
|
|
49
|
+
/** The eight series a `"source"` input may select, in the order 2.6 lists them. */
|
|
50
|
+
const SOURCES: readonly string[] = [
|
|
51
|
+
'open',
|
|
52
|
+
'high',
|
|
53
|
+
'low',
|
|
54
|
+
'close',
|
|
55
|
+
'hl2',
|
|
56
|
+
'hlc3',
|
|
57
|
+
'ohlc4',
|
|
58
|
+
'volume',
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
/** One settings row per declared input, in source order. */
|
|
62
|
+
export function inputRows(program: CompiledProgram): readonly ChartInput[] {
|
|
63
|
+
const rows: ChartInput[] = [];
|
|
64
|
+
for (const declared of program.inputs) rows.push(rowFor(declared));
|
|
65
|
+
return rows;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* What the engine is handed as the host's settings.
|
|
70
|
+
*
|
|
71
|
+
* Only the declared keys travel. A chart's settings object also carries the
|
|
72
|
+
* generated per-plot appearance keys and the chart's timezone, and an engine
|
|
73
|
+
* given those would have nothing to do with them; leaving them out keeps the
|
|
74
|
+
* two vocabularies from having to agree on anything but the input keys.
|
|
75
|
+
*/
|
|
76
|
+
export function engineSettings(
|
|
77
|
+
program: CompiledProgram,
|
|
78
|
+
settings: ChartSettings,
|
|
79
|
+
): Record<string, unknown> {
|
|
80
|
+
const out: Record<string, unknown> = {};
|
|
81
|
+
for (const declared of program.inputs) {
|
|
82
|
+
const supplied = storedValue(declared, settings);
|
|
83
|
+
if (supplied !== undefined) out[declared.key] = supplied;
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The value each declared input currently holds, for a declaration field. */
|
|
89
|
+
export function lookupFor(program: CompiledProgram, settings: ChartSettings): InputLookup {
|
|
90
|
+
return (key: string): Value => {
|
|
91
|
+
const declared = program.inputs.find((one) => one.key === key);
|
|
92
|
+
if (declared === undefined) return null;
|
|
93
|
+
return effectiveValue(declared, settings);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* A comparable spelling of every declared input's value.
|
|
99
|
+
*
|
|
100
|
+
* The incremental path is only valid while the engine it holds was loaded from
|
|
101
|
+
* the same settings, and comparing the two spellings is cheaper and safer than
|
|
102
|
+
* trusting a chart to have told us that a settings change happened.
|
|
103
|
+
*
|
|
104
|
+
* **It spells what the engine is handed, not what the declared shape shows.**
|
|
105
|
+
* Those part company the moment a stored value is one the engine refuses: every
|
|
106
|
+
* refused value shows the same declared default, so a signature taken from the
|
|
107
|
+
* shape would read a change from a setting that runs to one that cannot as no
|
|
108
|
+
* change at all, keep the held engine and go on drawing the old numbers instead
|
|
109
|
+
* of reporting OS6019. The kind is spelled beside the value for the same
|
|
110
|
+
* reason: a stored `7` and a stored `"7"` are one quotation mark apart, and one
|
|
111
|
+
* of them is refused.
|
|
112
|
+
*/
|
|
113
|
+
export function signatureOf(program: CompiledProgram, settings: ChartSettings): string {
|
|
114
|
+
const parts: string[] = [];
|
|
115
|
+
for (const declared of program.inputs) {
|
|
116
|
+
parts.push(`${declared.key}=${spellStored(storedValue(declared, settings))}`);
|
|
117
|
+
}
|
|
118
|
+
return parts.join('\u0000');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The declared default, as the value model holds it. */
|
|
122
|
+
export function defaultValue(declared: CompiledInput): Value {
|
|
123
|
+
return constantValue(declared.default);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function rowFor(declared: CompiledInput): ChartInput {
|
|
127
|
+
const held = defaultValue(declared);
|
|
128
|
+
const label = declared.label;
|
|
129
|
+
const key = declared.key;
|
|
130
|
+
const extra = {
|
|
131
|
+
...(declared.group === '' ? {} : { group: declared.group }),
|
|
132
|
+
...(declared.tooltip === null ? {} : { tooltip: declared.tooltip }),
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// A choice is a choice whatever the type of its members. The compiled kind is
|
|
136
|
+
// `"select"` only where the values are strings, so a script that constrained a
|
|
137
|
+
// length to two numbers arrives as a number carrying options, and a spinner
|
|
138
|
+
// would offer every value between them: the engine validates a number against
|
|
139
|
+
// its bounds and not against its options, so nothing downstream would refuse
|
|
140
|
+
// the third value a user typed. The declared choices are the control.
|
|
141
|
+
const options = declared.options ?? [];
|
|
142
|
+
if (options.length > 0) {
|
|
143
|
+
return {
|
|
144
|
+
key,
|
|
145
|
+
type: 'select',
|
|
146
|
+
label,
|
|
147
|
+
default: spell(held),
|
|
148
|
+
options: options.map((one) => {
|
|
149
|
+
const text = spell(constantValue(one));
|
|
150
|
+
return { label: text, value: text };
|
|
151
|
+
}),
|
|
152
|
+
...extra,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
switch (declared.kind) {
|
|
157
|
+
case 'number':
|
|
158
|
+
return {
|
|
159
|
+
key,
|
|
160
|
+
type: 'number',
|
|
161
|
+
label,
|
|
162
|
+
default: typeof held === 'number' ? held : 0,
|
|
163
|
+
...(declared.min === null ? {} : { min: declared.min }),
|
|
164
|
+
...(declared.max === null ? {} : { max: declared.max }),
|
|
165
|
+
...(declared.step === null ? {} : { step: declared.step }),
|
|
166
|
+
...extra,
|
|
167
|
+
};
|
|
168
|
+
case 'bool':
|
|
169
|
+
return { key, type: 'boolean', label, default: held === true, ...extra };
|
|
170
|
+
case 'color':
|
|
171
|
+
return {
|
|
172
|
+
key,
|
|
173
|
+
type: 'color',
|
|
174
|
+
label,
|
|
175
|
+
default: isColourValue(held) ? cssColour(held) : 'rgba(0, 0, 0, 1)',
|
|
176
|
+
...extra,
|
|
177
|
+
};
|
|
178
|
+
case 'source':
|
|
179
|
+
return {
|
|
180
|
+
key,
|
|
181
|
+
type: 'source',
|
|
182
|
+
label,
|
|
183
|
+
default: typeof held === 'string' && SOURCES.includes(held) ? (held as ChartSource) : 'close',
|
|
184
|
+
...extra,
|
|
185
|
+
};
|
|
186
|
+
case 'interval':
|
|
187
|
+
return { key, type: 'interval', label, default: typeof held === 'string' ? held : '', ...extra };
|
|
188
|
+
case 'time':
|
|
189
|
+
return { key, type: 'time', label, default: typeof held === 'string' ? held : '', ...extra };
|
|
190
|
+
default:
|
|
191
|
+
return { key, type: 'text', label, default: typeof held === 'string' ? held : '', ...extra };
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** What the host stored for this input, converted, or nothing when it stored none. */
|
|
196
|
+
function storedValue(declared: CompiledInput, settings: ChartSettings): unknown {
|
|
197
|
+
if (!Object.prototype.hasOwnProperty.call(settings, declared.key)) return undefined;
|
|
198
|
+
const supplied = settings[declared.key];
|
|
199
|
+
if (supplied === undefined) return undefined;
|
|
200
|
+
|
|
201
|
+
if (declared.kind === 'color' && typeof supplied === 'string') {
|
|
202
|
+
// A swatch has no alpha channel, so a stored colour that states none keeps
|
|
203
|
+
// the alpha the script declared. See `colours.ts`.
|
|
204
|
+
const held = defaultValue(declared);
|
|
205
|
+
const parsed = parseColour(supplied, isColourValue(held) ? held.a : 1);
|
|
206
|
+
return parsed ?? supplied;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (declared.options !== null && typeof supplied === 'string') {
|
|
210
|
+
// The control's values are strings even where the declared choices are not,
|
|
211
|
+
// so a stored choice is matched on its own spelling and the engine is given
|
|
212
|
+
// the option the script wrote rather than the text of it.
|
|
213
|
+
const chosen = optionFor(declared.options, supplied);
|
|
214
|
+
return chosen === undefined ? supplied : chosen;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return supplied;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The effective value: the host's where the engine will run with it.
|
|
222
|
+
*
|
|
223
|
+
* The question is `checkSetting`'s, so there is no second list of types and
|
|
224
|
+
* bounds here to disagree with the first. This file decides only what to do
|
|
225
|
+
* with the answer, and the module's own paragraph says why a refused value
|
|
226
|
+
* reads as the declared default rather than as itself.
|
|
227
|
+
*
|
|
228
|
+
* One answer is narrowed and it is narrowed on purpose: a `"time"` input's
|
|
229
|
+
* stored string is read by the host's own conversion, which `run.ts` has and
|
|
230
|
+
* this has not, so a string is taken here and the load decides it.
|
|
231
|
+
*/
|
|
232
|
+
function effectiveValue(declared: CompiledInput, settings: ChartSettings): Value {
|
|
233
|
+
const stored = storedValue(declared, settings);
|
|
234
|
+
if (stored === undefined) return defaultValue(declared);
|
|
235
|
+
const checked = checkSetting(declared, stored);
|
|
236
|
+
return checked.ok ? checked.value : defaultValue(declared);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** The declared option a stored string names, matched on its own spelling. */
|
|
240
|
+
function optionFor(options: readonly Constant[], supplied: string): Value | undefined {
|
|
241
|
+
for (const option of options) {
|
|
242
|
+
const value = constantValue(option);
|
|
243
|
+
if (spell(value) === supplied) return value;
|
|
244
|
+
}
|
|
245
|
+
return undefined;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A stored value as the signature spells it, kind and all.
|
|
250
|
+
*
|
|
251
|
+
* Two stored values that spell one string are a settings change the incremental
|
|
252
|
+
* path does not notice, and a dialog stores numbers and text that look alike
|
|
253
|
+
* written out while the engine takes one and refuses the other. Every value of
|
|
254
|
+
* another kind spells the same word, which costs nothing: none of them can be
|
|
255
|
+
* behind a held engine, because the load that would have held one refused it.
|
|
256
|
+
*/
|
|
257
|
+
function spellStored(value: unknown): string {
|
|
258
|
+
if (value === undefined) return 'unset';
|
|
259
|
+
if (value === null) return 'none';
|
|
260
|
+
if (isColourValue(value as Value)) return `color ${cssColour(value as ColourValue)}`;
|
|
261
|
+
if (typeof value === 'number') return `number ${String(value)}`;
|
|
262
|
+
if (typeof value === 'boolean') return `bool ${String(value)}`;
|
|
263
|
+
if (typeof value === 'string') return `text ${value}`;
|
|
264
|
+
return 'of another kind';
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** A value as a settings control spells it. */
|
|
268
|
+
function spell(value: Value): string {
|
|
269
|
+
if (value === null) return '';
|
|
270
|
+
if (isColourValue(value)) return cssColour(value);
|
|
271
|
+
if (typeof value === 'object') return '';
|
|
272
|
+
return String(value);
|
|
273
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four surfaces that are not columns of numbers, as the chart declares them.
|
|
3
|
+
*
|
|
4
|
+
* A plot, a band and a level all reduce to one number per bar, so they ride the
|
|
5
|
+
* table a calculation returns. A marker, a grid, a drawing object and a watched
|
|
6
|
+
* condition do not: three of them carry text and the fourth carries geometry, and
|
|
7
|
+
* a chart reads each of them from its own hook on the descriptor rather than from
|
|
8
|
+
* the table. Their shapes are declared here, away from the calculation's, because
|
|
9
|
+
* they are read at a different moment and by a different part of the chart.
|
|
10
|
+
*
|
|
11
|
+
* **Every hook takes the run it is reading and not a handle to the study.** The
|
|
12
|
+
* argument is the bars, the table the calculation just returned and the settings
|
|
13
|
+
* it was run with, and there is no per-instance store among them. What travels
|
|
14
|
+
* through a hook is therefore what those three can carry, and what cannot is
|
|
15
|
+
* written down in `produced.ts`, which is the one place this adapter solves that
|
|
16
|
+
* problem.
|
|
17
|
+
*
|
|
18
|
+
* **Every member here is narrowed to what this adapter emits.** The chart draws
|
|
19
|
+
* more shapes, more marker positions and more grid options than the language has
|
|
20
|
+
* words for, and a value the language cannot express is better left out of this
|
|
21
|
+
* file than declared and never written. A narrower type stays assignable to the
|
|
22
|
+
* chart's wider one, which is what the one line in `contract.ts` checks.
|
|
23
|
+
*/
|
|
24
|
+
import type { ChartBar, ChartLineStyle, ChartSettings, ChartValues } from './contract.js';
|
|
25
|
+
|
|
26
|
+
/** What every hook below is handed: the run whose output it is reading. */
|
|
27
|
+
export interface ChartSurfaceContext {
|
|
28
|
+
readonly bars: readonly ChartBar[];
|
|
29
|
+
readonly values: ChartValues;
|
|
30
|
+
readonly settings: ChartSettings;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Where a marker sits against its bar.
|
|
35
|
+
*
|
|
36
|
+
* The language has three (`stdlib.md` 14.3) and the chart has six. `"above"` and
|
|
37
|
+
* `"below"` are the chart's own two, and `"price"` becomes the in-bar position:
|
|
38
|
+
* the language names no price to put the marker at, and a marker drawn at the
|
|
39
|
+
* close would be this adapter deciding which price `"price"` meant.
|
|
40
|
+
*/
|
|
41
|
+
export type ChartMarkerPosition = 'aboveBar' | 'belowBar' | 'inBar';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The mark itself.
|
|
45
|
+
*
|
|
46
|
+
* Nine of the language's ten shapes are one of the chart's own under the same
|
|
47
|
+
* name. The tenth, `"label"`, is a plate of text with a tail that points at the
|
|
48
|
+
* anchor, so which of the chart's two plates it is follows from where the marker
|
|
49
|
+
* sits rather than from the word: a plate above the bar has its tail pointing
|
|
50
|
+
* down at it.
|
|
51
|
+
*/
|
|
52
|
+
export type ChartMarkerShape =
|
|
53
|
+
| 'arrowUp'
|
|
54
|
+
| 'arrowDown'
|
|
55
|
+
| 'triangleUp'
|
|
56
|
+
| 'triangleDown'
|
|
57
|
+
| 'circle'
|
|
58
|
+
| 'square'
|
|
59
|
+
| 'diamond'
|
|
60
|
+
| 'cross'
|
|
61
|
+
| 'flag'
|
|
62
|
+
| 'labelUp'
|
|
63
|
+
| 'labelDown'
|
|
64
|
+
| 'text';
|
|
65
|
+
|
|
66
|
+
/** The four glyph sizes a chart draws a marker at. */
|
|
67
|
+
export type ChartMarkerSize = 'tiny' | 'small' | 'medium' | 'big';
|
|
68
|
+
|
|
69
|
+
/** One marker on one bar: a discrete event with a label, not a column. */
|
|
70
|
+
export interface ChartMarker {
|
|
71
|
+
/** The bar's time, in the seconds a chart holds. */
|
|
72
|
+
readonly time: number;
|
|
73
|
+
readonly position: ChartMarkerPosition;
|
|
74
|
+
readonly shape: ChartMarkerShape;
|
|
75
|
+
readonly size: ChartMarkerSize;
|
|
76
|
+
readonly color: string;
|
|
77
|
+
readonly text?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ChartCellAlign = 'left' | 'center' | 'right';
|
|
81
|
+
|
|
82
|
+
/** One cell of a grid, as the last executed bar left it. */
|
|
83
|
+
export interface ChartCell {
|
|
84
|
+
readonly text: string;
|
|
85
|
+
readonly textColor?: string;
|
|
86
|
+
readonly bgColor?: string;
|
|
87
|
+
readonly align?: ChartCellAlign;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Which corner of the pane a grid is pinned to. */
|
|
91
|
+
export type ChartTablePosition =
|
|
92
|
+
| 'top-left'
|
|
93
|
+
| 'top-right'
|
|
94
|
+
| 'bottom-left'
|
|
95
|
+
| 'bottom-right';
|
|
96
|
+
|
|
97
|
+
/** The grid options this adapter sets. A chart's own defaults fill the rest. */
|
|
98
|
+
export interface ChartTableOptions {
|
|
99
|
+
readonly position: ChartTablePosition;
|
|
100
|
+
readonly borderWidth: number;
|
|
101
|
+
/** The backdrop behind the whole grid, which is the grid's own `bgColor`. */
|
|
102
|
+
readonly background?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** A grid of cells pinned to a corner, and the options it is drawn with. */
|
|
106
|
+
export interface ChartGrid {
|
|
107
|
+
readonly rows: readonly (readonly ChartCell[])[];
|
|
108
|
+
readonly options?: ChartTableOptions;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** One end of a drawing: a time on the shared axis, a price on the pane's scale. */
|
|
112
|
+
export interface ChartAnchor {
|
|
113
|
+
readonly time: number;
|
|
114
|
+
readonly price: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* One free-standing shape, anchored to time and price rather than to a bar.
|
|
119
|
+
*
|
|
120
|
+
* The four kinds are the language's four, `stdlib.md` 14.4, and the fields are
|
|
121
|
+
* the chart's own names for the same arguments. The whole list is replaced on
|
|
122
|
+
* every recompute, which is what makes a script that deletes an object have it
|
|
123
|
+
* disappear and a script that rolls a bar back not accumulate one per tick.
|
|
124
|
+
*/
|
|
125
|
+
export type ChartDrawing =
|
|
126
|
+
| {
|
|
127
|
+
readonly kind: 'line';
|
|
128
|
+
readonly from: ChartAnchor;
|
|
129
|
+
readonly to: ChartAnchor;
|
|
130
|
+
readonly color?: string;
|
|
131
|
+
readonly lineWidth?: number;
|
|
132
|
+
readonly lineStyle?: ChartLineStyle;
|
|
133
|
+
readonly extendLeft?: boolean;
|
|
134
|
+
readonly extendRight?: boolean;
|
|
135
|
+
}
|
|
136
|
+
| {
|
|
137
|
+
readonly kind: 'box';
|
|
138
|
+
readonly from: ChartAnchor;
|
|
139
|
+
readonly to: ChartAnchor;
|
|
140
|
+
readonly color?: string;
|
|
141
|
+
readonly fillColor?: string;
|
|
142
|
+
readonly opacity?: number;
|
|
143
|
+
readonly lineWidth?: number;
|
|
144
|
+
readonly text?: string;
|
|
145
|
+
readonly textColor?: string;
|
|
146
|
+
readonly tooltip?: string;
|
|
147
|
+
}
|
|
148
|
+
| {
|
|
149
|
+
readonly kind: 'label';
|
|
150
|
+
readonly at: ChartAnchor;
|
|
151
|
+
readonly text: string;
|
|
152
|
+
readonly color?: string;
|
|
153
|
+
readonly textColor?: string;
|
|
154
|
+
readonly align?: ChartCellAlign;
|
|
155
|
+
readonly tooltip?: string;
|
|
156
|
+
}
|
|
157
|
+
| {
|
|
158
|
+
readonly kind: 'polyline';
|
|
159
|
+
readonly points: readonly ChartAnchor[];
|
|
160
|
+
readonly color?: string;
|
|
161
|
+
readonly lineWidth?: number;
|
|
162
|
+
readonly closed?: boolean;
|
|
163
|
+
readonly fillColor?: string;
|
|
164
|
+
readonly opacity?: number;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** What an alert's condition is handed, for the bar it is judging. */
|
|
168
|
+
export interface ChartAlertContext extends ChartSurfaceContext {
|
|
169
|
+
readonly index: number;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* One watched condition, declared before bar 0 and evaluated by the chart.
|
|
174
|
+
*
|
|
175
|
+
* The chart judges bars that are new since it last looked, which is the rule
|
|
176
|
+
* `stdlib.md` 16.2 states from the other side: a study added to a chart holding
|
|
177
|
+
* two years of bars announces none of them.
|
|
178
|
+
*/
|
|
179
|
+
export interface ChartAlertSpec {
|
|
180
|
+
readonly id: string;
|
|
181
|
+
readonly title: string;
|
|
182
|
+
/**
|
|
183
|
+
* The notification's text, computed for the bar that fired.
|
|
184
|
+
*
|
|
185
|
+
* The chart takes either a fixed string or a function of the same context
|
|
186
|
+
* `when` was judged on, and it calls the function only for a bar `when`
|
|
187
|
+
* accepted. This adapter writes only the function: a declared alert's message
|
|
188
|
+
* is an expression evaluated on the bar, so a fixed string could only ever be
|
|
189
|
+
* the title again, which is what this used to hand over.
|
|
190
|
+
*/
|
|
191
|
+
message?(ctx: ChartAlertContext): string;
|
|
192
|
+
when(ctx: ChartAlertContext): boolean;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Bars of another instrument or interval, as the host is asked for them.
|
|
197
|
+
*
|
|
198
|
+
* There is no cancellation token on it, and none is needed: a chart bounds every
|
|
199
|
+
* request it forwards by the study instance's own lifetime, so a study removed
|
|
200
|
+
* while another instrument is loading is not answered after it is gone. A second
|
|
201
|
+
* token carried from here would be the same fact stated twice, and the weaker of
|
|
202
|
+
* the two.
|
|
203
|
+
*/
|
|
204
|
+
export interface ChartBarsRequest {
|
|
205
|
+
readonly symbol: string;
|
|
206
|
+
readonly exchange?: string;
|
|
207
|
+
readonly interval: string;
|
|
208
|
+
/** UTC seconds, both ends. */
|
|
209
|
+
readonly from: number;
|
|
210
|
+
readonly to: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** What a study says about the data it is waiting for. */
|
|
214
|
+
export type ChartDataStatus =
|
|
215
|
+
| { readonly state: 'loading' | 'ready' | 'empty' | 'unsupported' }
|
|
216
|
+
| { readonly state: 'error'; readonly error: unknown };
|
|
217
|
+
|
|
218
|
+
/** Why the host says the bars or the identity behind a study have moved. */
|
|
219
|
+
export type ChartDataChange = 'context' | 'range';
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The lifecycle of one study instance, for the data that is not on its bars.
|
|
223
|
+
*
|
|
224
|
+
* It is the only place the chart offers a transport, and a read of another
|
|
225
|
+
* instrument is the only thing in this language that needs one. Everything else
|
|
226
|
+
* a study produces is computed from bars the chart already holds.
|
|
227
|
+
*/
|
|
228
|
+
export interface ChartAttachContext {
|
|
229
|
+
/** Scratch this instance owns: the same object the calculation receives. */
|
|
230
|
+
readonly store: Record<string, unknown>;
|
|
231
|
+
/** Ask the host for another instrument's bars. Absent when it serves none. */
|
|
232
|
+
requestBars?(request: ChartBarsRequest): Promise<readonly ChartBar[]>;
|
|
233
|
+
/** Run the calculation again and repaint, once an answer has arrived. */
|
|
234
|
+
requestRecompute(): void;
|
|
235
|
+
setDataStatus?(status: ChartDataStatus): void;
|
|
236
|
+
setDataRetry?(retry: (() => void) | null): void;
|
|
237
|
+
subscribeDataChanges?(listener: (change: ChartDataChange) => void): () => void;
|
|
238
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared grids into the chart's summary grid.
|
|
3
|
+
*
|
|
4
|
+
* **A table is written, not plotted.** It is the one output that is not a value
|
|
5
|
+
* per bar: its cells are written by library calls against a handle, into a
|
|
6
|
+
* buffer the engine empties at the start of every execution of a bar
|
|
7
|
+
* (`compiled-program.md` 2.8 and 5.1). What survives is what the last executed
|
|
8
|
+
* bar wrote, which is what a grid pinned to a corner of a pane shows.
|
|
9
|
+
*
|
|
10
|
+
* **So it is read once, after the run, and never per bar.** The obvious way to
|
|
11
|
+
* get this wrong is to collect a grid for every bar of a long history in order
|
|
12
|
+
* to display the last one, which costs the length of the history and throws all
|
|
13
|
+
* of it away. The engine holds one buffer per grid rather than one per bar, and
|
|
14
|
+
* this reads it exactly once per calculation, so a hundred thousand bars cost
|
|
15
|
+
* the same as ten.
|
|
16
|
+
*
|
|
17
|
+
* A script pays the other half of that bill for itself: `cell()` on every bar of
|
|
18
|
+
* a long history does the work of writing a grid that only the last bar's copy
|
|
19
|
+
* is kept from, and the documentation says to guard it with `bar.isLast`. That
|
|
20
|
+
* is a script's decision and not one this can make for it, because the buffer is
|
|
21
|
+
* cleared per bar and an engine cannot know which execution is the last one
|
|
22
|
+
* until it is.
|
|
23
|
+
*
|
|
24
|
+
* **The engine's cells are sparse and the chart's grid is dense.** A script
|
|
25
|
+
* writes the cells it has something to say about; the chart draws rows of cells.
|
|
26
|
+
* So the declared size is filled with blank cells and the written ones are
|
|
27
|
+
* placed into it, which is what `language.md` 6.7 asks for from the other
|
|
28
|
+
* direction: a cell nothing was written into is blank, never a zero.
|
|
29
|
+
*
|
|
30
|
+
* **A chart pane holds one grid and the language declares as many as it likes.**
|
|
31
|
+
* The descriptor has one `table` hook, so the first declared grid is the one
|
|
32
|
+
* drawn and any after it are not. That is a gap in the chart's own contract
|
|
33
|
+
* rather than a choice worth making here: there is no second hook to write to,
|
|
34
|
+
* and merging two grids into one would put cells somewhere the script never
|
|
35
|
+
* asked for.
|
|
36
|
+
*
|
|
37
|
+
* **What ought to happen is a refusal, and it cannot be written yet.** A study
|
|
38
|
+
* whose second grid never appears is a study with no explanation, so the second
|
|
39
|
+
* `table()` should be refused where it is written, naming the limit. Every
|
|
40
|
+
* diagnostic in this project carries a catalogue code and the catalogue has
|
|
41
|
+
* none for "the chart cannot draw something this study declares"; inventing one
|
|
42
|
+
* here is the one thing that is not allowed, so the gap is reported instead, in
|
|
43
|
+
* `issues/0011-a-second-declared-grid-is-dropped-with-nothing-said.md`, with the
|
|
44
|
+
* sentence it should carry.
|
|
45
|
+
*
|
|
46
|
+
* Until it lands, the drop is at least no longer silent inside this repository:
|
|
47
|
+
* it is recorded in `spec/chart-narrowings.json` with its reason, and
|
|
48
|
+
* `scripts/check-chart-surface.mjs` fails the build if this adapter ever drops
|
|
49
|
+
* anything else a compiled program declares without recording it there.
|
|
50
|
+
*/
|
|
51
|
+
import type { CompiledProgram, Grid as DeclaredGrid } from '../../core/emit/index.js';
|
|
52
|
+
import type { Grid, GridCell } from '../../core/engine/index.js';
|
|
53
|
+
import { cssColour, cssOf } from './colours.js';
|
|
54
|
+
import { colourField, numberField, stringField } from './fields.js';
|
|
55
|
+
import type { InputLookup } from './fields.js';
|
|
56
|
+
import type {
|
|
57
|
+
ChartCell,
|
|
58
|
+
ChartCellAlign,
|
|
59
|
+
ChartGrid,
|
|
60
|
+
ChartTablePosition,
|
|
61
|
+
} from './surfaces.js';
|
|
62
|
+
|
|
63
|
+
/** The language's four corners, in the chart's own words. */
|
|
64
|
+
const CORNERS: Readonly<Record<string, ChartTablePosition>> = {
|
|
65
|
+
topLeft: 'top-left',
|
|
66
|
+
topRight: 'top-right',
|
|
67
|
+
bottomLeft: 'bottom-left',
|
|
68
|
+
bottomRight: 'bottom-right',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const ALIGNMENTS: readonly string[] = ['left', 'center', 'right'];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The grid a chart draws, from the declaration and the engine's buffer.
|
|
75
|
+
*
|
|
76
|
+
* The buffer is paired with the declaration by the key both of them carry
|
|
77
|
+
* rather than by position. The engine reads its grids in declaration order, so
|
|
78
|
+
* the two agree today, and a pairing by position is one reordering away from
|
|
79
|
+
* drawing one grid's cells into another grid's shape, which would be a wrong
|
|
80
|
+
* table that looks like a right one.
|
|
81
|
+
*/
|
|
82
|
+
export function buildTable(
|
|
83
|
+
program: CompiledProgram,
|
|
84
|
+
lookup: InputLookup,
|
|
85
|
+
written: readonly Grid[],
|
|
86
|
+
): ChartGrid | null {
|
|
87
|
+
const declared = program.outputs.tables[0];
|
|
88
|
+
if (declared === undefined) return null;
|
|
89
|
+
return oneTable(declared, lookup, written.find((one) => one.key === declared.key));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function oneTable(
|
|
93
|
+
declared: DeclaredGrid,
|
|
94
|
+
lookup: InputLookup,
|
|
95
|
+
written: Grid | undefined,
|
|
96
|
+
): ChartGrid {
|
|
97
|
+
const position = stringField(declared.position, lookup, 'topRight');
|
|
98
|
+
const textColour = colourField(declared.options.textColor, lookup);
|
|
99
|
+
const bgColour = colourField(declared.options.bgColor, lookup);
|
|
100
|
+
const rows = whole(numberField(declared.rows, lookup, 0));
|
|
101
|
+
const cols = whole(numberField(declared.cols, lookup, 0));
|
|
102
|
+
const fallback = textColour === undefined ? undefined : cssColour(textColour);
|
|
103
|
+
|
|
104
|
+
const grid: ChartCell[][] = [];
|
|
105
|
+
for (let row = 0; row < rows; row += 1) {
|
|
106
|
+
grid.push(new Array<ChartCell>(cols).fill({ text: '' }));
|
|
107
|
+
}
|
|
108
|
+
for (const cell of written?.cells ?? []) {
|
|
109
|
+
const built = oneCell(cell, fallback);
|
|
110
|
+
const line = grid[cell.row];
|
|
111
|
+
if (built === undefined || line === undefined || cell.col >= cols) continue;
|
|
112
|
+
line[cell.col] = built;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
rows: grid,
|
|
117
|
+
options: {
|
|
118
|
+
position: CORNERS[position] ?? 'top-right',
|
|
119
|
+
borderWidth: numberField(declared.options.borderWidth, lookup, 0),
|
|
120
|
+
...(bgColour === undefined ? {} : { background: cssColour(bgColour) }),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* One written cell, or none.
|
|
127
|
+
*
|
|
128
|
+
* A cell whose text is absent is dropped rather than drawn, which leaves the
|
|
129
|
+
* blank cell that was already in its place: absence reaching a drawing surface
|
|
130
|
+
* is a gap, and a blank cell is what a grid draws where nothing was written
|
|
131
|
+
* (`language.md` 6.7).
|
|
132
|
+
*
|
|
133
|
+
* The grid's own text colour is written into each cell that named none, because
|
|
134
|
+
* the chart carries a text colour per cell and the language declares one for the
|
|
135
|
+
* whole grid as well.
|
|
136
|
+
*/
|
|
137
|
+
function oneCell(cell: GridCell, fallback: string | undefined): ChartCell | undefined {
|
|
138
|
+
if (typeof cell.text !== 'string') return undefined;
|
|
139
|
+
const align = typeof cell.align === 'string' && ALIGNMENTS.includes(cell.align)
|
|
140
|
+
? (cell.align as ChartCellAlign)
|
|
141
|
+
: 'left';
|
|
142
|
+
const textColour = cssOf(cell.textColor) ?? fallback;
|
|
143
|
+
const bgColour = cssOf(cell.bgColor);
|
|
144
|
+
return {
|
|
145
|
+
text: cell.text,
|
|
146
|
+
...(textColour === undefined ? {} : { textColor: textColour }),
|
|
147
|
+
...(bgColour === undefined ? {} : { bgColor: bgColour }),
|
|
148
|
+
align,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** A declared size, as a count of rows or columns a grid can be built with. */
|
|
153
|
+
function whole(size: number): number {
|
|
154
|
+
return size > 0 ? Math.floor(size) : 0;
|
|
155
|
+
}
|