@davidsouther/jiffies 1.1.0 → 2.0.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/{build → lib/cjs}/assert.d.ts +23 -23
- package/lib/cjs/assert.js +40 -0
- package/{build → lib/cjs}/case.d.ts +1 -1
- package/lib/cjs/case.js +9 -0
- package/{build → lib/cjs}/components/button_bar.d.ts +8 -8
- package/lib/cjs/components/button_bar.js +29 -0
- package/{build → lib/cjs}/components/inline_edit.d.ts +12 -12
- package/lib/cjs/components/inline_edit.js +51 -0
- package/{build → lib/cjs}/components/logger.d.ts +6 -6
- package/lib/cjs/components/logger.js +27 -0
- package/lib/cjs/components/select.d.ts +10 -0
- package/lib/cjs/components/select.js +6 -0
- package/lib/cjs/components/test.d.ts +1 -0
- package/lib/cjs/components/test.js +7 -0
- package/{build → lib/cjs}/components/virtual_scroll.d.ts +40 -40
- package/lib/cjs/components/virtual_scroll.js +102 -0
- package/{build → lib/cjs}/components/virtual_scroll.test.d.ts +1 -1
- package/lib/cjs/components/virtual_scroll.test.js +22 -0
- package/{build → lib/cjs}/context.d.ts +15 -15
- package/lib/cjs/context.js +48 -0
- package/{build → lib/cjs}/context.test.d.ts +1 -1
- package/lib/cjs/context.test.js +48 -0
- package/{build → lib/cjs}/debounce.d.ts +1 -1
- package/lib/cjs/debounce.js +11 -0
- package/lib/cjs/diff.d.ts +15 -0
- package/lib/cjs/diff.js +58 -0
- package/{build/components/test.d.ts → lib/cjs/diff.test.d.ts} +1 -1
- package/lib/cjs/diff.test.js +41 -0
- package/{build → lib/cjs}/display.d.ts +5 -5
- package/lib/cjs/display.js +16 -0
- package/{build → lib/cjs}/dom/css/border.d.ts +11 -11
- package/lib/cjs/dom/css/border.js +33 -0
- package/{build → lib/cjs}/dom/css/constants.d.ts +31 -31
- package/lib/cjs/dom/css/constants.js +31 -0
- package/{build → lib/cjs}/dom/css/core.d.ts +5 -5
- package/lib/cjs/dom/css/core.js +31 -0
- package/{build → lib/cjs}/dom/css/fstyle.d.ts +5 -5
- package/lib/cjs/dom/css/fstyle.js +36 -0
- package/{build → lib/cjs}/dom/css/sizing.d.ts +5 -5
- package/lib/cjs/dom/css/sizing.js +14 -0
- package/{build → lib/cjs}/dom/dom.d.ts +27 -26
- package/lib/cjs/dom/dom.js +110 -0
- package/{build → lib/cjs}/dom/fc.d.ts +14 -14
- package/lib/cjs/dom/fc.js +39 -0
- package/{build → lib/cjs}/dom/fc.test.d.ts +1 -1
- package/lib/cjs/dom/fc.test.js +23 -0
- package/{build → lib/cjs}/dom/form/form.app.d.ts +1 -1
- package/lib/cjs/dom/form/form.app.js +27 -0
- package/{build → lib/cjs}/dom/form/form.d.ts +26 -26
- package/lib/cjs/dom/form/form.js +49 -0
- package/{build → lib/cjs}/dom/form/form.test.d.ts +0 -0
- package/{build → lib/cjs}/dom/form/form.test.js +1 -1
- package/{build → lib/cjs}/dom/html.d.ts +113 -113
- package/lib/cjs/dom/html.js +119 -0
- package/{build → lib/cjs}/dom/html.test.d.ts +1 -1
- package/lib/cjs/dom/html.test.js +60 -0
- package/lib/cjs/dom/observable.d.ts +2 -0
- package/lib/cjs/dom/observable.js +10 -0
- package/{build/observable → lib/cjs/dom}/observable.test.d.ts +1 -1
- package/lib/cjs/dom/observable.test.js +35 -0
- package/{build → lib/cjs}/dom/provide.d.ts +3 -3
- package/lib/cjs/dom/provide.js +12 -0
- package/{build → lib/cjs}/dom/router/link.d.ts +6 -6
- package/lib/cjs/dom/router/link.js +7 -0
- package/{build → lib/cjs}/dom/router/router.d.ts +12 -12
- package/lib/cjs/dom/router/router.js +52 -0
- package/{build → lib/cjs}/dom/svg.d.ts +64 -64
- package/lib/cjs/dom/svg.js +69 -0
- package/lib/cjs/dom/test.d.ts +1 -0
- package/lib/cjs/dom/test.js +13 -0
- package/{build → lib/cjs}/dom/types/css.d.ts +6612 -6612
- package/lib/cjs/dom/types/css.js +24 -0
- package/{build → lib/cjs}/dom/types/dom.d.ts +0 -0
- package/{build → lib/cjs}/dom/types/dom.js +1 -1
- package/{build → lib/cjs}/dom/types/html.d.ts +616 -616
- package/lib/cjs/dom/types/html.js +2 -0
- package/{build → lib/cjs}/dom/xml.d.ts +1 -1
- package/lib/cjs/dom/xml.js +8 -0
- package/{build → lib/cjs}/equal.d.ts +5 -5
- package/lib/cjs/equal.js +43 -0
- package/{build → lib/cjs}/equal.test.d.ts +1 -1
- package/lib/cjs/equal.test.js +22 -0
- package/{build → lib/cjs}/flags.d.ts +7 -7
- package/lib/cjs/flags.js +52 -0
- package/{build → lib/cjs}/flags.test.d.ts +1 -1
- package/lib/cjs/flags.test.js +37 -0
- package/{build → lib/cjs}/fs.d.ts +48 -48
- package/lib/cjs/fs.js +151 -0
- package/{build → lib/cjs}/fs.test.d.ts +1 -1
- package/lib/cjs/fs.test.js +45 -0
- package/{build → lib/cjs}/generator.d.ts +1 -1
- package/lib/cjs/generator.js +14 -0
- package/{build → lib/cjs}/generator.test.d.ts +1 -1
- package/lib/cjs/generator.test.js +26 -0
- package/{build → lib/cjs}/is_browser.d.ts +1 -1
- package/lib/cjs/is_browser.js +4 -0
- package/{build → lib/cjs}/loader.d.mts +22 -22
- package/lib/cjs/loader.mjs +40 -0
- package/{build → lib/cjs}/lock.d.ts +1 -1
- package/lib/cjs/lock.js +27 -0
- package/{build → lib/cjs}/lock.test.d.ts +1 -1
- package/lib/cjs/lock.test.js +18 -0
- package/{build → lib/cjs}/log.d.ts +26 -26
- package/lib/cjs/log.js +54 -0
- package/lib/cjs/observable/event.d.ts +35 -0
- package/lib/cjs/observable/event.js +61 -0
- package/lib/cjs/observable/observable.d.ts +132 -0
- package/lib/cjs/observable/observable.js +363 -0
- package/lib/cjs/observable/observable.test.d.ts +1 -0
- package/lib/cjs/observable/observable.test.js +65 -0
- package/{build → lib/cjs}/range.d.ts +1 -1
- package/lib/cjs/range.js +11 -0
- package/{build → lib/cjs}/result.d.ts +31 -31
- package/lib/cjs/result.js +80 -0
- package/{build → lib/cjs}/result.test.d.ts +1 -1
- package/lib/cjs/result.test.js +73 -0
- package/{build → lib/cjs}/safe.d.ts +1 -1
- package/lib/cjs/safe.js +14 -0
- package/{build → lib/cjs}/scope/describe.d.ts +18 -18
- package/lib/cjs/scope/describe.js +73 -0
- package/{build → lib/cjs}/scope/display/console.d.ts +2 -2
- package/lib/cjs/scope/display/console.js +25 -0
- package/{build → lib/cjs}/scope/display/dom.d.ts +3 -3
- package/lib/cjs/scope/display/dom.js +30 -0
- package/{build → lib/cjs}/scope/display/junit.d.ts +2 -2
- package/lib/cjs/scope/display/junit.js +21 -0
- package/{build → lib/cjs}/scope/execute.d.ts +12 -12
- package/lib/cjs/scope/execute.js +91 -0
- package/{build → lib/cjs}/scope/expect.d.ts +23 -23
- package/lib/cjs/scope/expect.js +114 -0
- package/{build → lib/cjs}/scope/fix.d.ts +4 -4
- package/lib/cjs/scope/fix.js +26 -0
- package/{build → lib/cjs}/scope/index.d.ts +3 -3
- package/lib/cjs/scope/index.js +15 -0
- package/{build → lib/cjs}/scope/scope.d.ts +17 -17
- package/lib/cjs/scope/scope.js +2 -0
- package/lib/cjs/scope/state.d.ts +1 -0
- package/lib/cjs/scope/state.js +11 -0
- package/{build → lib/cjs}/server/http/apps.d.ts +5 -5
- package/lib/cjs/server/http/apps.js +27 -0
- package/{build → lib/cjs}/server/http/css.d.ts +5 -5
- package/lib/cjs/server/http/css.js +54 -0
- package/{build → lib/cjs}/server/http/index.d.ts +21 -21
- package/lib/cjs/server/http/index.js +77 -0
- package/{build → lib/cjs}/server/http/response.d.ts +4 -4
- package/lib/cjs/server/http/response.js +45 -0
- package/{build → lib/cjs}/server/http/sitemap.d.ts +2 -2
- package/lib/cjs/server/http/sitemap.js +46 -0
- package/{build → lib/cjs}/server/http/static.d.ts +2 -2
- package/lib/cjs/server/http/static.js +25 -0
- package/{build → lib/cjs}/server/http/typescript.d.ts +5 -5
- package/lib/cjs/server/http/typescript.js +44 -0
- package/{build → lib/cjs}/server/main.d.ts +2 -2
- package/lib/cjs/server/main.js +14 -0
- package/{build → lib/cjs}/test.d.mts +2 -2
- package/lib/cjs/test.mjs +28 -0
- package/{build → lib/cjs}/test_all.d.ts +9 -7
- package/lib/cjs/test_all.js +30 -0
- package/{build → lib/cjs}/transpile.d.mts +3 -3
- package/lib/cjs/transpile.mjs +22 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/assert.d.ts +23 -0
- package/{build → lib/esm}/assert.js +33 -33
- package/lib/esm/case.d.ts +1 -0
- package/{build → lib/esm}/case.js +5 -5
- package/lib/esm/components/button_bar.d.ts +8 -0
- package/{build → lib/esm}/components/button_bar.js +27 -27
- package/lib/esm/components/inline_edit.d.ts +12 -0
- package/{build → lib/esm}/components/inline_edit.js +48 -48
- package/lib/esm/components/logger.d.ts +6 -0
- package/{build → lib/esm}/components/logger.js +22 -22
- package/lib/esm/components/select.d.ts +10 -0
- package/{build → lib/esm}/components/select.js +3 -3
- package/lib/esm/components/test.d.ts +1 -0
- package/lib/esm/components/test.js +3 -0
- package/lib/esm/components/virtual_scroll.d.ts +40 -0
- package/{build → lib/esm}/components/virtual_scroll.js +94 -94
- package/lib/esm/components/virtual_scroll.test.d.ts +1 -0
- package/{build → lib/esm}/components/virtual_scroll.test.js +20 -21
- package/lib/esm/context.d.ts +15 -0
- package/{build → lib/esm}/context.js +43 -43
- package/lib/esm/context.test.d.ts +1 -0
- package/{build → lib/esm}/context.test.js +46 -46
- package/lib/esm/debounce.d.ts +1 -0
- package/{build → lib/esm}/debounce.js +7 -7
- package/lib/esm/diff.d.ts +15 -0
- package/lib/esm/diff.js +54 -0
- package/lib/esm/diff.test.d.ts +1 -0
- package/lib/esm/diff.test.js +39 -0
- package/lib/esm/display.d.ts +5 -0
- package/{build → lib/esm}/display.js +11 -11
- package/lib/esm/dom/css/border.d.ts +11 -0
- package/{build → lib/esm}/dom/css/border.js +27 -27
- package/lib/esm/dom/css/constants.d.ts +31 -0
- package/{build → lib/esm}/dom/css/constants.js +28 -28
- package/lib/esm/dom/css/core.d.ts +5 -0
- package/{build → lib/esm}/dom/css/core.js +24 -24
- package/lib/esm/dom/css/fstyle.d.ts +5 -0
- package/{build → lib/esm}/dom/css/fstyle.js +32 -32
- package/lib/esm/dom/css/sizing.d.ts +5 -0
- package/{build → lib/esm}/dom/css/sizing.js +10 -10
- package/lib/esm/dom/dom.d.ts +27 -0
- package/{build → lib/esm}/dom/dom.js +104 -95
- package/lib/esm/dom/fc.d.ts +14 -0
- package/{build → lib/esm}/dom/fc.js +35 -36
- package/lib/esm/dom/fc.test.d.ts +1 -0
- package/{build → lib/esm}/dom/fc.test.js +21 -21
- package/lib/esm/dom/form/form.app.d.ts +1 -0
- package/{build → lib/esm}/dom/form/form.app.js +23 -23
- package/lib/esm/dom/form/form.d.ts +26 -0
- package/{build → lib/esm}/dom/form/form.js +34 -34
- package/lib/esm/dom/form/form.test.d.ts +0 -0
- package/lib/esm/dom/form/form.test.js +1 -0
- package/lib/esm/dom/html.d.ts +113 -0
- package/{build → lib/esm}/dom/html.js +114 -114
- package/lib/esm/dom/html.test.d.ts +1 -0
- package/{build → lib/esm}/dom/html.test.js +58 -58
- package/lib/esm/dom/observable.d.ts +2 -0
- package/lib/esm/dom/observable.js +6 -0
- package/lib/esm/dom/observable.test.d.ts +1 -0
- package/lib/esm/dom/observable.test.js +33 -0
- package/lib/esm/dom/provide.d.ts +3 -0
- package/{build → lib/esm}/dom/provide.js +7 -7
- package/lib/esm/dom/router/link.d.ts +6 -0
- package/{build → lib/esm}/dom/router/link.js +3 -3
- package/lib/esm/dom/router/router.d.ts +12 -0
- package/{build → lib/esm}/dom/router/router.js +49 -49
- package/lib/esm/dom/svg.d.ts +64 -0
- package/{build → lib/esm}/dom/svg.js +65 -65
- package/lib/esm/dom/test.d.ts +1 -0
- package/lib/esm/dom/test.js +9 -0
- package/lib/esm/dom/types/css.d.ts +6612 -0
- package/{build → lib/esm}/dom/types/css.js +23 -23
- package/lib/esm/dom/types/dom.d.ts +0 -0
- package/lib/esm/dom/types/dom.js +1 -0
- package/lib/esm/dom/types/html.d.ts +616 -0
- package/{build → lib/esm}/dom/types/html.js +1 -1
- package/lib/esm/dom/xml.d.ts +1 -0
- package/{build → lib/esm}/dom/xml.js +4 -4
- package/lib/esm/equal.d.ts +5 -0
- package/{build → lib/esm}/equal.js +37 -37
- package/lib/esm/equal.test.d.ts +1 -0
- package/{build → lib/esm}/equal.test.js +20 -20
- package/lib/esm/flags.d.ts +7 -0
- package/{build → lib/esm}/flags.js +48 -48
- package/lib/esm/flags.test.d.ts +1 -0
- package/{build → lib/esm}/flags.test.js +35 -35
- package/lib/esm/fs.d.ts +48 -0
- package/{build → lib/esm}/fs.js +144 -144
- package/lib/esm/fs.test.d.ts +1 -0
- package/{build → lib/esm}/fs.test.js +43 -43
- package/lib/esm/generator.d.ts +1 -0
- package/{build → lib/esm}/generator.js +10 -10
- package/lib/esm/generator.test.d.ts +1 -0
- package/{build → lib/esm}/generator.test.js +24 -24
- package/lib/esm/is_browser.d.ts +1 -0
- package/{build → lib/esm}/is_browser.js +1 -1
- package/lib/esm/loader.d.mts +22 -0
- package/{build → lib/esm}/loader.mjs +35 -35
- package/lib/esm/lock.d.ts +1 -0
- package/{build → lib/esm}/lock.js +23 -23
- package/lib/esm/lock.test.d.ts +1 -0
- package/{build → lib/esm}/lock.test.js +16 -16
- package/lib/esm/log.d.ts +26 -0
- package/{build → lib/esm}/log.js +46 -46
- package/lib/esm/observable/event.d.ts +35 -0
- package/lib/esm/observable/event.js +46 -0
- package/lib/esm/observable/observable.d.ts +132 -0
- package/lib/esm/observable/observable.js +343 -0
- package/lib/esm/observable/observable.test.d.ts +1 -0
- package/lib/esm/observable/observable.test.js +63 -0
- package/lib/esm/range.d.ts +1 -0
- package/{build → lib/esm}/range.js +7 -7
- package/lib/esm/result.d.ts +31 -0
- package/{build → lib/esm}/result.js +65 -65
- package/lib/esm/result.test.d.ts +1 -0
- package/{build → lib/esm}/result.test.js +71 -71
- package/lib/esm/safe.d.ts +1 -0
- package/{build → lib/esm}/safe.js +10 -10
- package/lib/esm/scope/describe.d.ts +18 -0
- package/{build → lib/esm}/scope/describe.js +60 -61
- package/lib/esm/scope/display/console.d.ts +2 -0
- package/{build → lib/esm}/scope/display/console.js +21 -21
- package/lib/esm/scope/display/dom.d.ts +3 -0
- package/{build → lib/esm}/scope/display/dom.js +26 -26
- package/lib/esm/scope/display/junit.d.ts +2 -0
- package/{build → lib/esm}/scope/display/junit.js +17 -17
- package/lib/esm/scope/execute.d.ts +12 -0
- package/{build → lib/esm}/scope/execute.js +85 -85
- package/lib/esm/scope/expect.d.ts +23 -0
- package/{build → lib/esm}/scope/expect.js +108 -108
- package/lib/esm/scope/fix.d.ts +4 -0
- package/{build → lib/esm}/scope/fix.js +22 -22
- package/lib/esm/scope/index.d.ts +3 -0
- package/{build → lib/esm}/scope/index.js +3 -3
- package/lib/esm/scope/scope.d.ts +17 -0
- package/{build → lib/esm}/scope/scope.js +1 -1
- package/lib/esm/scope/state.d.ts +1 -0
- package/lib/esm/scope/state.js +7 -0
- package/lib/esm/server/http/apps.d.ts +5 -0
- package/{build → lib/esm}/server/http/apps.js +23 -23
- package/lib/esm/server/http/css.d.ts +5 -0
- package/{build → lib/esm}/server/http/css.js +50 -50
- package/lib/esm/server/http/index.d.ts +21 -0
- package/{build → lib/esm}/server/http/index.js +73 -73
- package/lib/esm/server/http/response.d.ts +4 -0
- package/{build → lib/esm}/server/http/response.js +40 -40
- package/lib/esm/server/http/sitemap.d.ts +2 -0
- package/{build → lib/esm}/server/http/sitemap.js +42 -42
- package/lib/esm/server/http/static.d.ts +2 -0
- package/{build → lib/esm}/server/http/static.js +21 -21
- package/lib/esm/server/http/typescript.d.ts +5 -0
- package/{build → lib/esm}/server/http/typescript.js +40 -40
- package/lib/esm/server/main.d.ts +2 -0
- package/{build → lib/esm}/server/main.js +12 -9
- package/lib/esm/test.d.mts +2 -0
- package/lib/esm/test.mjs +26 -0
- package/lib/esm/test_all.d.ts +9 -0
- package/{build → lib/esm}/test_all.js +28 -18
- package/lib/esm/transpile.d.mts +3 -0
- package/{build → lib/esm}/transpile.mjs +18 -18
- package/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -14
- package/src/assert.ts +1 -1
- package/src/components/button_bar.ts +3 -3
- package/src/components/inline_edit.ts +3 -3
- package/src/components/logger.ts +3 -3
- package/src/components/select.ts +3 -3
- package/src/components/test.js +3 -2
- package/src/context.ts +3 -3
- package/src/diff.ts +2 -2
- package/src/dom/css/border.ts +3 -3
- package/src/dom/css/core.ts +1 -1
- package/src/dom/css/fstyle.ts +2 -2
- package/src/dom/css/sizing.ts +1 -1
- package/src/dom/dom.ts +1 -1
- package/src/dom/fc.test.ts +3 -3
- package/src/dom/fc.ts +1 -1
- package/src/dom/form/form.app.ts +2 -2
- package/src/dom/form/form.ts +3 -3
- package/src/dom/html.test.ts +3 -3
- package/src/dom/html.ts +1 -1
- package/src/dom/observable.test.ts +6 -6
- package/src/dom/observable.ts +1 -1
- package/src/dom/provide.ts +1 -1
- package/src/dom/router/link.ts +2 -2
- package/src/dom/router/router.ts +2 -2
- package/src/dom/svg.ts +1 -1
- package/src/dom/test.ts +8 -6
- package/src/dom/types/html.ts +1 -1
- package/src/equal.ts +1 -1
- package/src/flags.ts +1 -1
- package/src/fs.ts +4 -4
- package/src/index.html +6 -6
- package/src/observable/event.ts +2 -2
- package/src/observable/observable.test.ts +2 -2
- package/src/observable/observable.ts +72 -12
- package/src/pico/_variables.scss +1 -1
- package/src/pico/layout/_sectioning.scss +2 -0
- package/src/result.ts +1 -1
- package/src/scope/describe.ts +2 -5
- package/src/scope/display/console.ts +4 -4
- package/src/scope/display/dom.ts +6 -6
- package/src/scope/display/junit.ts +3 -3
- package/src/scope/execute.ts +2 -2
- package/src/scope/expect.ts +3 -3
- package/src/scope/state.ts +10 -0
- package/src/server/http/sitemap.ts +1 -1
- package/src/server/main.ts +9 -2
- package/src/test.mjs +22 -18
- package/src/test_all.ts +10 -0
- package/build/components/select.d.ts +0 -13
- package/build/components/test.js +0 -2
- package/build/dom/test.d.ts +0 -1
- package/build/dom/test.js +0 -2
- package/build/observable/observable.d.ts +0 -83
- package/build/observable/observable.js +0 -148
- package/build/observable/observable.test.js +0 -21
- package/build/test.mjs +0 -23
package/src/observable/event.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { describe, expect, it } from "../scope/index.js"
|
|
2
|
-
import { Observable, Subject, filter, map } from "./observable.js"
|
|
1
|
+
import { describe, expect, it } from "../scope/index.js"
|
|
2
|
+
import { Observable, Subject, filter, map } from "./observable.js"
|
|
3
3
|
|
|
4
4
|
describe("Observables", () => {
|
|
5
5
|
describe("basics", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_LOGGER, Logger } from "../log.js"
|
|
1
|
+
import { DEFAULT_LOGGER, Logger } from "../log.js"
|
|
2
2
|
|
|
3
3
|
export interface FullSubscriber<T, E> {
|
|
4
4
|
// (t: T): void | Promise<undefined>;
|
|
@@ -26,6 +26,7 @@ export interface Observable<T, E = unknown> {
|
|
|
26
26
|
o2: Subscriber<T1, E> & Observable<T2, E>
|
|
27
27
|
): Observable<T2, E>;
|
|
28
28
|
filter(fn: (t: T) => boolean): Observable<T, E>;
|
|
29
|
+
distinct(fn?: (t1: T, t2: T) => boolean): Observable<T, E>;
|
|
29
30
|
map<U>(fn: (t: T) => U): Observable<U, E>;
|
|
30
31
|
reduce<A>(fn: (acc: A, t: T) => A, init: A): Observable<A, E>;
|
|
31
32
|
replay(n: number): Observable<T, E>;
|
|
@@ -55,11 +56,13 @@ export const Observable = {
|
|
|
55
56
|
o2: Observable<T2, E>
|
|
56
57
|
): Observable<[T1, T2], E> {
|
|
57
58
|
let latestSubject = new Subject<[T1, T2], E>();
|
|
59
|
+
let o1LatestSet = false;
|
|
58
60
|
let o1Latest: T1;
|
|
61
|
+
let o2LatestSet = false;
|
|
59
62
|
let o2Latest: T2;
|
|
60
63
|
|
|
61
64
|
function next() {
|
|
62
|
-
if (
|
|
65
|
+
if (o1LatestSet && o2LatestSet) {
|
|
63
66
|
latestSubject.next([o1Latest, o2Latest]);
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -77,6 +80,7 @@ export const Observable = {
|
|
|
77
80
|
let o1sub = o1.subscribe({
|
|
78
81
|
next(t: T1) {
|
|
79
82
|
o1Latest = t;
|
|
83
|
+
o1LatestSet = true;
|
|
80
84
|
next();
|
|
81
85
|
},
|
|
82
86
|
error,
|
|
@@ -86,6 +90,7 @@ export const Observable = {
|
|
|
86
90
|
let o2sub = o2.subscribe({
|
|
87
91
|
next(t: T2) {
|
|
88
92
|
o2Latest = t;
|
|
93
|
+
o2LatestSet = true;
|
|
89
94
|
next();
|
|
90
95
|
},
|
|
91
96
|
error,
|
|
@@ -96,6 +101,22 @@ export const Observable = {
|
|
|
96
101
|
},
|
|
97
102
|
};
|
|
98
103
|
|
|
104
|
+
interface Scheduler {
|
|
105
|
+
execute(fn: () => (void | Promise<undefined>)[]): void | Promise<undefined>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const AsyncScheduler: Scheduler = {
|
|
109
|
+
execute(fn: () => Promise<undefined>[]): Promise<undefined> {
|
|
110
|
+
return Promise.all(fn()).then(() => undefined);
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const SyncScheduler: Scheduler = {
|
|
115
|
+
execute(fn: () => void[]): void {
|
|
116
|
+
fn();
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
99
120
|
export class Subject<T, E = unknown, T2 = T>
|
|
100
121
|
implements FullSubscriber<T, E>, Observable<T, E>
|
|
101
122
|
{
|
|
@@ -103,6 +124,10 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
103
124
|
#subscribers = new Set<FullSubscriber<T, E>>();
|
|
104
125
|
#complete = false;
|
|
105
126
|
|
|
127
|
+
get $(): Observable<T, E> {
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
|
|
106
131
|
get hot(): boolean {
|
|
107
132
|
return this.#subscribers.size > 0;
|
|
108
133
|
}
|
|
@@ -111,6 +136,8 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
111
136
|
return !this.hot;
|
|
112
137
|
}
|
|
113
138
|
|
|
139
|
+
constructor(private readonly scheduler: Scheduler = AsyncScheduler) {}
|
|
140
|
+
|
|
114
141
|
onWarm(fn: Function) {
|
|
115
142
|
if (this.cold) this.#coldWaiters.add(fn);
|
|
116
143
|
}
|
|
@@ -118,16 +145,16 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
118
145
|
next(t: T | T2): void | Promise<undefined> {
|
|
119
146
|
if (this.#complete)
|
|
120
147
|
throw new Error("Cannot call next on a completed subject");
|
|
121
|
-
return
|
|
148
|
+
return this.scheduler.execute(() =>
|
|
122
149
|
[...this.#subscribers].map((s) => s.next?.(t as T))
|
|
123
|
-
)
|
|
150
|
+
);
|
|
124
151
|
}
|
|
125
152
|
|
|
126
153
|
error(e: E): void | Promise<undefined> {
|
|
127
154
|
if (this.#complete)
|
|
128
155
|
throw new Error("Cannot call error on a completed subject");
|
|
129
|
-
return
|
|
130
|
-
() =>
|
|
156
|
+
return this.scheduler.execute(() =>
|
|
157
|
+
[...this.#subscribers].map((s) => s.error?.(e))
|
|
131
158
|
);
|
|
132
159
|
}
|
|
133
160
|
|
|
@@ -135,11 +162,11 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
135
162
|
if (this.#complete)
|
|
136
163
|
throw new Error("Cannot call complete on a completed subject");
|
|
137
164
|
this.#complete = true;
|
|
138
|
-
const finished =
|
|
165
|
+
const finished = this.scheduler.execute(() =>
|
|
139
166
|
[...this.#subscribers].map((s) => s.complete?.())
|
|
140
167
|
);
|
|
141
168
|
this.#subscribers.clear(); // Free subscribers for garbage collection
|
|
142
|
-
return finished
|
|
169
|
+
return finished;
|
|
143
170
|
}
|
|
144
171
|
|
|
145
172
|
subscribe(subscriber: Subscriber<T, E>): Subscription {
|
|
@@ -180,6 +207,10 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
180
207
|
return this.pipe(operator.filter(fn));
|
|
181
208
|
}
|
|
182
209
|
|
|
210
|
+
distinct(fn: (t1: T, t2: T) => boolean = Object.is): Observable<T, E> {
|
|
211
|
+
return this.pipe(operator.distinct(fn));
|
|
212
|
+
}
|
|
213
|
+
|
|
183
214
|
map<U>(fn: (t: T) => U): Observable<U, E> {
|
|
184
215
|
return this.pipe(operator.map(fn));
|
|
185
216
|
}
|
|
@@ -200,8 +231,8 @@ export class Subject<T, E = unknown, T2 = T>
|
|
|
200
231
|
export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
|
|
201
232
|
#current: T;
|
|
202
233
|
|
|
203
|
-
constructor(t: T) {
|
|
204
|
-
super();
|
|
234
|
+
constructor(t: T, scheduler?: Scheduler) {
|
|
235
|
+
super(scheduler);
|
|
205
236
|
this.#current = t;
|
|
206
237
|
}
|
|
207
238
|
|
|
@@ -226,8 +257,8 @@ export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
|
|
|
226
257
|
export class ReplaySubject<T, E = unknown> extends Subject<T, E> {
|
|
227
258
|
#history: T[] = [];
|
|
228
259
|
|
|
229
|
-
constructor(private readonly n: number) {
|
|
230
|
-
super();
|
|
260
|
+
constructor(private readonly n: number, scheduler?: Scheduler) {
|
|
261
|
+
super(scheduler);
|
|
231
262
|
}
|
|
232
263
|
|
|
233
264
|
next(t: T) {
|
|
@@ -316,6 +347,32 @@ class FilterOperator<T, E>
|
|
|
316
347
|
}
|
|
317
348
|
}
|
|
318
349
|
|
|
350
|
+
class DistinctOperator<T, E>
|
|
351
|
+
extends Subject<T, E>
|
|
352
|
+
implements FullSubscriber<T, E>, Observable<T, E>
|
|
353
|
+
{
|
|
354
|
+
#prior: T | undefined = undefined;
|
|
355
|
+
|
|
356
|
+
constructor(
|
|
357
|
+
private readonly distinctFn: (t1: T, t2: T) => boolean = Object.is
|
|
358
|
+
) {
|
|
359
|
+
super();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
next(t: T): void | Promise<undefined> {
|
|
363
|
+
if (this.#prior === undefined) {
|
|
364
|
+
this.#prior = t;
|
|
365
|
+
return super.next(t);
|
|
366
|
+
}
|
|
367
|
+
const same = this.distinctFn(this.#prior!, t);
|
|
368
|
+
if (!same) {
|
|
369
|
+
this.#prior = t;
|
|
370
|
+
return super.next(t);
|
|
371
|
+
}
|
|
372
|
+
return undefined;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
319
376
|
class ReduceOperator<A, T, E> extends BehaviorSubject<A, E, T> {
|
|
320
377
|
constructor(private readonly fn: (acc: A, t: T) => A, init: A) {
|
|
321
378
|
super(init);
|
|
@@ -380,6 +437,8 @@ class LastOperator<T, E = Error> extends Subject<T, E> {
|
|
|
380
437
|
|
|
381
438
|
export const filter = <T, E>(fn: (t: T) => boolean) =>
|
|
382
439
|
new FilterOperator<T, E>(fn);
|
|
440
|
+
export const distinct = <T, E>(fn?: (t1: T, t2: T) => boolean) =>
|
|
441
|
+
new DistinctOperator<T, E>(fn ?? Object.is);
|
|
383
442
|
export const first = <T, E>() => new FirstOperator<T, E>();
|
|
384
443
|
export const last = <T, E>() => new LastOperator<T, E>();
|
|
385
444
|
export const map = <T1, T2, E>(fn: (t: T1) => T2) =>
|
|
@@ -393,6 +452,7 @@ export const tap = <T, E>(fn: Subscriber<T, E>) => new TapOperator<T, E>(fn);
|
|
|
393
452
|
|
|
394
453
|
export const operator = {
|
|
395
454
|
filter,
|
|
455
|
+
distinct,
|
|
396
456
|
first,
|
|
397
457
|
last,
|
|
398
458
|
map,
|
package/src/pico/_variables.scss
CHANGED
|
@@ -9,7 +9,7 @@ $enable-class-container: false !default;
|
|
|
9
9
|
|
|
10
10
|
// Enable a centered viewport for <header>, <main>, <footer> inside <body>
|
|
11
11
|
// Options are "all" to center all, "main" to only center main, and "none" to treat all as fluid.
|
|
12
|
-
$enable-viewport: "
|
|
12
|
+
$enable-viewport: "none" !default;
|
|
13
13
|
|
|
14
14
|
// Enable responsive spacings for <header>, <main>, <footer>, <section>, <article>
|
|
15
15
|
// Fixed spacings if disabled
|
package/src/result.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type Err<E = Error> = {
|
|
|
8
8
|
export type Ok<T> = { ok: T; map: <U>(fn: (t: T) => Result<U>) => Result<U> };
|
|
9
9
|
export type Result<T, E = Error> = Ok<T> | Err<E>;
|
|
10
10
|
|
|
11
|
-
export const isNone = <T>(s: Option<T>): s is None => s
|
|
11
|
+
export const isNone = <T>(s: Option<T>): s is None => s === null;
|
|
12
12
|
export const isSome = <T>(s: Option<T>): s is Some<T> => s != null;
|
|
13
13
|
|
|
14
14
|
export function None<T = unknown>(_?: T): Option<T> {
|
package/src/scope/describe.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
2
|
import { getLogger } from "../log.js";
|
|
3
3
|
import { TestCase } from "./scope.js";
|
|
4
|
+
import * as state from "./state.js";
|
|
4
5
|
|
|
5
6
|
export const beforeall = Symbol("beforeAll");
|
|
6
7
|
export const beforeeach = Symbol("beforeEach");
|
|
@@ -75,9 +76,5 @@ export function cleanState<State extends {}>(
|
|
|
75
76
|
init: () => State,
|
|
76
77
|
runner: (action: () => void) => void = beforeEach
|
|
77
78
|
): State {
|
|
78
|
-
|
|
79
|
-
runner(() => {
|
|
80
|
-
Object.assign(state, init());
|
|
81
|
-
});
|
|
82
|
-
return state as State;
|
|
79
|
+
return state.cleanState(init, runner);
|
|
83
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLogger } from "../../log.js"
|
|
2
|
-
import { getTotalCases } from "../describe.js"
|
|
3
|
-
import { flattenResults } from "../execute.js"
|
|
4
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { getLogger } from "../../log.js"
|
|
2
|
+
import { getTotalCases } from "../describe.js"
|
|
3
|
+
import { flattenResults } from "../execute.js"
|
|
4
|
+
import { TestResult } from "../scope.js"
|
|
5
5
|
|
|
6
6
|
const logger = getLogger("Scope Test Runner");
|
|
7
7
|
|
package/src/scope/display/dom.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js"
|
|
2
|
-
import { DOMElement } from "../../dom/dom.js"
|
|
3
|
-
import { DEFAULT_LOGGER, LEVEL } from "../../log.js"
|
|
4
|
-
import { getTotalCases } from "../describe.js"
|
|
5
|
-
import { flattenResults } from "../execute.js"
|
|
6
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { isHTMLLogger, makeHTMLLogger } from "../../components/logger.js"
|
|
2
|
+
import { DOMElement } from "../../dom/dom.js"
|
|
3
|
+
import { DEFAULT_LOGGER, LEVEL } from "../../log.js"
|
|
4
|
+
import { getTotalCases } from "../describe.js"
|
|
5
|
+
import { flattenResults } from "../execute.js"
|
|
6
|
+
import { TestResult } from "../scope.js"
|
|
7
7
|
|
|
8
8
|
export function displayStatistics(
|
|
9
9
|
results: TestResult,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { xml } from "../../dom/xml.js"
|
|
2
|
-
import { FlatResult, flattenResults } from "../execute.js"
|
|
3
|
-
import { TestResult } from "../scope.js"
|
|
1
|
+
import { xml } from "../../dom/xml.js"
|
|
2
|
+
import { FlatResult, flattenResults } from "../execute.js"
|
|
3
|
+
import { TestResult } from "../scope.js"
|
|
4
4
|
|
|
5
5
|
const cases = (results: TestResult) =>
|
|
6
6
|
Object.entries(results).filter(
|
package/src/scope/execute.ts
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
beforeall,
|
|
5
5
|
beforeeach,
|
|
6
6
|
rootCases,
|
|
7
|
-
} from "./describe.js"
|
|
8
|
-
import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js"
|
|
7
|
+
} from "./describe.js"
|
|
8
|
+
import { TestFailed, TestPassed, TestResult, TestSummary } from "./scope.js"
|
|
9
9
|
|
|
10
10
|
export async function execute(cases = rootCases()): Promise<TestResult> {
|
|
11
11
|
const beforeallfn = cases[beforeall] ?? (() => {});
|
package/src/scope/expect.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assert } from "../assert.js"
|
|
2
|
-
import { display } from "../display.js"
|
|
3
|
-
import { equals } from "../equal.js"
|
|
1
|
+
import { assert } from "../assert.js"
|
|
2
|
+
import { display } from "../display.js"
|
|
3
|
+
import { equals } from "../equal.js"
|
|
4
4
|
|
|
5
5
|
export class Matcher<T> {
|
|
6
6
|
actual: T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as fs from "fs/promises";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { info } from "../../log.js";
|
|
4
|
-
import { MiddlewareFactory
|
|
4
|
+
import { MiddlewareFactory } from "./index.js";
|
|
5
5
|
import { contentResponse } from "./response.js";
|
|
6
6
|
|
|
7
7
|
const findSiteMap = async (root: string, prefix = root) => {
|
package/src/server/main.ts
CHANGED
|
@@ -9,5 +9,12 @@ const FLAGS = parse(process.argv);
|
|
|
9
9
|
import { makeServer } from "./http/index.js";
|
|
10
10
|
import * as path from "node:path";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
server.
|
|
12
|
+
async function main() {
|
|
13
|
+
const server = await makeServer({ root: path.join(process.cwd(), "src") });
|
|
14
|
+
server.listen(
|
|
15
|
+
FLAGS.asNumber("port", 8080),
|
|
16
|
+
FLAGS.asString("host", "0.0.0.0")
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
main();
|
package/src/test.mjs
CHANGED
|
@@ -5,25 +5,29 @@ import { execute } from "./scope/execute.js";
|
|
|
5
5
|
import { asXML } from "./scope/display/junit.js";
|
|
6
6
|
import { onConsole } from "./scope/display/console.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
async function main() {
|
|
9
|
+
await import("./test_all.js");
|
|
9
10
|
|
|
10
|
-
(async function () {
|
|
11
|
-
|
|
11
|
+
(async function () {
|
|
12
|
+
const results = await execute();
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const FLAGS = parse(process.argv);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
switch (FLAGS.asString("mode", "console")) {
|
|
17
|
+
case "junit":
|
|
18
|
+
const xml = asXML(results);
|
|
19
|
+
console.log(xml);
|
|
20
|
+
break;
|
|
21
|
+
case "console":
|
|
22
|
+
default:
|
|
23
|
+
onConsole(results);
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})();
|
|
27
|
+
if (results.failed > 0) {
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
main();
|
package/src/test_all.ts
CHANGED
|
@@ -21,3 +21,13 @@ import "./generator.test.js";
|
|
|
21
21
|
import "./lock.test.js";
|
|
22
22
|
import "./result.test.js";
|
|
23
23
|
import "./observable/observable.test.js";
|
|
24
|
+
|
|
25
|
+
import * as components from "./components/test.js";
|
|
26
|
+
import * as dom from "./dom/test.js";
|
|
27
|
+
|
|
28
|
+
if (process?.env.CI?.toLowerCase() !== "true") {
|
|
29
|
+
(async () => {
|
|
30
|
+
await components.loadTests();
|
|
31
|
+
await dom.loadTests();
|
|
32
|
+
})();
|
|
33
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventHandler } from "../dom/dom.js";
|
|
2
|
-
export declare const Select: import("../dom/fc.js").FCComponentCtor<{
|
|
3
|
-
name: string;
|
|
4
|
-
value: string;
|
|
5
|
-
events: {
|
|
6
|
-
change: EventHandler;
|
|
7
|
-
};
|
|
8
|
-
disabled: boolean;
|
|
9
|
-
options: [
|
|
10
|
-
string,
|
|
11
|
-
string
|
|
12
|
-
][];
|
|
13
|
-
}, {}>;
|
package/build/components/test.js
DELETED
package/build/dom/test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/build/dom/test.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Logger } from "../log.js";
|
|
2
|
-
export interface Subscriber<T, E> {
|
|
3
|
-
next?: (t: T) => void | Promise<undefined>;
|
|
4
|
-
error?: (e: E) => void | Promise<undefined>;
|
|
5
|
-
complete?: () => void | Promise<undefined>;
|
|
6
|
-
}
|
|
7
|
-
export interface Subscription {
|
|
8
|
-
unsubscribe(): void;
|
|
9
|
-
}
|
|
10
|
-
export interface Observable<T, E = unknown> {
|
|
11
|
-
subscribe(subscriber: Subscriber<T, E>): Subscription;
|
|
12
|
-
pipe<T1>(o1: (t: T) => T1): Observable<T1, E>;
|
|
13
|
-
pipe<T1, T2>(o1: (t: T) => T1, o2: (t: T) => T2): Observable<T2, E>;
|
|
14
|
-
pipe<T1, T2, T3>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3): Observable<T3, E>;
|
|
15
|
-
pipe<T1, T2, T3, T4>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4): Observable<T4, E>;
|
|
16
|
-
pipe<T1, T2, T3, T4, T5>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4, o5: (t: T4) => T5): Observable<T5, E>;
|
|
17
|
-
}
|
|
18
|
-
export declare const Observable: {
|
|
19
|
-
of<T, E>(...T: T[]): void;
|
|
20
|
-
combineLatest<T_1, E_1>(...O: Observable<T_1, E_1>[]): void;
|
|
21
|
-
from<T_2, E_2>(f: Promise<T_2> | Iterable<T_2> | Observable<T_2, E_2>): void;
|
|
22
|
-
fromEvent<T_3, E_3>(element: {
|
|
23
|
-
addEventListener<Ev>(fn: (e: Ev) => void): void;
|
|
24
|
-
}, eventName: string): void;
|
|
25
|
-
};
|
|
26
|
-
export declare class Subject<T, E = unknown> implements Subscriber<T, E>, Observable<T, E> {
|
|
27
|
-
#private;
|
|
28
|
-
next(t: T): Promise<undefined>;
|
|
29
|
-
error(e: E): Promise<undefined>;
|
|
30
|
-
complete(): Promise<undefined>;
|
|
31
|
-
subscribe(subscriber: Subscriber<T, E>): Subscription;
|
|
32
|
-
pipe<T1>(o1: (t: T) => T1): Observable<T1, E>;
|
|
33
|
-
pipe<T1, T2>(o1: (t: T) => T1, o2: (t: T1) => T2): Observable<T2, E>;
|
|
34
|
-
pipe<T1, T2, T3>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3): Observable<T3, E>;
|
|
35
|
-
pipe<T1, T2, T3, T4>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4): Observable<T4, E>;
|
|
36
|
-
pipe<T1, T2, T3, T4, T5>(o1: (t: T) => T1, o2: (t: T1) => T2, o3: (t: T2) => T3, o4: (t: T3) => T4, o5: (t: T4) => T5): Observable<T5, E>;
|
|
37
|
-
}
|
|
38
|
-
export declare class BehaviorSubject<T, E = unknown> extends Subject<T, E> {
|
|
39
|
-
#private;
|
|
40
|
-
constructor(t: T);
|
|
41
|
-
next(t: T): Promise<undefined>;
|
|
42
|
-
subscribe(subscriber: Subscriber<T, E>): Subscription;
|
|
43
|
-
get current(): T;
|
|
44
|
-
}
|
|
45
|
-
export declare class ReplaySubject<T, E = unknown> extends Subject<T, E> {
|
|
46
|
-
#private;
|
|
47
|
-
private readonly n;
|
|
48
|
-
constructor(n: number);
|
|
49
|
-
next(t: T): Promise<undefined>;
|
|
50
|
-
subscribe(subscriber: Subscriber<T, E>): Subscription;
|
|
51
|
-
}
|
|
52
|
-
export interface Next<T> {
|
|
53
|
-
value: T;
|
|
54
|
-
completed: false;
|
|
55
|
-
failed: false;
|
|
56
|
-
}
|
|
57
|
-
export interface Error<E> {
|
|
58
|
-
error: E;
|
|
59
|
-
completed: false;
|
|
60
|
-
failed: true;
|
|
61
|
-
}
|
|
62
|
-
export interface Completed {
|
|
63
|
-
completed: true;
|
|
64
|
-
failed: false;
|
|
65
|
-
}
|
|
66
|
-
export interface Failed {
|
|
67
|
-
completed: true;
|
|
68
|
-
failed: true;
|
|
69
|
-
}
|
|
70
|
-
export declare type Event<T, E> = Next<T> | Error<E> | Completed | Failed;
|
|
71
|
-
export declare const next: <T>(value: T) => Next<T>;
|
|
72
|
-
export declare const error: <E>(e: E) => Error<E>;
|
|
73
|
-
export declare const completed: () => Completed;
|
|
74
|
-
export declare const failed: () => Failed;
|
|
75
|
-
export declare const isNext: <T>(event: Event<T, unknown>) => event is Next<T>;
|
|
76
|
-
export declare const isError: <E>(event: Event<unknown, E>) => event is Error<E>;
|
|
77
|
-
export declare const isCompleted: (event: Event<unknown, unknown>) => event is Completed;
|
|
78
|
-
export declare const isFailed: (event: Event<unknown, unknown>) => event is Failed;
|
|
79
|
-
export declare const isEvent: <T, E>(t: T | Event<T, E>) => t is Event<T, E>;
|
|
80
|
-
export declare const asEvents: <T, E>(a: (T | Event<T, E>)[]) => Event<T, E>[];
|
|
81
|
-
export declare const marbles: <T, E>(events: Event<T, E>[]) => string;
|
|
82
|
-
export declare const collect: <T, E>(input$: Observable<T, E>) => Event<T, E>[];
|
|
83
|
-
export declare const watch: <T, E>(logger?: Logger) => (observable: Observable<T, E>) => void;
|