@jalvin/runtime 2.0.43 → 2.0.45
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/dist/bibi.d.ts +4 -0
- package/dist/bibi.d.ts.map +1 -1
- package/dist/bibi.js +11 -9
- package/dist/bibi.js.map +1 -1
- package/dist/coroutines.js +22 -47
- package/dist/coroutines.js.map +1 -1
- package/dist/dom.d.ts +15 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +212 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -224
- package/dist/index.js.map +1 -1
- package/dist/nav.d.ts +48 -0
- package/dist/nav.d.ts.map +1 -0
- package/dist/nav.js +136 -0
- package/dist/nav.js.map +1 -0
- package/dist/stateflow.js +8 -19
- package/dist/stateflow.js.map +1 -1
- package/dist/stdlib/collections.js +55 -108
- package/dist/stdlib/collections.js.map +1 -1
- package/dist/stdlib/conversions.d.ts +2 -0
- package/dist/stdlib/conversions.d.ts.map +1 -1
- package/dist/stdlib/conversions.js +17 -29
- package/dist/stdlib/conversions.js.map +1 -1
- package/dist/stdlib/delegates.js +14 -28
- package/dist/stdlib/delegates.js.map +1 -1
- package/dist/stdlib/equality.js +1 -4
- package/dist/stdlib/equality.js.map +1 -1
- package/dist/stdlib/index.js +12 -28
- package/dist/stdlib/index.js.map +1 -1
- package/dist/stdlib/io.js +2 -6
- package/dist/stdlib/io.js.map +1 -1
- package/dist/stdlib/math.js +29 -37
- package/dist/stdlib/math.js.map +1 -1
- package/dist/stdlib/random.js +3 -8
- package/dist/stdlib/random.js.map +1 -1
- package/dist/stdlib/regex.js +4 -8
- package/dist/stdlib/regex.js.map +1 -1
- package/dist/stdlib/result.js +3 -9
- package/dist/stdlib/result.js.map +1 -1
- package/dist/stdlib/strings.js +24 -51
- package/dist/stdlib/strings.js.map +1 -1
- package/dist/stdlib/timing.js +3 -8
- package/dist/stdlib/timing.js.map +1 -1
- package/dist/stdlib/types.js +13 -29
- package/dist/stdlib/types.js.map +1 -1
- package/dist/ui.d.ts +12 -69
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +127 -228
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
package/dist/dom.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gDAAgD;AAChD,gFAAgF;AAShF;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAsB,EACtB,KAAiC,EACjC,GAAG,QAAe;IAElB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,sDAAsD;QACtD,OAAQ,GAAW,CAAC,KAAK,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,mBAAmB;IACnB,MAAM,YAAY,GAA0B,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,CAAC,KAAU,EAAE,EAAE;QAC5B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAClD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;YAClD,eAAe;YACf,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC3E,iFAAiF;YACjF,YAAY,CAAC,IAAI,CAAC,KAAY,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,wBAAwB;YACxB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK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CAAC,EAAE,CAAC;QACpB,6BAA6B;QAC7B,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;YACnC,MAAM,cAAc,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,cAAc,EAAE,CAAC;gBACjB,oGAAoG;gBACpG,cAAc,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mCAAmC;IACnC,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,EAAe,EAAE,OAAe;IACnD,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACjD,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5B,IAAI,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export { Bibi, BibiRequestBuilder, BibiError } from "./bibi.js";
|
|
1
|
+
export { Bibi, BibiRequestBuilder, BibiError, headers, timeout } from "./bibi.js";
|
|
2
2
|
export type { BibiMethod, BibiRequestOptions, BibiResponse, BibiInterceptor } from "./bibi.js";
|
|
3
3
|
export { Job, JobCancellationException, Deferred, CoroutineScope, launch, async_ as async, delay, withContext, repeat, runBlocking, yield_, withTimeout, withTimeoutOrNull, TimeoutCancellationException, Channel, ChannelClosedException, Flow, flow, flowOf, asFlow, coroutineScope, supervisorScope, } from "./coroutines.js";
|
|
4
4
|
export type { Dispatcher, FlowCollector } from "./coroutines.js";
|
|
5
5
|
export { MutableStateFlow, mapFlow, filterFlow, debounceFlow, ViewModel, viewModel, clearViewModel, clearAllViewModels, } from "./stateflow.js";
|
|
6
6
|
export type { StateFlow, Subscriber, Unsubscribe } from "./stateflow.js";
|
|
7
|
-
export {
|
|
7
|
+
export { NavController, NavGraphBuilder, NavHost, rememberNavController, } from "./nav.js";
|
|
8
|
+
export type { BackStackEntry, NavOptions } from "./nav.js";
|
|
9
|
+
export { jalvinCreateElement, patch } from "./dom.js";
|
|
10
|
+
export { mutableStateOf, remember, rememberMutableStateOf, collectAsState, LaunchedEffect, DisposableEffect, SideEffect, WindowSizeClassProvider, calculateWindowSizeClass, widthToSizeClass, heightToSizeClass, render, } from "./ui.js";
|
|
8
11
|
export type { MutableState, WindowSizeClass, WindowSizeClassState } from "./ui.js";
|
|
9
12
|
export { println, print, } from "./stdlib/io.js";
|
|
10
13
|
export { notNull, NullPointerException, safeCast, checkNotNull, requireNotNull, requireCondition, check, error, IllegalArgumentException, IllegalStateException, UnsupportedOperationException, IndexOutOfBoundsException, NoSuchElementException, } from "./stdlib/types.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG/F,OAAO,EACL,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EACR,cAAc,EACd,MAAM,EAAE,MAAM,IAAI,KAAK,EACvB,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EACvC,MAAM,EACN,WAAW,EAAE,iBAAiB,EAAE,4BAA4B,EAC5D,O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AK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EACxD,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EACtC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,EAC7C,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,GACjD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAC9D,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,GAC5C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EAAE,WAAW,EAAE,gBAAgB,GACtC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,EAAE,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,GAC7C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EAAE,sBAAsB,EAAE,iBAAiB,GAC7D,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,231 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// @jalvin/runtime — public API
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.checkNotNull = exports.safeCast = exports.NullPointerException = exports.notNull = exports.println = exports.heightToSizeClass = exports.widthToSizeClass = exports.calculateWindowSizeClass = exports.WindowSizeClassProvider = exports.SideEffect = exports.DisposableEffect = exports.LaunchedEffect = exports.useViewModel = exports.collectAsState = exports.rememberMutableStateOf = exports.remember = exports.mutableStateOf = exports.clearAllViewModels = exports.clearViewModel = exports.viewModel = exports.ViewModel = exports.debounceFlow = exports.filterFlow = exports.mapFlow = exports.MutableStateFlow = exports.supervisorScope = exports.coroutineScope = exports.asFlow = exports.flowOf = exports.flow = exports.Flow = exports.ChannelClosedException = exports.Channel = exports.TimeoutCancellationException = exports.withTimeoutOrNull = exports.withTimeout = exports.yield_ = exports.runBlocking = exports.repeat = exports.withContext = exports.delay = exports.async = exports.launch = exports.CoroutineScope = exports.Deferred = exports.JobCancellationException = exports.Job = exports.BibiError = exports.BibiRequestBuilder = exports.Bibi = void 0;
|
|
5
|
-
exports.associate = exports.groupBy = exports.flatten = exports.flatMap = exports.findLast = exports.find = exports.lastOrNull = exports.last = exports.firstOrNull = exports.first = exports.count = exports.none = exports.all = exports.any = exports.sumOf = exports.reduce = exports.fold = exports.forEach = exports.filterNotNull = exports.filter = exports.map = exports.tripleOf = exports.pairOf = exports.mutableMapOf = exports.mapOf = exports.mutableSetOf = exports.setOf = exports.mutableListOf = exports.listOf = exports.takeUnless = exports.takeIf = exports.with_ = exports.also = exports.apply = exports.run_ = exports.let_ = exports.ObservableDelegate = exports.LazyDelegate = exports.Delegates = exports.lazy = exports.delegate = exports.NoSuchElementException = exports.IndexOutOfBoundsException = exports.UnsupportedOperationException = exports.IllegalStateException = exports.IllegalArgumentException = exports.error = exports.check = exports.requireCondition = exports.requireNotNull = void 0;
|
|
6
|
-
exports.round = exports.floor = exports.ceil = exports.abs = exports.buildString = exports.StringBuilder = exports.trimIndent = exports.ifBlank = exports.ifEmpty = exports.lineSequence = exports.lines = exports.removeSuffix = exports.removePrefix = exports.substringAfterLast = exports.substringBeforeLast = exports.substringAfter = exports.substringBefore = exports.decapitalize = exports.capitalize = exports.repeatString = exports.padEnd = exports.padStart = exports.toBooleanOrNull = exports.toDoubleOrNull = exports.toIntOrNull = exports.isNullOrBlank = exports.isNotBlank = exports.isBlank = exports.buildMap = exports.buildSet = exports.buildList = exports.joinToString = exports.maxOrNull = exports.minOrNull = exports.maxOf = exports.minOf = exports.withIndex = exports.partition = exports.windowed = exports.chunked = exports.dropWhile = exports.drop = exports.takeWhile = exports.take = exports.reversed = exports.sortedByDescending = exports.sortedBy = exports.distinctBy = exports.distinct = exports.zip = void 0;
|
|
7
|
-
exports.jalvinEquals = exports.measureTimedValue = exports.measureTimeMillisAsync = exports.measureTimeMillis = exports.randomUUID = exports.DefaultRandom = exports.Random = exports.RegexResult = exports.Regex = exports.runCatchingAsync = exports.runCatching = exports.Result = exports.step = exports.downTo = exports.IntRange = exports.range = exports.Triple = exports.Pair = exports.charCodeOf = exports.toChar = exports.toDouble = exports.toFloat = exports.toLong = exports.toInt = exports.Long = exports.Int = exports.coerceIn = exports.coerceAtMost = exports.coerceAtLeast = exports.E = exports.PI = exports.truncDiv = exports.clamp = exports.truncate = exports.hypot = exports.sign = exports.atan2 = exports.atan = exports.acos = exports.asin = exports.tan = exports.cos = exports.sin = exports.log10 = exports.log2 = exports.ln = exports.exp = exports.pow = exports.sqrt = void 0;
|
|
8
2
|
// HTTP client
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, "Bibi", { enumerable: true, get: function () { return bibi_js_1.Bibi; } });
|
|
11
|
-
Object.defineProperty(exports, "BibiRequestBuilder", { enumerable: true, get: function () { return bibi_js_1.BibiRequestBuilder; } });
|
|
12
|
-
Object.defineProperty(exports, "BibiError", { enumerable: true, get: function () { return bibi_js_1.BibiError; } });
|
|
3
|
+
export { Bibi, BibiRequestBuilder, BibiError, headers, timeout } from "./bibi.js";
|
|
13
4
|
// Coroutines
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "Job", { enumerable: true, get: function () { return coroutines_js_1.Job; } });
|
|
16
|
-
Object.defineProperty(exports, "JobCancellationException", { enumerable: true, get: function () { return coroutines_js_1.JobCancellationException; } });
|
|
17
|
-
Object.defineProperty(exports, "Deferred", { enumerable: true, get: function () { return coroutines_js_1.Deferred; } });
|
|
18
|
-
Object.defineProperty(exports, "CoroutineScope", { enumerable: true, get: function () { return coroutines_js_1.CoroutineScope; } });
|
|
19
|
-
Object.defineProperty(exports, "launch", { enumerable: true, get: function () { return coroutines_js_1.launch; } });
|
|
20
|
-
Object.defineProperty(exports, "async", { enumerable: true, get: function () { return coroutines_js_1.async_; } });
|
|
21
|
-
Object.defineProperty(exports, "delay", { enumerable: true, get: function () { return coroutines_js_1.delay; } });
|
|
22
|
-
Object.defineProperty(exports, "withContext", { enumerable: true, get: function () { return coroutines_js_1.withContext; } });
|
|
23
|
-
Object.defineProperty(exports, "repeat", { enumerable: true, get: function () { return coroutines_js_1.repeat; } });
|
|
24
|
-
Object.defineProperty(exports, "runBlocking", { enumerable: true, get: function () { return coroutines_js_1.runBlocking; } });
|
|
25
|
-
Object.defineProperty(exports, "yield_", { enumerable: true, get: function () { return coroutines_js_1.yield_; } });
|
|
26
|
-
Object.defineProperty(exports, "withTimeout", { enumerable: true, get: function () { return coroutines_js_1.withTimeout; } });
|
|
27
|
-
Object.defineProperty(exports, "withTimeoutOrNull", { enumerable: true, get: function () { return coroutines_js_1.withTimeoutOrNull; } });
|
|
28
|
-
Object.defineProperty(exports, "TimeoutCancellationException", { enumerable: true, get: function () { return coroutines_js_1.TimeoutCancellationException; } });
|
|
29
|
-
Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return coroutines_js_1.Channel; } });
|
|
30
|
-
Object.defineProperty(exports, "ChannelClosedException", { enumerable: true, get: function () { return coroutines_js_1.ChannelClosedException; } });
|
|
31
|
-
Object.defineProperty(exports, "Flow", { enumerable: true, get: function () { return coroutines_js_1.Flow; } });
|
|
32
|
-
Object.defineProperty(exports, "flow", { enumerable: true, get: function () { return coroutines_js_1.flow; } });
|
|
33
|
-
Object.defineProperty(exports, "flowOf", { enumerable: true, get: function () { return coroutines_js_1.flowOf; } });
|
|
34
|
-
Object.defineProperty(exports, "asFlow", { enumerable: true, get: function () { return coroutines_js_1.asFlow; } });
|
|
35
|
-
Object.defineProperty(exports, "coroutineScope", { enumerable: true, get: function () { return coroutines_js_1.coroutineScope; } });
|
|
36
|
-
Object.defineProperty(exports, "supervisorScope", { enumerable: true, get: function () { return coroutines_js_1.supervisorScope; } });
|
|
5
|
+
export { Job, JobCancellationException, Deferred, CoroutineScope, launch, async_ as async, delay, withContext, repeat, runBlocking, yield_, withTimeout, withTimeoutOrNull, TimeoutCancellationException, Channel, ChannelClosedException, Flow, flow, flowOf, asFlow, coroutineScope, supervisorScope, } from "./coroutines.js";
|
|
37
6
|
// StateFlow / ViewModel
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Object.defineProperty(exports, "viewModel", { enumerable: true, get: function () { return stateflow_js_1.viewModel; } });
|
|
45
|
-
Object.defineProperty(exports, "clearViewModel", { enumerable: true, get: function () { return stateflow_js_1.clearViewModel; } });
|
|
46
|
-
Object.defineProperty(exports, "clearAllViewModels", { enumerable: true, get: function () { return stateflow_js_1.clearAllViewModels; } });
|
|
47
|
-
// UI hooks (React)
|
|
48
|
-
var ui_js_1 = require("./ui.js");
|
|
49
|
-
Object.defineProperty(exports, "mutableStateOf", { enumerable: true, get: function () { return ui_js_1.mutableStateOf; } });
|
|
50
|
-
Object.defineProperty(exports, "remember", { enumerable: true, get: function () { return ui_js_1.remember; } });
|
|
51
|
-
Object.defineProperty(exports, "rememberMutableStateOf", { enumerable: true, get: function () { return ui_js_1.rememberMutableStateOf; } });
|
|
52
|
-
Object.defineProperty(exports, "collectAsState", { enumerable: true, get: function () { return ui_js_1.collectAsState; } });
|
|
53
|
-
Object.defineProperty(exports, "useViewModel", { enumerable: true, get: function () { return ui_js_1.useViewModel; } });
|
|
54
|
-
Object.defineProperty(exports, "LaunchedEffect", { enumerable: true, get: function () { return ui_js_1.LaunchedEffect; } });
|
|
55
|
-
Object.defineProperty(exports, "DisposableEffect", { enumerable: true, get: function () { return ui_js_1.DisposableEffect; } });
|
|
56
|
-
Object.defineProperty(exports, "SideEffect", { enumerable: true, get: function () { return ui_js_1.SideEffect; } });
|
|
57
|
-
Object.defineProperty(exports, "WindowSizeClassProvider", { enumerable: true, get: function () { return ui_js_1.WindowSizeClassProvider; } });
|
|
58
|
-
Object.defineProperty(exports, "calculateWindowSizeClass", { enumerable: true, get: function () { return ui_js_1.calculateWindowSizeClass; } });
|
|
59
|
-
Object.defineProperty(exports, "widthToSizeClass", { enumerable: true, get: function () { return ui_js_1.widthToSizeClass; } });
|
|
60
|
-
Object.defineProperty(exports, "heightToSizeClass", { enumerable: true, get: function () { return ui_js_1.heightToSizeClass; } });
|
|
7
|
+
export { MutableStateFlow, mapFlow, filterFlow, debounceFlow, ViewModel, viewModel, clearViewModel, clearAllViewModels, } from "./stateflow.js";
|
|
8
|
+
// Router — Compose Navigation-style declarative routing
|
|
9
|
+
export { NavController, NavGraphBuilder, NavHost, rememberNavController, } from "./nav.js";
|
|
10
|
+
// UI hooks & Rendering
|
|
11
|
+
export { jalvinCreateElement, patch } from "./dom.js";
|
|
12
|
+
export { mutableStateOf, remember, rememberMutableStateOf, collectAsState, LaunchedEffect, DisposableEffect, SideEffect, WindowSizeClassProvider, calculateWindowSizeClass, widthToSizeClass, heightToSizeClass, render, } from "./ui.js";
|
|
61
13
|
// Utilities / stdlib — each module is a single-purpose file under stdlib/
|
|
62
14
|
// See packages/runtime/src/stdlib/index.ts for the full module map.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Object.defineProperty(exports, "IllegalArgumentException", { enumerable: true, get: function () { return types_js_1.IllegalArgumentException; } });
|
|
76
|
-
Object.defineProperty(exports, "IllegalStateException", { enumerable: true, get: function () { return types_js_1.IllegalStateException; } });
|
|
77
|
-
Object.defineProperty(exports, "UnsupportedOperationException", { enumerable: true, get: function () { return types_js_1.UnsupportedOperationException; } });
|
|
78
|
-
Object.defineProperty(exports, "IndexOutOfBoundsException", { enumerable: true, get: function () { return types_js_1.IndexOutOfBoundsException; } });
|
|
79
|
-
Object.defineProperty(exports, "NoSuchElementException", { enumerable: true, get: function () { return types_js_1.NoSuchElementException; } });
|
|
80
|
-
var delegates_js_1 = require("./stdlib/delegates.js");
|
|
81
|
-
Object.defineProperty(exports, "delegate", { enumerable: true, get: function () { return delegates_js_1.delegate; } });
|
|
82
|
-
Object.defineProperty(exports, "lazy", { enumerable: true, get: function () { return delegates_js_1.lazy; } });
|
|
83
|
-
Object.defineProperty(exports, "Delegates", { enumerable: true, get: function () { return delegates_js_1.Delegates; } });
|
|
84
|
-
Object.defineProperty(exports, "LazyDelegate", { enumerable: true, get: function () { return delegates_js_1.LazyDelegate; } });
|
|
85
|
-
Object.defineProperty(exports, "ObservableDelegate", { enumerable: true, get: function () { return delegates_js_1.ObservableDelegate; } });
|
|
86
|
-
Object.defineProperty(exports, "let_", { enumerable: true, get: function () { return delegates_js_1.let_; } });
|
|
87
|
-
Object.defineProperty(exports, "run_", { enumerable: true, get: function () { return delegates_js_1.run_; } });
|
|
88
|
-
Object.defineProperty(exports, "apply", { enumerable: true, get: function () { return delegates_js_1.apply; } });
|
|
89
|
-
Object.defineProperty(exports, "also", { enumerable: true, get: function () { return delegates_js_1.also; } });
|
|
90
|
-
Object.defineProperty(exports, "with_", { enumerable: true, get: function () { return delegates_js_1.with_; } });
|
|
91
|
-
Object.defineProperty(exports, "takeIf", { enumerable: true, get: function () { return delegates_js_1.takeIf; } });
|
|
92
|
-
Object.defineProperty(exports, "takeUnless", { enumerable: true, get: function () { return delegates_js_1.takeUnless; } });
|
|
93
|
-
var collections_js_1 = require("./stdlib/collections.js");
|
|
94
|
-
Object.defineProperty(exports, "listOf", { enumerable: true, get: function () { return collections_js_1.listOf; } });
|
|
95
|
-
Object.defineProperty(exports, "mutableListOf", { enumerable: true, get: function () { return collections_js_1.mutableListOf; } });
|
|
96
|
-
Object.defineProperty(exports, "setOf", { enumerable: true, get: function () { return collections_js_1.setOf; } });
|
|
97
|
-
Object.defineProperty(exports, "mutableSetOf", { enumerable: true, get: function () { return collections_js_1.mutableSetOf; } });
|
|
98
|
-
Object.defineProperty(exports, "mapOf", { enumerable: true, get: function () { return collections_js_1.mapOf; } });
|
|
99
|
-
Object.defineProperty(exports, "mutableMapOf", { enumerable: true, get: function () { return collections_js_1.mutableMapOf; } });
|
|
100
|
-
Object.defineProperty(exports, "pairOf", { enumerable: true, get: function () { return collections_js_1.pairOf; } });
|
|
101
|
-
Object.defineProperty(exports, "tripleOf", { enumerable: true, get: function () { return collections_js_1.tripleOf; } });
|
|
102
|
-
Object.defineProperty(exports, "map", { enumerable: true, get: function () { return collections_js_1.map; } });
|
|
103
|
-
Object.defineProperty(exports, "filter", { enumerable: true, get: function () { return collections_js_1.filter; } });
|
|
104
|
-
Object.defineProperty(exports, "filterNotNull", { enumerable: true, get: function () { return collections_js_1.filterNotNull; } });
|
|
105
|
-
Object.defineProperty(exports, "forEach", { enumerable: true, get: function () { return collections_js_1.forEach; } });
|
|
106
|
-
Object.defineProperty(exports, "fold", { enumerable: true, get: function () { return collections_js_1.fold; } });
|
|
107
|
-
Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return collections_js_1.reduce; } });
|
|
108
|
-
Object.defineProperty(exports, "sumOf", { enumerable: true, get: function () { return collections_js_1.sumOf; } });
|
|
109
|
-
Object.defineProperty(exports, "any", { enumerable: true, get: function () { return collections_js_1.any; } });
|
|
110
|
-
Object.defineProperty(exports, "all", { enumerable: true, get: function () { return collections_js_1.all; } });
|
|
111
|
-
Object.defineProperty(exports, "none", { enumerable: true, get: function () { return collections_js_1.none; } });
|
|
112
|
-
Object.defineProperty(exports, "count", { enumerable: true, get: function () { return collections_js_1.count; } });
|
|
113
|
-
Object.defineProperty(exports, "first", { enumerable: true, get: function () { return collections_js_1.first; } });
|
|
114
|
-
Object.defineProperty(exports, "firstOrNull", { enumerable: true, get: function () { return collections_js_1.firstOrNull; } });
|
|
115
|
-
Object.defineProperty(exports, "last", { enumerable: true, get: function () { return collections_js_1.last; } });
|
|
116
|
-
Object.defineProperty(exports, "lastOrNull", { enumerable: true, get: function () { return collections_js_1.lastOrNull; } });
|
|
117
|
-
Object.defineProperty(exports, "find", { enumerable: true, get: function () { return collections_js_1.find; } });
|
|
118
|
-
Object.defineProperty(exports, "findLast", { enumerable: true, get: function () { return collections_js_1.findLast; } });
|
|
119
|
-
Object.defineProperty(exports, "flatMap", { enumerable: true, get: function () { return collections_js_1.flatMap; } });
|
|
120
|
-
Object.defineProperty(exports, "flatten", { enumerable: true, get: function () { return collections_js_1.flatten; } });
|
|
121
|
-
Object.defineProperty(exports, "groupBy", { enumerable: true, get: function () { return collections_js_1.groupBy; } });
|
|
122
|
-
Object.defineProperty(exports, "associate", { enumerable: true, get: function () { return collections_js_1.associate; } });
|
|
123
|
-
Object.defineProperty(exports, "zip", { enumerable: true, get: function () { return collections_js_1.zip; } });
|
|
124
|
-
Object.defineProperty(exports, "distinct", { enumerable: true, get: function () { return collections_js_1.distinct; } });
|
|
125
|
-
Object.defineProperty(exports, "distinctBy", { enumerable: true, get: function () { return collections_js_1.distinctBy; } });
|
|
126
|
-
Object.defineProperty(exports, "sortedBy", { enumerable: true, get: function () { return collections_js_1.sortedBy; } });
|
|
127
|
-
Object.defineProperty(exports, "sortedByDescending", { enumerable: true, get: function () { return collections_js_1.sortedByDescending; } });
|
|
128
|
-
Object.defineProperty(exports, "reversed", { enumerable: true, get: function () { return collections_js_1.reversed; } });
|
|
129
|
-
Object.defineProperty(exports, "take", { enumerable: true, get: function () { return collections_js_1.take; } });
|
|
130
|
-
Object.defineProperty(exports, "takeWhile", { enumerable: true, get: function () { return collections_js_1.takeWhile; } });
|
|
131
|
-
Object.defineProperty(exports, "drop", { enumerable: true, get: function () { return collections_js_1.drop; } });
|
|
132
|
-
Object.defineProperty(exports, "dropWhile", { enumerable: true, get: function () { return collections_js_1.dropWhile; } });
|
|
133
|
-
Object.defineProperty(exports, "chunked", { enumerable: true, get: function () { return collections_js_1.chunked; } });
|
|
134
|
-
Object.defineProperty(exports, "windowed", { enumerable: true, get: function () { return collections_js_1.windowed; } });
|
|
135
|
-
Object.defineProperty(exports, "partition", { enumerable: true, get: function () { return collections_js_1.partition; } });
|
|
136
|
-
Object.defineProperty(exports, "withIndex", { enumerable: true, get: function () { return collections_js_1.withIndex; } });
|
|
137
|
-
Object.defineProperty(exports, "minOf", { enumerable: true, get: function () { return collections_js_1.minOf; } });
|
|
138
|
-
Object.defineProperty(exports, "maxOf", { enumerable: true, get: function () { return collections_js_1.maxOf; } });
|
|
139
|
-
Object.defineProperty(exports, "minOrNull", { enumerable: true, get: function () { return collections_js_1.minOrNull; } });
|
|
140
|
-
Object.defineProperty(exports, "maxOrNull", { enumerable: true, get: function () { return collections_js_1.maxOrNull; } });
|
|
141
|
-
Object.defineProperty(exports, "joinToString", { enumerable: true, get: function () { return collections_js_1.joinToString; } });
|
|
142
|
-
Object.defineProperty(exports, "buildList", { enumerable: true, get: function () { return collections_js_1.buildList; } });
|
|
143
|
-
Object.defineProperty(exports, "buildSet", { enumerable: true, get: function () { return collections_js_1.buildSet; } });
|
|
144
|
-
Object.defineProperty(exports, "buildMap", { enumerable: true, get: function () { return collections_js_1.buildMap; } });
|
|
145
|
-
var strings_js_1 = require("./stdlib/strings.js");
|
|
146
|
-
Object.defineProperty(exports, "isBlank", { enumerable: true, get: function () { return strings_js_1.isBlank; } });
|
|
147
|
-
Object.defineProperty(exports, "isNotBlank", { enumerable: true, get: function () { return strings_js_1.isNotBlank; } });
|
|
148
|
-
Object.defineProperty(exports, "isNullOrBlank", { enumerable: true, get: function () { return strings_js_1.isNullOrBlank; } });
|
|
149
|
-
Object.defineProperty(exports, "toIntOrNull", { enumerable: true, get: function () { return strings_js_1.toIntOrNull; } });
|
|
150
|
-
Object.defineProperty(exports, "toDoubleOrNull", { enumerable: true, get: function () { return strings_js_1.toDoubleOrNull; } });
|
|
151
|
-
Object.defineProperty(exports, "toBooleanOrNull", { enumerable: true, get: function () { return strings_js_1.toBooleanOrNull; } });
|
|
152
|
-
Object.defineProperty(exports, "padStart", { enumerable: true, get: function () { return strings_js_1.padStart; } });
|
|
153
|
-
Object.defineProperty(exports, "padEnd", { enumerable: true, get: function () { return strings_js_1.padEnd; } });
|
|
154
|
-
Object.defineProperty(exports, "repeatString", { enumerable: true, get: function () { return strings_js_1.repeat_; } });
|
|
155
|
-
Object.defineProperty(exports, "capitalize", { enumerable: true, get: function () { return strings_js_1.capitalize; } });
|
|
156
|
-
Object.defineProperty(exports, "decapitalize", { enumerable: true, get: function () { return strings_js_1.decapitalize; } });
|
|
157
|
-
Object.defineProperty(exports, "substringBefore", { enumerable: true, get: function () { return strings_js_1.substringBefore; } });
|
|
158
|
-
Object.defineProperty(exports, "substringAfter", { enumerable: true, get: function () { return strings_js_1.substringAfter; } });
|
|
159
|
-
Object.defineProperty(exports, "substringBeforeLast", { enumerable: true, get: function () { return strings_js_1.substringBeforeLast; } });
|
|
160
|
-
Object.defineProperty(exports, "substringAfterLast", { enumerable: true, get: function () { return strings_js_1.substringAfterLast; } });
|
|
161
|
-
Object.defineProperty(exports, "removePrefix", { enumerable: true, get: function () { return strings_js_1.removePrefix; } });
|
|
162
|
-
Object.defineProperty(exports, "removeSuffix", { enumerable: true, get: function () { return strings_js_1.removeSuffix; } });
|
|
163
|
-
Object.defineProperty(exports, "lines", { enumerable: true, get: function () { return strings_js_1.lines; } });
|
|
164
|
-
Object.defineProperty(exports, "lineSequence", { enumerable: true, get: function () { return strings_js_1.lineSequence; } });
|
|
165
|
-
Object.defineProperty(exports, "ifEmpty", { enumerable: true, get: function () { return strings_js_1.ifEmpty; } });
|
|
166
|
-
Object.defineProperty(exports, "ifBlank", { enumerable: true, get: function () { return strings_js_1.ifBlank; } });
|
|
167
|
-
Object.defineProperty(exports, "trimIndent", { enumerable: true, get: function () { return strings_js_1.trimIndent; } });
|
|
168
|
-
Object.defineProperty(exports, "StringBuilder", { enumerable: true, get: function () { return strings_js_1.StringBuilder; } });
|
|
169
|
-
Object.defineProperty(exports, "buildString", { enumerable: true, get: function () { return strings_js_1.buildString; } });
|
|
170
|
-
var math_js_1 = require("./stdlib/math.js");
|
|
171
|
-
Object.defineProperty(exports, "abs", { enumerable: true, get: function () { return math_js_1.abs; } });
|
|
172
|
-
Object.defineProperty(exports, "ceil", { enumerable: true, get: function () { return math_js_1.ceil; } });
|
|
173
|
-
Object.defineProperty(exports, "floor", { enumerable: true, get: function () { return math_js_1.floor; } });
|
|
174
|
-
Object.defineProperty(exports, "round", { enumerable: true, get: function () { return math_js_1.round; } });
|
|
175
|
-
Object.defineProperty(exports, "sqrt", { enumerable: true, get: function () { return math_js_1.sqrt; } });
|
|
176
|
-
Object.defineProperty(exports, "pow", { enumerable: true, get: function () { return math_js_1.pow; } });
|
|
177
|
-
Object.defineProperty(exports, "exp", { enumerable: true, get: function () { return math_js_1.exp; } });
|
|
178
|
-
Object.defineProperty(exports, "ln", { enumerable: true, get: function () { return math_js_1.ln; } });
|
|
179
|
-
Object.defineProperty(exports, "log2", { enumerable: true, get: function () { return math_js_1.log2; } });
|
|
180
|
-
Object.defineProperty(exports, "log10", { enumerable: true, get: function () { return math_js_1.log10; } });
|
|
181
|
-
Object.defineProperty(exports, "sin", { enumerable: true, get: function () { return math_js_1.sin; } });
|
|
182
|
-
Object.defineProperty(exports, "cos", { enumerable: true, get: function () { return math_js_1.cos; } });
|
|
183
|
-
Object.defineProperty(exports, "tan", { enumerable: true, get: function () { return math_js_1.tan; } });
|
|
184
|
-
Object.defineProperty(exports, "asin", { enumerable: true, get: function () { return math_js_1.asin; } });
|
|
185
|
-
Object.defineProperty(exports, "acos", { enumerable: true, get: function () { return math_js_1.acos; } });
|
|
186
|
-
Object.defineProperty(exports, "atan", { enumerable: true, get: function () { return math_js_1.atan; } });
|
|
187
|
-
Object.defineProperty(exports, "atan2", { enumerable: true, get: function () { return math_js_1.atan2; } });
|
|
188
|
-
Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return math_js_1.sign; } });
|
|
189
|
-
Object.defineProperty(exports, "hypot", { enumerable: true, get: function () { return math_js_1.hypot; } });
|
|
190
|
-
Object.defineProperty(exports, "truncate", { enumerable: true, get: function () { return math_js_1.truncate; } });
|
|
191
|
-
Object.defineProperty(exports, "clamp", { enumerable: true, get: function () { return math_js_1.clamp; } });
|
|
192
|
-
Object.defineProperty(exports, "truncDiv", { enumerable: true, get: function () { return math_js_1.truncDiv; } });
|
|
193
|
-
Object.defineProperty(exports, "PI", { enumerable: true, get: function () { return math_js_1.PI; } });
|
|
194
|
-
Object.defineProperty(exports, "E", { enumerable: true, get: function () { return math_js_1.E; } });
|
|
195
|
-
Object.defineProperty(exports, "coerceAtLeast", { enumerable: true, get: function () { return math_js_1.coerceAtLeast; } });
|
|
196
|
-
Object.defineProperty(exports, "coerceAtMost", { enumerable: true, get: function () { return math_js_1.coerceAtMost; } });
|
|
197
|
-
Object.defineProperty(exports, "coerceIn", { enumerable: true, get: function () { return math_js_1.coerceIn; } });
|
|
198
|
-
Object.defineProperty(exports, "Int", { enumerable: true, get: function () { return math_js_1.Int; } });
|
|
199
|
-
Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return math_js_1.Long; } });
|
|
200
|
-
var conversions_js_1 = require("./stdlib/conversions.js");
|
|
201
|
-
Object.defineProperty(exports, "toInt", { enumerable: true, get: function () { return conversions_js_1.toInt; } });
|
|
202
|
-
Object.defineProperty(exports, "toLong", { enumerable: true, get: function () { return conversions_js_1.toLong; } });
|
|
203
|
-
Object.defineProperty(exports, "toFloat", { enumerable: true, get: function () { return conversions_js_1.toFloat; } });
|
|
204
|
-
Object.defineProperty(exports, "toDouble", { enumerable: true, get: function () { return conversions_js_1.toDouble; } });
|
|
205
|
-
Object.defineProperty(exports, "toChar", { enumerable: true, get: function () { return conversions_js_1.toChar; } });
|
|
206
|
-
Object.defineProperty(exports, "charCodeOf", { enumerable: true, get: function () { return conversions_js_1.charCodeOf; } });
|
|
207
|
-
Object.defineProperty(exports, "toString", { enumerable: true, get: function () { return conversions_js_1.toString; } });
|
|
208
|
-
Object.defineProperty(exports, "Pair", { enumerable: true, get: function () { return conversions_js_1.Pair; } });
|
|
209
|
-
Object.defineProperty(exports, "Triple", { enumerable: true, get: function () { return conversions_js_1.Triple; } });
|
|
210
|
-
Object.defineProperty(exports, "range", { enumerable: true, get: function () { return conversions_js_1.range; } });
|
|
211
|
-
Object.defineProperty(exports, "IntRange", { enumerable: true, get: function () { return conversions_js_1.IntRange; } });
|
|
212
|
-
Object.defineProperty(exports, "downTo", { enumerable: true, get: function () { return conversions_js_1.downTo; } });
|
|
213
|
-
Object.defineProperty(exports, "step", { enumerable: true, get: function () { return conversions_js_1.step; } });
|
|
214
|
-
var result_js_1 = require("./stdlib/result.js");
|
|
215
|
-
Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return result_js_1.Result; } });
|
|
216
|
-
Object.defineProperty(exports, "runCatching", { enumerable: true, get: function () { return result_js_1.runCatching; } });
|
|
217
|
-
Object.defineProperty(exports, "runCatchingAsync", { enumerable: true, get: function () { return result_js_1.runCatchingAsync; } });
|
|
218
|
-
var regex_js_1 = require("./stdlib/regex.js");
|
|
219
|
-
Object.defineProperty(exports, "Regex", { enumerable: true, get: function () { return regex_js_1.Regex; } });
|
|
220
|
-
Object.defineProperty(exports, "RegexResult", { enumerable: true, get: function () { return regex_js_1.RegexResult; } });
|
|
221
|
-
var random_js_1 = require("./stdlib/random.js");
|
|
222
|
-
Object.defineProperty(exports, "Random", { enumerable: true, get: function () { return random_js_1.Random; } });
|
|
223
|
-
Object.defineProperty(exports, "DefaultRandom", { enumerable: true, get: function () { return random_js_1.Default; } });
|
|
224
|
-
Object.defineProperty(exports, "randomUUID", { enumerable: true, get: function () { return random_js_1.randomUUID; } });
|
|
225
|
-
var timing_js_1 = require("./stdlib/timing.js");
|
|
226
|
-
Object.defineProperty(exports, "measureTimeMillis", { enumerable: true, get: function () { return timing_js_1.measureTimeMillis; } });
|
|
227
|
-
Object.defineProperty(exports, "measureTimeMillisAsync", { enumerable: true, get: function () { return timing_js_1.measureTimeMillisAsync; } });
|
|
228
|
-
Object.defineProperty(exports, "measureTimedValue", { enumerable: true, get: function () { return timing_js_1.measureTimedValue; } });
|
|
229
|
-
var equality_js_1 = require("./stdlib/equality.js");
|
|
230
|
-
Object.defineProperty(exports, "jalvinEquals", { enumerable: true, get: function () { return equality_js_1.jalvinEquals; } });
|
|
15
|
+
export { println, print, } from "./stdlib/io.js";
|
|
16
|
+
export { notNull, NullPointerException, safeCast, checkNotNull, requireNotNull, requireCondition, check, error, IllegalArgumentException, IllegalStateException, UnsupportedOperationException, IndexOutOfBoundsException, NoSuchElementException, } from "./stdlib/types.js";
|
|
17
|
+
export { delegate, lazy, Delegates, LazyDelegate, ObservableDelegate, let_, run_, apply, also, with_, takeIf, takeUnless, } from "./stdlib/delegates.js";
|
|
18
|
+
export { listOf, mutableListOf, setOf, mutableSetOf, mapOf, mutableMapOf, pairOf, tripleOf, map, filter, filterNotNull, forEach, fold, reduce, sumOf, any, all, none, count, first, firstOrNull, last, lastOrNull, find, findLast, flatMap, flatten, groupBy, associate, zip, distinct, distinctBy, sortedBy, sortedByDescending, reversed, take, takeWhile, drop, dropWhile, chunked, windowed, partition, withIndex, minOf, maxOf, minOrNull, maxOrNull, joinToString, buildList, buildSet, buildMap, } from "./stdlib/collections.js";
|
|
19
|
+
export { isBlank, isNotBlank, isNullOrBlank, toIntOrNull, toDoubleOrNull, toBooleanOrNull, padStart, padEnd, repeat_ as repeatString, capitalize, decapitalize, substringBefore, substringAfter, substringBeforeLast, substringAfterLast, removePrefix, removeSuffix, lines, lineSequence, ifEmpty, ifBlank, trimIndent, StringBuilder, buildString, } from "./stdlib/strings.js";
|
|
20
|
+
export { abs, ceil, floor, round, sqrt, pow, exp, ln, log2, log10, sin, cos, tan, asin, acos, atan, atan2, sign, hypot, truncate, clamp, truncDiv, PI, E, coerceAtLeast, coerceAtMost, coerceIn, Int, Long, } from "./stdlib/math.js";
|
|
21
|
+
export { toInt, toLong, toFloat, toDouble, toChar, charCodeOf, toString, Pair, Triple, range, IntRange, downTo, step, } from "./stdlib/conversions.js";
|
|
22
|
+
export { Result, runCatching, runCatchingAsync, } from "./stdlib/result.js";
|
|
23
|
+
export { Regex, RegexResult, } from "./stdlib/regex.js";
|
|
24
|
+
export { Random, Default as DefaultRandom, randomUUID, } from "./stdlib/random.js";
|
|
25
|
+
export { measureTimeMillis, measureTimeMillisAsync, measureTimedValue, } from "./stdlib/timing.js";
|
|
26
|
+
export { jalvinEquals, } from "./stdlib/equality.js";
|
|
231
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,cAAc;AACd,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGlF,aAAa;AACb,OAAO,EACL,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EACR,cAAc,EACd,MAAM,EAAE,MAAM,IAAI,KAAK,EACvB,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EACvC,MAAM,EACN,WAAW,EAAE,iBAAiB,EAAE,4BAA4B,EAC5D,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAC1B,cAAc,EAAE,eAAe,GAChC,MAAM,iBAAiB,CAAC;AAGzB,wBAAwB;AACxB,OAAO,EACL,gBAAgB,EAChB,OAAO,EAAE,UAAU,EAAE,YAAY,EACjC,SAAS,EAAE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KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,GAC5C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EAAE,WAAW,EAAE,gBAAgB,GACtC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,EAAE,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,GAC7C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EAAE,sBAAsB,EAAE,iBAAiB,GAC7D,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
package/dist/nav.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { StateFlow } from "./stateflow.js";
|
|
2
|
+
import type { VNode } from "./dom.js";
|
|
3
|
+
export interface BackStackEntry {
|
|
4
|
+
/** Matched route pattern, e.g. "profile/{userId}" */
|
|
5
|
+
route: string;
|
|
6
|
+
/** Actual destination path, e.g. "profile/42" */
|
|
7
|
+
destination: string;
|
|
8
|
+
/** Extracted path parameters */
|
|
9
|
+
arguments: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface NavOptions {
|
|
12
|
+
/** Pop back stack up to (but not including) this route before navigating */
|
|
13
|
+
popUpTo?: string;
|
|
14
|
+
/** If true, also pop the popUpTo route itself */
|
|
15
|
+
popUpToInclusive?: boolean;
|
|
16
|
+
/** If true and already at destination, don't add a duplicate entry */
|
|
17
|
+
launchSingleTop?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface CompiledRoute {
|
|
20
|
+
pattern: string;
|
|
21
|
+
regex: RegExp;
|
|
22
|
+
paramNames: string[];
|
|
23
|
+
content: (entry: BackStackEntry) => VNode;
|
|
24
|
+
}
|
|
25
|
+
export declare class NavGraphBuilder {
|
|
26
|
+
readonly _routes: CompiledRoute[];
|
|
27
|
+
composable(pattern: string, content: (entry: BackStackEntry) => VNode): void;
|
|
28
|
+
}
|
|
29
|
+
export declare class NavController {
|
|
30
|
+
private readonly _backStack;
|
|
31
|
+
private readonly _currentEntry;
|
|
32
|
+
private _resolver;
|
|
33
|
+
constructor();
|
|
34
|
+
get currentBackStackEntry(): StateFlow<BackStackEntry | null>;
|
|
35
|
+
_setResolver(resolver: (dest: string) => BackStackEntry | null): void;
|
|
36
|
+
_initFromHash(startDestination: string): void;
|
|
37
|
+
private _navigateTo;
|
|
38
|
+
navigate(destination: string, options?: NavOptions): void;
|
|
39
|
+
popBackStack(): boolean;
|
|
40
|
+
canPopBackStack(): boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare function rememberNavController(): NavController;
|
|
43
|
+
export declare function NavHost(props: {
|
|
44
|
+
navController: NavController;
|
|
45
|
+
startDestination: string;
|
|
46
|
+
}, children?: Array<((builder: NavGraphBuilder) => void) | any>): VNode;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.d.ts","sourceRoot":"","sources":["../src/nav.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,UAAU,aAAa;IACrB,OAAO,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low } from "./stateflow.js";
|
|
3
|
+
import { remember, collectAsState } from "./ui.js";
|
|
4
|
+
function compilePattern(pattern) {
|
|
5
|
+
const paramNames = [];
|
|
6
|
+
const regexStr = pattern.replace(/\{(\w+)\}/g, (_, name) => {
|
|
7
|
+
paramNames.push(name);
|
|
8
|
+
return "([^/]+)";
|
|
9
|
+
});
|
|
10
|
+
return { regex: new RegExp(`^${regexStr}$`), paramNames };
|
|
11
|
+
}
|
|
12
|
+
function matchRoute(routes, destination) {
|
|
13
|
+
for (const route of routes) {
|
|
14
|
+
const m = route.regex.exec(destination);
|
|
15
|
+
if (m) {
|
|
16
|
+
const args = {};
|
|
17
|
+
for (let i = 0; i < route.paramNames.length; i++) {
|
|
18
|
+
args[route.paramNames[i] ?? ""] = m[i + 1] ?? "";
|
|
19
|
+
}
|
|
20
|
+
return { route: route.pattern, destination, arguments: args };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
export class NavGraphBuilder {
|
|
26
|
+
_routes = [];
|
|
27
|
+
composable(pattern, content) {
|
|
28
|
+
const { regex, paramNames } = compilePattern(pattern);
|
|
29
|
+
this._routes.push({ pattern, regex, paramNames, content });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class NavController {
|
|
33
|
+
_backStack = [];
|
|
34
|
+
_currentEntry;
|
|
35
|
+
_resolver = null;
|
|
36
|
+
constructor() {
|
|
37
|
+
this._currentEntry = new MutableStateFlow(null);
|
|
38
|
+
}
|
|
39
|
+
get currentBackStackEntry() {
|
|
40
|
+
return this._currentEntry;
|
|
41
|
+
}
|
|
42
|
+
_setResolver(resolver) {
|
|
43
|
+
this._resolver = resolver;
|
|
44
|
+
}
|
|
45
|
+
_initFromHash(startDestination) {
|
|
46
|
+
const hash = typeof window !== "undefined" ? window.location.hash : "";
|
|
47
|
+
const dest = hash.startsWith("#/") ? hash.slice(2) : startDestination;
|
|
48
|
+
this._navigateTo(dest);
|
|
49
|
+
if (typeof window !== "undefined") {
|
|
50
|
+
window.addEventListener("hashchange", () => {
|
|
51
|
+
const h = window.location.hash;
|
|
52
|
+
const d = h.startsWith("#/") ? h.slice(2) : startDestination;
|
|
53
|
+
this._navigateTo(d);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_navigateTo(destination) {
|
|
58
|
+
const entry = this._resolver ? this._resolver(destination) : null;
|
|
59
|
+
if (!entry)
|
|
60
|
+
return;
|
|
61
|
+
this._backStack.push(entry);
|
|
62
|
+
this._currentEntry.value = entry;
|
|
63
|
+
}
|
|
64
|
+
navigate(destination, options) {
|
|
65
|
+
if (options?.launchSingleTop && this._currentEntry.value?.destination === destination) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (options?.popUpTo) {
|
|
69
|
+
const targetRoute = options.popUpTo;
|
|
70
|
+
let idx = this._backStack.length - 1;
|
|
71
|
+
while (idx >= 0) {
|
|
72
|
+
const e = this._backStack[idx];
|
|
73
|
+
if (e && e.route === targetRoute)
|
|
74
|
+
break;
|
|
75
|
+
idx--;
|
|
76
|
+
}
|
|
77
|
+
if (idx >= 0) {
|
|
78
|
+
const removeFrom = options.popUpToInclusive ? idx : idx + 1;
|
|
79
|
+
this._backStack.splice(removeFrom);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (typeof window !== "undefined") {
|
|
83
|
+
window.location.hash = `#/${destination}`;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this._navigateTo(destination);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
popBackStack() {
|
|
90
|
+
if (this._backStack.length <= 1)
|
|
91
|
+
return false;
|
|
92
|
+
this._backStack.pop();
|
|
93
|
+
const prev = this._backStack[this._backStack.length - 1] ?? null;
|
|
94
|
+
this._currentEntry.value = prev;
|
|
95
|
+
if (prev && typeof window !== "undefined") {
|
|
96
|
+
// replaceState does not fire hashchange, so no re-push into _backStack
|
|
97
|
+
history.replaceState(null, "", `#/${prev.destination}`);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
canPopBackStack() {
|
|
102
|
+
return this._backStack.length > 1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export function rememberNavController() {
|
|
106
|
+
return remember(() => new NavController());
|
|
107
|
+
}
|
|
108
|
+
export function NavHost(props, children) {
|
|
109
|
+
const { navController, startDestination } = props;
|
|
110
|
+
const builder = remember(() => {
|
|
111
|
+
const b = new NavGraphBuilder();
|
|
112
|
+
if (children) {
|
|
113
|
+
for (const child of children) {
|
|
114
|
+
if (typeof child === "function")
|
|
115
|
+
child(b);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return b;
|
|
119
|
+
});
|
|
120
|
+
remember(() => {
|
|
121
|
+
navController._setResolver((dest) => matchRoute(builder._routes, dest));
|
|
122
|
+
navController._initFromHash(startDestination);
|
|
123
|
+
return true;
|
|
124
|
+
});
|
|
125
|
+
const entry = collectAsState(navController.currentBackStackEntry);
|
|
126
|
+
if (!entry) {
|
|
127
|
+
return { tag: "div", props: {}, children: [] };
|
|
128
|
+
}
|
|
129
|
+
for (const route of builder._routes) {
|
|
130
|
+
if (route.regex.test(entry.destination)) {
|
|
131
|
+
return route.content(entry);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return { tag: "div", props: {}, children: [] };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=nav.js.map
|
package/dist/nav.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../src/nav.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA4BnD,SAAS,cAAc,CAAC,OAAe;IACrC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,M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