@nxtedition/lib 23.3.30 → 23.3.32

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/logger.d.ts CHANGED
@@ -13,6 +13,6 @@ export function createLogger(
13
13
  flushInterval = 1e3,
14
14
  stream = null,
15
15
  ...options
16
- }: LoggerOptions = {},
17
- onTerminate: unknown,
16
+ }?: LoggerOptions,
17
+ onTerminate?: unknown,
18
18
  ): Logger
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.3.30",
3
+ "version": "23.3.32",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -0,0 +1,43 @@
1
+ import type { FirstValueFromConfig } from 'rxjs/internal/firstValueFrom'
2
+ import type * as rx from 'rxjs'
3
+
4
+ export function makeTemplateCompiler(params: MakeTemplateCompilerParams): TemplateCompiler
5
+
6
+ export interface TemplateCompiler {
7
+ current: null
8
+
9
+ resolveTemplate: <ReturnValue, Context>(
10
+ template: Nxtpression<ReturnValue, Context> | string,
11
+ args$?: Context | rx.Observable<Context>,
12
+ options?: FirstValueFromConfig,
13
+ ) => Promise<ReturnValue>
14
+
15
+ onResolveTemplate: <ReturnValue, Context>(
16
+ template: Nxtpression<ReturnValue, Context> | string,
17
+ args$?: Context | rx.Observable<Context>,
18
+ ) => rx.Observable<ReturnValue>
19
+
20
+ compileTemplate: <ReturnValue, Context>(
21
+ template: Nxtpression<ReturnValue, Context> | string,
22
+ ) => null | ((args$?: Context | rx.Observable<Context>) => rx.Observable<ReturnValue>)
23
+
24
+ isTemplate: (value: unknown) => value is Nxtpression
25
+ }
26
+
27
+ export type Nxtpression<ReturnValue = string, Context extends object = object> =
28
+ // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
29
+ | (String & {
30
+ /**
31
+ * TS-HACK: this property doesn't really exist on the nxtpression string,
32
+ * it is only here to make sure the generic Context won't get stripped.
33
+ */
34
+ __context: Context
35
+
36
+ /**
37
+ * TS-HACK: this property doesn't really exist on the nxtpression string,
38
+ * it is only here to make sure the generic Context won't get stripped.
39
+ */
40
+ __returnValue: ReturnValue
41
+ })
42
+ | string
43
+ | ReturnValue