@thi.ng/api 8.10.1 → 8.11.1
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 +7 -1
- package/README.md +2 -2
- package/get.d.ts +3 -2
- package/null.d.ts +1 -0
- package/package.json +3 -4
- package/path.d.ts +5 -4
- package/seq.d.ts +4 -3
- package/stack.d.ts +8 -2
- package/typedarray.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-04-
|
|
3
|
+
- **Last updated**: 2024-04-23T07:02:17Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [8.11.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/api@8.11.0) (2024-04-20)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add Maybe type alias, refactor related ([0777d33](https://github.com/thi-ng/umbrella/commit/0777d33))
|
|
17
|
+
|
|
12
18
|
## [8.10.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/api@8.10.0) (2024-04-08)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -55,10 +55,10 @@ import * as api from "@thi.ng/api";
|
|
|
55
55
|
Browser ESM import:
|
|
56
56
|
|
|
57
57
|
```html
|
|
58
|
-
<script type="module" src="https://
|
|
58
|
+
<script type="module" src="https://esm.run/@thi.ng/api"></script>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
[
|
|
61
|
+
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
62
62
|
|
|
63
63
|
For Node.js REPL:
|
|
64
64
|
|
package/get.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { Maybe } from "./null.js";
|
|
1
2
|
/**
|
|
2
3
|
* @param K - key type
|
|
3
4
|
* @param V - value type
|
|
4
5
|
*/
|
|
5
6
|
export interface IGet<K, V> {
|
|
6
|
-
get(key: K, notfound?: V): V
|
|
7
|
+
get(key: K, notfound?: V): Maybe<V>;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* @param K - key type
|
|
10
11
|
* @param V - value type
|
|
11
12
|
*/
|
|
12
13
|
export interface IGetIn<K, V> {
|
|
13
|
-
getIn(key: K[], notfound?: V): V
|
|
14
|
+
getIn(key: K[], notfound?: V): Maybe<V>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=get.d.ts.map
|
package/null.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/api",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.1",
|
|
4
4
|
"description": "Common, generic types, interfaces & mixins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"build": "yarn build:esbuild && yarn build:decl",
|
|
31
31
|
"build:decl": "tsc --declaration --emitDeclarationOnly",
|
|
32
32
|
"build:esbuild": "esbuild --format=esm --platform=neutral --target=es2022 --tsconfig=tsconfig.json --outdir=. src/**/*.ts",
|
|
33
|
-
"clean": "
|
|
33
|
+
"clean": "bun ../../tools/src/clean-package.ts decorators mixins",
|
|
34
34
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
35
35
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
36
36
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@microsoft/api-extractor": "^7.43.0",
|
|
43
43
|
"esbuild": "^0.20.2",
|
|
44
|
-
"rimraf": "^5.0.5",
|
|
45
44
|
"typedoc": "^0.25.12",
|
|
46
45
|
"typescript": "^5.4.3"
|
|
47
46
|
},
|
|
@@ -229,5 +228,5 @@
|
|
|
229
228
|
"default": "./watch.js"
|
|
230
229
|
}
|
|
231
230
|
},
|
|
232
|
-
"gitHead": "
|
|
231
|
+
"gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
|
|
233
232
|
}
|
package/path.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { NumOrString } from "./prim.js";
|
|
2
1
|
import type { Keys, Keys1, Keys2, Keys3, Keys4, Keys5, Keys6, Keys7, ValN } from "./keyval.js";
|
|
3
|
-
import type {
|
|
2
|
+
import type { Maybe } from "./null.js";
|
|
3
|
+
import type { NumOrString } from "./prim.js";
|
|
4
|
+
import type { Head, IsEmpty, Tail } from "./tuple.js";
|
|
4
5
|
/**
|
|
5
6
|
* Unchecked lookup path for nested data structures.
|
|
6
7
|
*/
|
|
@@ -47,9 +48,9 @@ export type Path8<T, A, B, C, D, E, F, G, H> = A extends Keys<T> ? B extends Key
|
|
|
47
48
|
*/
|
|
48
49
|
export type DeepPath<T, A, B, C, D, E, F, G, H> = A extends Keys<T> ? B extends Keys1<T, A> ? C extends Keys2<T, A, B> ? D extends Keys3<T, A, B, C> ? E extends Keys4<T, A, B, C, D> ? F extends Keys5<T, A, B, C, D, E> ? G extends Keys6<T, A, B, C, D, E, F> ? H extends Keys7<T, A, B, C, D, E, F, G> ? readonly [A, B, C, D, E, F, G, H, ...NumOrString[]] : never : never : never : never : never : never : never : never;
|
|
49
50
|
/**
|
|
50
|
-
* Returns `RES` if `PRED` is `never`, else `RES
|
|
51
|
+
* Returns `RES` if `PRED` is `never`, else `Maybe<RES>`
|
|
51
52
|
*/
|
|
52
|
-
export type OptVal<PRED, RES> = [PRED] extends [never] ? RES : RES
|
|
53
|
+
export type OptVal<PRED, RES> = [PRED] extends [never] ? RES : Maybe<RES>;
|
|
53
54
|
/**
|
|
54
55
|
* Returns true if `T` includes undefined.
|
|
55
56
|
*/
|
package/seq.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from "./null.js";
|
|
1
2
|
/**
|
|
2
3
|
* Lisp-like sequence abstraction for arbitrary types using `first` &
|
|
3
4
|
* `next` operations only.
|
|
@@ -18,7 +19,7 @@ export interface ISeq<T> {
|
|
|
18
19
|
* determine the end. If the sequence DOES contain `undefined`
|
|
19
20
|
* values, the check should use `seq.next()`.
|
|
20
21
|
*/
|
|
21
|
-
first(): T
|
|
22
|
+
first(): Maybe<T>;
|
|
22
23
|
/**
|
|
23
24
|
* Returns a new sequence of the remaining elements or `undefined`
|
|
24
25
|
* if there're no further values.
|
|
@@ -28,7 +29,7 @@ export interface ISeq<T> {
|
|
|
28
29
|
* a new sequence instance and not mutate some internal cursor. I.e.
|
|
29
30
|
* `seq.next() !== seq`
|
|
30
31
|
*/
|
|
31
|
-
next(): ISeq<T
|
|
32
|
+
next(): Maybe<ISeq<T>>;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Interface for data types providing an {@link ISeq} abstraction.
|
|
@@ -38,6 +39,6 @@ export interface ISeqable<T> {
|
|
|
38
39
|
* Returns an {@link ISeq} of the type's data or `undefined` if
|
|
39
40
|
* there're no values available. See {@link ISeq.next}
|
|
40
41
|
*/
|
|
41
|
-
seq(): ISeq<T
|
|
42
|
+
seq(): Maybe<ISeq<T>>;
|
|
42
43
|
}
|
|
43
44
|
//# sourceMappingURL=seq.d.ts.map
|
package/stack.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from "./null.js";
|
|
1
2
|
/**
|
|
2
3
|
* Generic interface for collections implementing
|
|
3
4
|
* stack functionality.
|
|
@@ -10,11 +11,16 @@ export interface IStack<V, P, S> {
|
|
|
10
11
|
/**
|
|
11
12
|
* Returns top-of-stack item.
|
|
12
13
|
*/
|
|
13
|
-
peek(): V
|
|
14
|
+
peek(): Maybe<V>;
|
|
14
15
|
/**
|
|
15
16
|
* Removes top-of-stack item and returns type P.
|
|
16
17
|
*/
|
|
17
|
-
pop(): P
|
|
18
|
+
pop(): Maybe<P>;
|
|
19
|
+
/**
|
|
20
|
+
* Pushes item onto stack, returns type S.
|
|
21
|
+
*
|
|
22
|
+
* @param x
|
|
23
|
+
*/
|
|
18
24
|
push(x: V): S;
|
|
19
25
|
}
|
|
20
26
|
//# sourceMappingURL=stack.d.ts.map
|
package/typedarray.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Maybe } from "./null.js";
|
|
1
2
|
export type ArrayLikeIterable<T> = ArrayLike<T> & Iterable<T>;
|
|
2
3
|
export type NumericArray = number[] | TypedArray;
|
|
3
4
|
export type TypedArray = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
|
|
@@ -49,7 +50,7 @@ export declare const GL2TYPE: Record<GLType, Type>;
|
|
|
49
50
|
* - `F64` maps to `undefined`, since unsupported by WebGL
|
|
50
51
|
* - `U8C` maps to "u8"
|
|
51
52
|
*/
|
|
52
|
-
export declare const TYPE2GL: Record<Type, GLType
|
|
53
|
+
export declare const TYPE2GL: Record<Type, Maybe<GLType>>;
|
|
53
54
|
/**
|
|
54
55
|
* Size information (in bytes) for {@link Type} and {@link BigType}. Also see
|
|
55
56
|
* {@link sizeOf}.
|